Skip to content

feat: replace hand-written URL builders with generated ones - #529

Merged
gjtorikian merged 2 commits into
mainfrom
generated-url-builders
Jul 27, 2026
Merged

feat: replace hand-written URL builders with generated ones#529
gjtorikian merged 2 commits into
mainfrom
generated-url-builders

Conversation

@gjtorikian

Copy link
Copy Markdown
Contributor

Summary

  • Replaces the hand-maintained authorization URL builders with methods generated by the Ruby emitter (regenerated from oagen-emitters), deleting the fence copies they replace: UserManagement#get_authorization_url (H09), UserManagement#get_logout_url, and SSO#get_authorization_url (H14).
  • The generated builders accept an optional per-call client_id override that falls back to the client's configured value.
  • Serialization is unchanged: provider_scopes is joined as CSV and provider_query_params is encoded as JSON, matching the deleted hand-written code.
  • Behavior change: a missing client_id / provider is no longer validated client-side — the URL simply omits client_id, matching the Python SDK.
  • Adds a WorkOS::OMIT sentinel for nullable optional parameters (distinguishes an omitted argument from an explicit nil) and updates the Sorbet RBIs and AuthKit helper tests accordingly.

🤖 Generated with Claude Code

…ones

The Ruby emitter now generates url-builder methods (regenerated from
oagen-emitters) with an optional per-call client_id override that falls
back to the client's configured value. Delete the hand-maintained fence
copies they replace:

- UserManagement#get_authorization_url (H09) and #get_logout_url
- SSO#get_authorization_url (H14)

The generated builders serialize provider_scopes (CSV) and
provider_query_params (JSON) like the deleted hand-written code.
Behavior change: a missing client_id / provider is no longer validated
client-side — the URL simply omits client_id, matching the Python SDK.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gjtorikian
gjtorikian requested review from a team as code owners July 27, 2026 15:03
@gjtorikian
gjtorikian requested a review from nicknisi July 27, 2026 15:03
@workos-sdk-automation

Copy link
Copy Markdown
Contributor

🤖 This pull request was closed automatically

It edits files that are auto-generated by (each file has a header comment identifying it as generated). Hand edits to generated code are overwritten the next time the SDK is regenerated from the OpenAPI spec, so they can't be merged.

Generated files changed outside their hand-maintainable regions:

  • lib/workos.rb
  • lib/workos/sso.rb
  • lib/workos/user_management.rb
  • rbi/workos/sso.rbi
  • rbi/workos/user_management.rbi

What to do instead

  • Generated code (models, resources, client wiring): make the change upstream in the OpenAPI spec so it lands on the next regeneration.
  • Hand-maintained code inside a generated file: only the regions fenced by @oagen-ignore-start@oagen-ignore-end may be edited by hand. Keep your changes within those fences.
  • Adding, moving, or removing a fence (@oagen-ignore-start / @oagen-ignore-end): fence boundaries are owned by the generator, so they can't change in a hand-authored PR. This must come from a regeneration PR (opened by the SDK Automation Bot or carrying the autogenerated label).

If you believe this was closed in error, a maintainer can reopen the PR.

@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Replaces hand-maintained authorization and logout URL builders with generated implementations.

  • Adds generated SSO and User Management URL construction with per-call client ID overrides.
  • Adds matching RBI declarations and updates AuthKit helper coverage for the changed client ID behavior.

Confidence Score: 3/5

The PR is not yet safe to merge because its generated RBI declarations reject valid calls that omit runtime-optional URL-builder keywords, and the previously reported explicit-null serialization issue remains unverified.

The runtime authorization builders accept omitted optional keywords, but their RBI declarations still require them, so Sorbet rejects valid calls; available evidence also does not establish that explicit nil values now survive request serialization.

Files Needing Attention: rbi/workos/user_management.rbi, rbi/workos/sso.rbi, lib/workos/user_management.rb

Important Files Changed

Filename Overview
lib/workos/sso.rb Adds generated local SSO authorization and logout URL builders.
lib/workos/user_management.rb Adds generated AuthKit authorization and logout URL builders while removing their hand-maintained counterparts.
rbi/workos/sso.rbi Adds Sorbet declarations for the generated SSO URL builders.
rbi/workos/user_management.rbi Adds Sorbet declarations for the generated User Management URL builders.
test/workos/test_authkit_helpers.rb Updates authorization URL tests for omitted and overridden client IDs.

Reviews (4): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

Comment thread lib/workos/user_management.rb
Comment thread rbi/workos/user_management.rbi
@gjtorikian gjtorikian reopened this Jul 27, 2026
# Conflicts:
#	lib/workos/user_management.rb
#	rbi/workos/user_management.rbi
@workos-sdk-automation

Copy link
Copy Markdown
Contributor

🤖 This pull request was closed automatically

It edits files that are auto-generated by (each file has a header comment identifying it as generated). Hand edits to generated code are overwritten the next time the SDK is regenerated from the OpenAPI spec, so they can't be merged.

Generated files changed outside their hand-maintainable regions:

  • lib/workos/sso.rb
  • lib/workos/user_management.rb
  • rbi/workos/sso.rbi
  • rbi/workos/user_management.rbi

What to do instead

  • Generated code (models, resources, client wiring): make the change upstream in the OpenAPI spec so it lands on the next regeneration.
  • Hand-maintained code inside a generated file: only the regions fenced by @oagen-ignore-start@oagen-ignore-end may be edited by hand. Keep your changes within those fences.
  • Adding, moving, or removing a fence (@oagen-ignore-start / @oagen-ignore-end): fence boundaries are owned by the generator, so they can't change in a hand-authored PR. This must come from a regeneration PR (opened by the SDK Automation Bot or carrying the autogenerated label).

If you believe this was closed in error, a maintainer can reopen the PR.

@gjtorikian gjtorikian reopened this Jul 27, 2026
@gjtorikian
gjtorikian merged commit b162486 into main Jul 27, 2026
12 checks passed
@gjtorikian
gjtorikian deleted the generated-url-builders branch July 27, 2026 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant