feat(generated): OrganizationMembership (batch e471ddef)#503
feat(generated): OrganizationMembership (batch e471ddef)#503workos-sdk-automation[bot] wants to merge 2 commits into
Conversation
Greptile SummaryThis PR regenerates organization membership SDK models and round-trip coverage. The main changes are:
Confidence Score: 2/5The generated round-trip suite references SDK model constants that are not present in the library, which can break test execution before assertions run. The organization membership role regeneration is straightforward, but the added generated test coverage includes references to missing constants. The RBI signatures also do not match the Ruby initializer behavior for null role array entries. test/workos/test_model_round_trip.rb, rbi/workos/organization_membership.rbi, rbi/workos/user_organization_membership.rbi
What T-Rex did
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
test/workos/test_model_round_trip.rb:5464
**Missing Generated Model Constants**
This new test constructs `WorkOS::PipesConnectedAccountConnectionFailed`, but the generated library does not define that constant, so the round-trip suite will raise `NameError` before the assertion runs. The same missing-model path applies to the other new constants added here: `PipesConnectedAccountConnectionFailedData`, `SessionReauthenticated`, `SessionReauthenticatedData`, `SessionReauthenticatedDataImpersonator`, and `AuthMethodMismatchError`.
### Issue 2 of 2
rbi/workos/organization_membership.rbi:78-82
**Roles Type Excludes Nil Items**
The new RBI says `roles` is always `T::Array[WorkOS::SlimRole]`, but the Ruby initializer keeps null API entries as `nil` with `item ? WorkOS::SlimRole.new(item) : nil`. If an API response contains `"roles": [null]`, Sorbet-typed callers can treat each entry as a `SlimRole` and then hit `NoMethodError` at runtime; the mirrored signature in `user_organization_membership.rbi` has the same mismatch.
Reviews (1): Last reviewed commit: "chore(generated): add release notes frag..." | Re-trigger Greptile |
| "created_at" => "stub", | ||
| "context" => {} | ||
| } | ||
| model = WorkOS::PipesConnectedAccountConnectionFailed.new(fixture.to_json) |
There was a problem hiding this comment.
Missing Generated Model Constants
This new test constructs WorkOS::PipesConnectedAccountConnectionFailed, but the generated library does not define that constant, so the round-trip suite will raise NameError before the assertion runs. The same missing-model path applies to the other new constants added here: PipesConnectedAccountConnectionFailedData, SessionReauthenticated, SessionReauthenticatedData, SessionReauthenticatedDataImpersonator, and AuthMethodMismatchError.
Prompt To Fix With AI
This is a comment left during a code review.
Path: test/workos/test_model_round_trip.rb
Line: 5464
Comment:
**Missing Generated Model Constants**
This new test constructs `WorkOS::PipesConnectedAccountConnectionFailed`, but the generated library does not define that constant, so the round-trip suite will raise `NameError` before the assertion runs. The same missing-model path applies to the other new constants added here: `PipesConnectedAccountConnectionFailedData`, `SessionReauthenticated`, `SessionReauthenticatedData`, `SessionReauthenticatedDataImpersonator`, and `AuthMethodMismatchError`.
How can I resolve this? If you propose a fix, please make it concise.| sig { returns(T::Array[WorkOS::SlimRole]) } | ||
| def roles; end | ||
|
|
||
| sig { params(value: T::Array[WorkOS::SlimRole]).returns(T::Array[WorkOS::SlimRole]) } | ||
| def roles=(value); end |
There was a problem hiding this comment.
The new RBI says roles is always T::Array[WorkOS::SlimRole], but the Ruby initializer keeps null API entries as nil with item ? WorkOS::SlimRole.new(item) : nil. If an API response contains "roles": [null], Sorbet-typed callers can treat each entry as a SlimRole and then hit NoMethodError at runtime; the mirrored signature in user_organization_membership.rbi has the same mismatch.
Prompt To Fix With AI
This is a comment left during a code review.
Path: rbi/workos/organization_membership.rbi
Line: 78-82
Comment:
**Roles Type Excludes Nil Items**
The new RBI says `roles` is always `T::Array[WorkOS::SlimRole]`, but the Ruby initializer keeps null API entries as `nil` with `item ? WorkOS::SlimRole.new(item) : nil`. If an API response contains `"roles": [null]`, Sorbet-typed callers can treat each entry as a `SlimRole` and then hit `NoMethodError` at runtime; the mirrored signature in `user_organization_membership.rbi` has the same mismatch.
How can I resolve this? If you propose a fix, please make it concise.
Summary
Regenerated SDK from spec changes.
Triggered by workos/openapi-spec@75604c7