Skip to content

feat(generated): OrganizationMembership (batch e471ddef)#503

Closed
workos-sdk-automation[bot] wants to merge 2 commits into
mainfrom
oagen/batch-e471ddef
Closed

feat(generated): OrganizationMembership (batch e471ddef)#503
workos-sdk-automation[bot] wants to merge 2 commits into
mainfrom
oagen/batch-e471ddef

Conversation

@workos-sdk-automation

Copy link
Copy Markdown
Contributor

Summary

Regenerated SDK from spec changes.

Triggered by workos/openapi-spec@75604c7

@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Jun 25, 2026
@workos-sdk-automation workos-sdk-automation Bot requested review from a team as code owners June 25, 2026 13:51
@workos-sdk-automation workos-sdk-automation Bot added the autogenerated Autogenerated code or content label Jun 25, 2026
@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR regenerates organization membership SDK models and round-trip coverage. The main changes are:

  • Added plural roles fields to organization membership models.
  • Added matching RBI accessors for membership roles.
  • Added generated round-trip tests for new event and error models.
  • Updated membership fixtures to include roles.

Confidence Score: 2/5

The 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

T-Rex T-Rex Logs

What T-Rex did

  • Attempted the base checkout for organization-membership-roles and the head checkout, but both runs failed because ruby was not found (exit code 127).
  • The changed Ruby code path could not execute, so no contract mismatch could be confirmed or ruled out from runtime evidence.
  • Attempted missing_generated_model_constants tests before and after, but commands failed due to ruby not found, and a runtime blocker confirmed ruby and bundle were unavailable in this runtime.

View all artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix All With AI
Fix 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 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.

Comment on lines +78 to +82
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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autogenerated Autogenerated code or content

Development

Successfully merging this pull request may close these issues.

0 participants