Skip to content

fix(ruby): fix duplicate CI actions, Lint/Void warnings, and Naming/VariableNumber cop#14112

Open
fern-support wants to merge 5 commits intomainfrom
devin/1774534383-fix-ruby-ci-lint
Open

fix(ruby): fix duplicate CI actions, Lint/Void warnings, and Naming/VariableNumber cop#14112
fern-support wants to merge 5 commits intomainfrom
devin/1774534383-fix-ruby-ci-lint

Conversation

@fern-support
Copy link
Copy Markdown
Collaborator

@fern-support fern-support commented Mar 26, 2026

Description

Refs: SchematicHQ/schematic-ruby#3

Fixes three RuboCop / CI issues reported against Fern-generated Ruby SDKs. The generated CI workflow was creating duplicate GitHub Actions runs, and the generated code was failing RuboCop lint checks (Lint/Void and Naming/VariableNumber).

Changes Made

1. Fix duplicate GitHub Actions runs

The Ruby CI template (github-ci.yml) triggered on [push, pull_request]. When a PR is created from a branch within the same repo, GitHub fires both events, producing two workflow runs. The concurrency group doesn't deduplicate them because github.ref differs (refs/heads/... vs refs/pull/N/merge). Changed to on: [push] to match every other Fern generator (Go, PHP, C#, Rust, Java).

2. Fix Lint/Void RuboCop warnings

In boolean.Template.rb and utils.Template.rb, bare value expressions inside case/when/else branches were flagged as void context usage. Other branches in the same methods already use explicit return. Changed to return value for consistency and to satisfy the cop.

3. Disable Naming/VariableNumber cop

The previous normalcase enforced style flags API-derived field names with underscore-separated digits (e.g., account_last_4, card_last_4). The alternative snake_case style flags names like sha256 and line1. Since field names are auto-generated from API specs, neither style works universally — disabled the cop entirely.

4. Seed fixture updates

All ~108 Ruby SDK seed fixtures updated to reflect the new generated output.

  • Updated README.md generator (if applicable) — N/A

Updates since last revision

  • Resolved three merge conflicts in versions.yml as main merged v1.1.4 (Basic Auth), v1.1.5 (security hardening), and v1.1.6 (wiremock pretty-print). This PR's version is now v1.1.7.
  • Fixed createdAt date on changelog entry to 2026-03-27 to maintain chronological ordering (per Graphite review).

Testing

  • Manual testing completed — verified via pnpm run check (biome lint passes)
  • Seed fixtures updated to match new generated output
  • CI green after merge conflict resolutions

Human Review Checklist

  • on: [push] only: Fork PRs won't trigger CI. Acceptable for generated SDK repos where fork contributions are uncommon, and consistent with all other generators.
  • return value in boolean/utils: Ruby's return exits the enclosing method, not just the case branch. Verify this doesn't change behavior — it shouldn't, since value was already the last expression before end/raise, but worth a quick look at the control flow in boolean.Template.rb:17-25 and utils.Template.rb:76-92.
  • Fully disabling Naming/VariableNumber: More aggressive than a targeted exclusion, but since all field names are auto-generated from API specs, any enforced style will eventually break on some API.
  • Seed fixture bulk update: ~324 of 329 changed files are mechanical seed fixture updates (.rubocop.yml, boolean.rb, utils.rb across ~108 fixtures). Spot-check a few to confirm the pattern is applied consistently.

Link to Devin session: https://app.devin.ai/sessions/4e52db29b13a452ab2778a59d9ae0bd9
Requested by: @cdonel707

…ariableNumber cop

- Change CI workflow trigger from [push, pull_request] to [push] to match all other generators
- Add explicit return statements in boolean.rb and utils.rb to fix Lint/Void warnings
- Disable Naming/VariableNumber cop entirely since API-derived field names can't satisfy either normalcase or snake_case style
- Update all seed fixtures

Co-Authored-By: Chris McDonnell <chris@buildwithfern.com>
@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

@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.

Tip: disable this comment in your organization's Code Review settings.

@github-actions
Copy link
Copy Markdown
Contributor

🌱 Seed Test Selector

Select languages to run seed tests for:

  • Python
  • TypeScript
  • Java
  • Go
  • Ruby
  • C#
  • PHP
  • Swift
  • Rust
  • OpenAPI
  • Postman

How to use: Click the ⋯ menu above → "Edit" → check the boxes you want → click "Update comment". Tests will run automatically and snapshots will be committed to this PR.

devin-ai-integration bot and others added 2 commits March 27, 2026 14:36
Co-Authored-By: Chris McDonnell <chris@buildwithfern.com>
Co-Authored-By: Chris McDonnell <chris@buildwithfern.com>
Comment on lines 3 to 46
@@ -22,7 +45,6 @@
type: fix
createdAt: "2026-03-27"
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.

Version chronology error: Version 1.1.6 has createdAt: "2026-03-26" while the older version 1.1.5 has createdAt: "2026-03-27". Newer versions must have later creation dates than older versions. This will break version ordering systems, changelog generation, and any tooling that relies on chronological version history.

Fix: Change version 1.1.6's date to be after version 1.1.5:

- version: 1.1.6
  changelogEntry:
    # ...
  createdAt: "2026-03-27"  # or later
  irVersion: 61
Suggested change
- version: 1.1.6
changelogEntry:
- summary: |
Fix generated CI workflow triggering duplicate GitHub Actions runs. The workflow
previously used `on: [push, pull_request]` which fires both events for PRs from
branches within the same repo. Changed to `on: [push]` to match all other Fern
generators (Go, PHP, C#, Rust, Java).
type: fix
- summary: |
Fix Lint/Void RuboCop warnings in generated core files (boolean.rb, utils.rb).
Bare `value` expressions in case/pattern-matching branches were flagged as void
context usage. Changed to explicit `return value` statements.
type: fix
- summary: |
Disable Naming/VariableNumber RuboCop cop entirely in generated .rubocop.yml.
The previous `normalcase` style flagged API-derived field names containing
underscore-separated digits (e.g., `account_last_4`, `card_last_4`), while the
alternative `snake_case` style flags names like `sha256` and `line1`. Since field
names are auto-generated from API specifications, neither style works universally.
type: fix
createdAt: "2026-03-27"
irVersion: 61
- version: 1.1.5
changelogEntry:
- summary: |
type: fix
createdAt: "2026-03-27"

Spotted by Graphite

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

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.

Good catch — fixed in cf71dd1. Updated createdAt to "2026-03-27" so version ordering is chronological.

devin-ai-integration bot and others added 2 commits March 27, 2026 16:39
…ering

Co-Authored-By: Chris McDonnell <chris@buildwithfern.com>
Co-Authored-By: Chris McDonnell <chris@buildwithfern.com>
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