Skip to content

fix(ruby): alias @client to @raw_client for root service endpoints#15466

Open
Swimburger wants to merge 1 commit intomainfrom
devin/1777327874-ruby-root-client-fix
Open

fix(ruby): alias @client to @raw_client for root service endpoints#15466
Swimburger wants to merge 1 commit intomainfrom
devin/1777327874-ruby-root-client-fix

Conversation

@Swimburger
Copy link
Copy Markdown
Member

@Swimburger Swimburger commented Apr 27, 2026

Description

Follow-up fix from #15445 — root service endpoint methods generated by HttpEndpointGenerator reference @client to 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 Ruby NoMethodError because @client is nil.

This was flagged by Devin Review on the original PR.

Changes Made

  • Added @client = @raw_client alias in RootClientGenerator.getInitializeMethod(), gated on rootPackage.service != null so it only appears when there are root service endpoints
  • Updated x-fern-default seed snapshot to include the alias

Testing

  • Compilation passes (pnpm compile --filter @fern-api/ruby-sdk...)
  • Seed test passes: pnpm seed test --generator ruby-sdk-v2 --fixture x-fern-default --skip-scripts
  • Generated client.rb includes @client = @raw_client after @raw_client initialization

Link to Devin session: https://app.devin.ai/sessions/91f742878e6249fab63239e8f46b4fb7
Requested by: @Swimburger


Open in Devin Review

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>
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 2 additional findings in Devin Review.

Open in Devin Review

Comment on lines +229 to +231
if (this.context.ir.rootPackage.service != null) {
writer.writeLine(`@client = @raw_client`);
}
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.

🟡 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

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.

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.

@github-actions
Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-04-23T04:59:11Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
ruby-sdk-v2 square 130s (n=5) 159s (n=5) 132s +2s (+1.5%)

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 fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Baseline from nightly runs on main (latest: 2026-04-23T04:59:11Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-04-27 22:21 UTC

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.

2 participants