Skip to content

feat(generated): OrganizationMembership (batch 4a353f07)#405

Open
workos-sdk-automation[bot] wants to merge 2 commits into
mainfrom
oagen/batch-4a353f07
Open

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

Conversation

@workos-sdk-automation

Copy link
Copy Markdown
Contributor

Summary

Regenerated SDK from spec changes.

Triggered by workos/openapi-spec@053f61e

@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 20:31
@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 a review from nicknisi June 25, 2026 20:31

@devin-ai-integration devin-ai-integration Bot left a comment

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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@greptile-apps

greptile-apps Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR regenerates PHP SDK resources and fixtures for organization membership updates. The main changes are:

  • Added roles arrays to organization membership resources.
  • Updated membership fixtures to include the new role list.
  • Added generated fixtures for new error and event payloads.
  • Updated generator sync metadata.

Confidence Score: 2/5

The generated organization membership deserializers can reject existing role-only payloads, and the public constructor signatures changed in a way that can break positional callers.

  • OrganizationMembership::fromArray and UserOrganizationMembership::fromArray now read roles directly, so older API, webhook, fixture, or stored payloads that still contain only role can fail during deserialization.
  • The new $roles constructor parameter was inserted before $user in both public resource constructors, which can break existing positional construction during upgrade.
  • The environment lacked a PHP runtime for contract execution, so runtime validation of the generated fixture path could not provide additional merge-safety assurance.

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

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex ran the Before-state code-execution test, capturing the command, working directory, base revision, and the caption 'Before:' with exit code 127 due to a missing PHP runtime.
  • T-Rex ran the After-state code-execution test on the head revision, capturing the same command and scope with the caption 'After:', and confirmed it is blocked by the missing PHP runtime before code execution.

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 Break Deserialization**

When a membership payload still has the existing singular `role` field but no additive `roles` array, this line reads a missing key and passes `null` into `array_map`. Existing API, webhook, or stored fixture payloads with the old shape can now fail during SDK deserialization instead of producing an `OrganizationMembership`.

### Issue 2 of 4
lib/Resource/UserOrganizationMembership.php:61
**Missing Roles Break List Items**

When a user organization membership item still contains only `role`, this direct `roles` lookup turns a previously valid list response into a deserialization failure. SDK callers listing memberships can receive a runtime error before they can read the membership data.

### Issue 3 of 4
lib/Resource/OrganizationMembership.php:36
**Constructor Argument Order Breaks**

This adds a required `$roles` parameter before the existing required `$user` parameter on a public resource constructor. Code that constructs `OrganizationMembership` positionally with the old argument order will now pass a `User` where an array is required, or omit the new argument, and fail during upgrade.

### Issue 4 of 4
lib/Resource/UserOrganizationMembership.php:36
**Constructor Argument Order Breaks**

This public constructor now requires `$roles` before `$user`, so existing positional construction with the previous signature no longer lines up. Consumers can hit an argument count or type error even when they do not use the new multi-role field.

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 Break Deserialization

When a membership payload still has the existing singular role field but no additive roles array, this line reads a missing key and passes null into array_map. Existing API, webhook, or stored fixture payloads with the old shape can now fail during SDK deserialization instead of producing 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 Break Deserialization**

When a membership payload still has the existing singular `role` field but no additive `roles` array, this line reads a missing key and passes `null` into `array_map`. Existing API, webhook, or stored fixture payloads with the old shape can now fail during SDK deserialization instead of producing 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 Break List Items

When a user organization membership item still contains only role, this direct roles lookup turns a previously valid list response into a deserialization failure. SDK callers listing memberships can receive a runtime error before they can read the membership data.

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

Comment:
**Missing Roles Break List Items**

When a user organization membership item still contains only `role`, this direct `roles` lookup turns a previously valid list response into a deserialization failure. SDK callers listing memberships can receive a runtime error before they can read the membership data.

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.

P2 Constructor Argument Order Breaks

This adds a required $roles parameter before the existing required $user parameter on a public resource constructor. Code that constructs OrganizationMembership positionally with the old argument order will now pass a User where an array is required, or omit the new argument, and fail during upgrade.

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

Comment:
**Constructor Argument Order Breaks**

This adds a required `$roles` parameter before the existing required `$user` parameter on a public resource constructor. Code that constructs `OrganizationMembership` positionally with the old argument order will now pass a `User` where an array is required, or omit the new argument, and fail during upgrade.

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.

P2 Constructor Argument Order Breaks

This public constructor now requires $roles before $user, so existing positional construction with the previous signature no longer lines up. Consumers can hit an argument count or type error even when they do not use the new multi-role field.

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

Comment:
**Constructor Argument Order Breaks**

This public constructor now requires `$roles` before `$user`, so existing positional construction with the previous signature no longer lines up. Consumers can hit an argument count or type error even when they do not use the new multi-role field.

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