Repository navigation
feat(generated): Changes to pipes - #568
workos-sdk-automation[bot] wants to merge 5 commits into
Conversation
…iKeys, AuditLogs, Authorization, ClientApi, Connect, DirectorySync, Events, FeatureFlags, Groups, MultiFactorAuth, OrganizationDomains, OrganizationMembership, Organizations, Pipes, PipesProvider, PlatformTeams, Radar, SSO, UserManagement, Vault, Webhooks, Widgets
[Medium impact] The PR changes several SDK workflows, with most new behavior centered on Pipes connections. The PR appears safe to merge, with non-blocking gaps in tests for connection completion and role edits. FindingsFix with agent prompt### Issue 1
test/workos/test_pipes.rb:28-32
The new `create_finish` test accepts any request body and returns an empty response. It would still pass if `connect_code` or `code_verifier` were missing or swapped.
Add body assertions for both values and optional `state`, return a populated `connected_account`, and check its ID. Also test `authorize_data_integration` with `code_challenge` and `code_challenge_method`. Model round trips alone do not check what these methods send.
### Issue 2
test/workos/test_authorization.rb:35-39
The new `patch_group_role_assignments` test sends neither `add` nor `remove` and never checks the body. Its model test also uses empty arrays. Dropping or swapping the two fields would leave every new test passing.
Add a request test with different, non-empty entries in both arrays and assert the exact body.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryAdds a two-step Pipes connection flow and updates the generated SDK surface.
Acknowledged intentional changes:
|
| def test_create_finish_returns_expected_result | ||
| stub_request(:post, %r{\Ahttps://api\.workos\.com/data-integrations/finish(\?|\z)}) | ||
| .to_return(body: "{}", status: 200) | ||
| result = @client.pipes.create_finish(connect_code: "stub", code_verifier: "stub") | ||
| refute_nil result |
There was a problem hiding this comment.
Broken requests still pass tests
The new create_finish test accepts any request body and returns {}, so it passes even if the method drops connect_code or code_verifier, or fails to read the returned account. Add body assertions and a populated response, then check result.connected_account.id. Also cover code_challenge and code_challenge_method on authorize_data_integration; the model tests do not check what either method sends. This is non-blocking, but would help catch changes that break connection setup.
Prompt To Fix With AI
This is a comment left during a code review.
Path: test/workos/test_pipes.rb
Line: 28-32
Comment:
**Broken requests still pass tests**
The new `create_finish` test accepts any request body and returns `{}`, so it passes even if the method drops `connect_code` or `code_verifier`, or fails to read the returned account. Add body assertions and a populated response, then check `result.connected_account.id`. Also cover `code_challenge` and `code_challenge_method` on `authorize_data_integration`; the model tests do not check what either method sends. This is non-blocking, but would help catch changes that break connection setup.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| def test_create_finish_returns_expected_result | ||
| stub_request(:post, %r{\Ahttps://api\.workos\.com/data-integrations/finish(\?|\z)}) | ||
| .to_return(body: "{}", status: 200) | ||
| result = @client.pipes.create_finish(connect_code: "stub", code_verifier: "stub") | ||
| refute_nil result |
There was a problem hiding this comment.
Connection tests miss wrong requests
The new create_finish test accepts any request body and returns an empty response. It would still pass if connect_code or code_verifier were missing or swapped.
Add body assertions for both values and optional state, return a populated connected_account, and check its ID. Also test authorize_data_integration with code_challenge and code_challenge_method. Model round trips alone do not check what these methods send.
Prompt To Fix With AI
This is a comment left during a code review.
Path: test/workos/test_pipes.rb
Line: 28-32
Comment:
**Connection tests miss wrong requests**
The new `create_finish` test accepts any request body and returns an empty response. It would still pass if `connect_code` or `code_verifier` were missing or swapped.
Add body assertions for both values and optional `state`, return a populated `connected_account`, and check its ID. Also test `authorize_data_integration` with `code_challenge` and `code_challenge_method`. Model round trips alone do not check what these methods send.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| def test_patch_group_role_assignments_returns_expected_result | ||
| stub_request(:patch, %r{\Ahttps://api\.workos\.com/authorization/groups/stub/role_assignments(\?|\z)}) | ||
| .to_return(body: "{}", status: 200) | ||
| result = @client.authorization.patch_group_role_assignments(group_id: "stub") | ||
| assert_nil result |
There was a problem hiding this comment.
The new patch_group_role_assignments test sends neither add nor remove and never checks the body. Its model test also uses empty arrays. Dropping or swapping the two fields would leave every new test passing.
Add a request test with different, non-empty entries in both arrays and assert the exact body.
Prompt To Fix With AI
This is a comment left during a code review.
Path: test/workos/test_authorization.rb
Line: 35-39
Comment:
**Role tests miss wrong changes**
The new `patch_group_role_assignments` test sends neither `add` nor `remove` and never checks the body. Its model test also uses empty arrays. Dropping or swapping the two fields would leave every new test passing.
Add a request test with different, non-empty entries in both arrays and assert the exact body.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
feat(pipes)!: Change Pipes API surface
feat(pipes): Add Pipes operations and models
DataIntegrationFinishConnectionResponse.DataIntegrationsFinishConnectionRequest.DataIntegrationsFinishConnectionError400.DataIntegrationsFinishConnectionError4002.DataIntegrationsFinishConnectionError403.DataIntegrationsGetDataIntegrationAuthorizeUrlError4002.completiontoDataIntegrationAuthorizeUrlResponse.code_challengetoDataIntegrationsGetDataIntegrationAuthorizeUrlRequest.code_challenge_methodtoDataIntegrationsGetDataIntegrationAuthorizeUrlRequest.codetoDataIntegrationsGetDataIntegrationAuthorizeUrlError400.DataIntegrationsFinishConnectionError400Code.DataIntegrationsGetDataIntegrationAuthorizeUrlError400Code.POST /data-integrations/finish.fix(pipes): Update Pipes API surface
DataIntegrationsGetDataIntegrationAuthorizeUrlError400.message.POST /data-integrations/{slug}/authorize.Triggered by workos/openapi-spec@7121685
BEGIN_COMMIT_OVERRIDE
feat(pipes): Change Pipes API surface (#568)
feat(pipes): Add Pipes operations and models (#568)
fix(pipes): Update Pipes API surface (#568)
END_COMMIT_OVERRIDE