Skip to content

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

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

feat(generated): OrganizationMembership (batch e471ddef)#404
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 requested a review from mattgd June 25, 2026 13:51
@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR regenerates the PHP SDK from the latest spec. The main changes are:

  • Added roles to organization membership resources.
  • Updated membership fixtures with role arrays.
  • Added new error, session, and pipes event fixtures.
  • Updated generator sync metadata.

Confidence Score: 2/5

The regenerated membership resources introduce runtime compatibility breaks in deserialization and public construction paths.

  • Organization membership payloads that still contain the singular role field but omit roles can fail during parsing.
  • User organization membership payloads have the same unconditional roles access.
  • The public constructors inserted a required argument before an existing parameter, so existing positional callers can bind arguments to the wrong parameter and fail at runtime.
  • Local contract execution was blocked because PHP was unavailable in the environment, so no additional contract mismatch was established.

lib/Resource/OrganizationMembership.php and lib/Resource/UserOrganizationMembership.php

T-Rex T-Rex Logs

What T-Rex did

    • Ran the Before: run against HEAD^-checked-out membership files; the command exited with code 127 due to missing PHP.
    • Ran the After: run against PR head membership files; the command exited with code 127 due to missing PHP.
    • Documented the environment blocker in trex-artifacts/roles-membership-environment.log, noting php -v is unavailable and apt-get update failed with a permission error on /var/lib/apt/lists/partial.

View all artifacts

T-Rex Ran code and verified through T-Rex

Prompt To Fix All With AI
Fix the following 4 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 4
lib/Resource/OrganizationMembership.php:61
**Missing Roles Crashes Parsing**

When an existing membership payload has `role` but no new `roles` key, this reads an undefined index and passes `null` to `array_map()`. Older stored webhook payloads or API responses can now fail deserialization instead of returning an `OrganizationMembership`.

### Issue 2 of 4
lib/Resource/UserOrganizationMembership.php:61
**Missing Roles Crashes Parsing**

When a user organization membership payload still contains only the existing `role` field, this reads the new `roles` key unconditionally and sends `null` into `array_map()`. That makes older list/get responses or stored webhook data throw during SDK parsing.

### Issue 3 of 4
lib/Resource/OrganizationMembership.php:36
**Constructor Arguments Rebind**

This inserts a new required `array $roles` parameter before the existing `$user` parameter. A consumer that directly constructs this public resource with the old positional argument order now binds the `User` object to `roles` and gets a runtime `TypeError`; named-argument callers that omit `roles` also get an argument error.

### Issue 4 of 4
lib/Resource/UserOrganizationMembership.php:36
**Constructor Arguments Rebind**

This new required `roles` parameter is inserted in the middle of the public constructor, before `$user`. Existing callers that pass the previous positional argument list now send a `User` object into `array $roles`, causing a runtime `TypeError` instead of constructing the resource.

Reviews (1): Last reviewed commit: "chore(generated): add release notes frag..." | Re-trigger Greptile

createdAt: new \DateTimeImmutable($data['created_at']),
updatedAt: new \DateTimeImmutable($data['updated_at']),
role: SlimRole::fromArray($data['role']),
roles: array_map(fn ($item) => SlimRole::fromArray($item), $data['roles']),

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 Roles Crashes Parsing

When an existing membership payload has role but no new roles key, this reads an undefined index and passes null to array_map(). Older stored webhook payloads or API responses can now fail deserialization instead of returning an OrganizationMembership.

Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/Resource/OrganizationMembership.php
Line: 61

Comment:
**Missing Roles Crashes Parsing**

When an existing membership payload has `role` but no new `roles` key, this reads an undefined index and passes `null` to `array_map()`. Older stored webhook payloads or API responses can now fail deserialization instead of returning an `OrganizationMembership`.

How can I resolve this? If you propose a fix, please make it concise.

createdAt: new \DateTimeImmutable($data['created_at']),
updatedAt: new \DateTimeImmutable($data['updated_at']),
role: SlimRole::fromArray($data['role']),
roles: array_map(fn ($item) => SlimRole::fromArray($item), $data['roles']),

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 Roles Crashes Parsing

When a user organization membership payload still contains only the existing role field, this reads the new roles key unconditionally and sends null into array_map(). That makes older list/get responses or stored webhook data throw during SDK parsing.

Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/Resource/UserOrganizationMembership.php
Line: 61

Comment:
**Missing Roles Crashes Parsing**

When a user organization membership payload still contains only the existing `role` field, this reads the new `roles` key unconditionally and sends `null` into `array_map()`. That makes older list/get responses or stored webhook data throw during SDK parsing.

How can I resolve this? If you propose a fix, please make it concise.

* The list of roles assigned to the user within the organization.
* @var array<\WorkOS\Resource\SlimRole>
*/
public array $roles,

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 Constructor Arguments Rebind

This inserts a new required array $roles parameter before the existing $user parameter. A consumer that directly constructs this public resource with the old positional argument order now binds the User object to roles and gets a runtime TypeError; named-argument callers that omit roles also get an argument error.

Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/Resource/OrganizationMembership.php
Line: 36

Comment:
**Constructor Arguments Rebind**

This inserts a new required `array $roles` parameter before the existing `$user` parameter. A consumer that directly constructs this public resource with the old positional argument order now binds the `User` object to `roles` and gets a runtime `TypeError`; named-argument callers that omit `roles` also get an argument error.

How can I resolve this? If you propose a fix, please make it concise.

* The list of roles assigned to the user within the organization.
* @var array<\WorkOS\Resource\SlimRole>
*/
public array $roles,

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 Constructor Arguments Rebind

This new required roles parameter is inserted in the middle of the public constructor, before $user. Existing callers that pass the previous positional argument list now send a User object into array $roles, causing a runtime TypeError instead of constructing the resource.

Prompt To Fix With AI
This is a comment left during a code review.
Path: lib/Resource/UserOrganizationMembership.php
Line: 36

Comment:
**Constructor Arguments Rebind**

This new required `roles` parameter is inserted in the middle of the public constructor, before `$user`. Existing callers that pass the previous positional argument list now send a `User` object into `array $roles`, causing a runtime `TypeError` instead of constructing the resource.

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