fix(ruby): alias @client to @raw_client for root service endpoints#15466
fix(ruby): alias @client to @raw_client for root service endpoints#15466Swimburger wants to merge 1 commit intomainfrom
Conversation
Root service endpoint methods reference @client (from HttpEndpointGenerator) but the root client stores its raw client as @raw_client. Without this alias, any root service endpoint call would fail with NoMethodError at runtime. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| if (this.context.ir.rootPackage.service != null) { | ||
| writer.writeLine(`@client = @raw_client`); | ||
| } |
There was a problem hiding this comment.
🟡 Missing versions.yml entry for Ruby generator bug fix
Per the mandatory REVIEW.md rule under "Version Management": "Generator changes (bug fixes or features) should include a versions.yml entry in the appropriate generator directory." This PR is a bug fix to the Ruby SDK generator (generators/ruby-v2/sdk/) but does not include a corresponding entry in generators/ruby-v2/sdk/versions.yml. Without this entry, the fix won't be picked up by the automated release pipeline.
Prompt for agents
Add a new entry at the top of generators/ruby-v2/sdk/versions.yml with the next patch version (e.g. 1.8.1), a changelogEntry with type: fix summarizing that @client is now aliased to @raw_client in the root client when the root package has service endpoints, and the current irVersion (66). This ensures the fix is included in the next automated release.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
This fix is covered by the changelog entry added in the parent PR #15445 (generators/ruby-v2/sdk/changes/unreleased/add-client-default-support.yml). Per repo conventions, versions.yml is not hand-edited — versioning is handled by automation based on the unreleased changelog files.
SDK Generation Benchmark ResultsComparing PR branch against median of 5 nightly run(s) on Full benchmark table (click to expand)
main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via |
Description
Follow-up fix from #15445 — root service endpoint methods generated by
HttpEndpointGeneratorreference@clientto send HTTP requests, but the root client (RootClientGenerator) stores the raw HTTP client as@raw_client. Without this alias, any call to a root service endpoint method would fail at runtime with a RubyNoMethodErrorbecause@clientisnil.This was flagged by Devin Review on the original PR.
Changes Made
@client = @raw_clientalias inRootClientGenerator.getInitializeMethod(), gated onrootPackage.service != nullso it only appears when there are root service endpointsTesting
pnpm compile --filter @fern-api/ruby-sdk...)pnpm seed test --generator ruby-sdk-v2 --fixture x-fern-default --skip-scriptsclient.rbincludes@client = @raw_clientafter@raw_clientinitializationLink to Devin session: https://app.devin.ai/sessions/91f742878e6249fab63239e8f46b4fb7
Requested by: @Swimburger