fix(ruby): fix duplicate CI actions, Lint/Void warnings, and Naming/VariableNumber cop#14112
fix(ruby): fix duplicate CI actions, Lint/Void warnings, and Naming/VariableNumber cop#14112fern-support wants to merge 5 commits intomainfrom
Conversation
…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 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:
|
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.
Tip: disable this comment in your organization's Code Review settings.
🌱 Seed Test SelectorSelect languages to run seed tests for:
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. |
Co-Authored-By: Chris McDonnell <chris@buildwithfern.com>
Co-Authored-By: Chris McDonnell <chris@buildwithfern.com>
generators/ruby-v2/sdk/versions.yml
Outdated
| @@ -22,7 +45,6 @@ | |||
| type: fix | |||
| createdAt: "2026-03-27" | |||
There was a problem hiding this comment.
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| - 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
Is this helpful? React 👍 or 👎 to let us know.
There was a problem hiding this comment.
Good catch — fixed in cf71dd1. Updated createdAt to "2026-03-27" so version ordering is chronological.
…ering Co-Authored-By: Chris McDonnell <chris@buildwithfern.com>
Co-Authored-By: Chris McDonnell <chris@buildwithfern.com>
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/VoidandNaming/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 becausegithub.refdiffers (refs/heads/...vsrefs/pull/N/merge). Changed toon: [push]to match every other Fern generator (Go, PHP, C#, Rust, Java).2. Fix
Lint/VoidRuboCop warningsIn
boolean.Template.rbandutils.Template.rb, barevalueexpressions insidecase/when/elsebranches were flagged as void context usage. Other branches in the same methods already use explicitreturn. Changed toreturn valuefor consistency and to satisfy the cop.3. Disable
Naming/VariableNumbercopThe previous
normalcaseenforced style flags API-derived field names with underscore-separated digits (e.g.,account_last_4,card_last_4). The alternativesnake_casestyle flags names likesha256andline1. 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.
Updates since last revision
versions.ymlas 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.createdAtdate on changelog entry to2026-03-27to maintain chronological ordering (per Graphite review).Testing
pnpm run check(biome lint passes)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 valuein boolean/utils: Ruby'sreturnexits the enclosing method, not just the case branch. Verify this doesn't change behavior — it shouldn't, sincevaluewas already the last expression beforeend/raise, but worth a quick look at the control flow inboolean.Template.rb:17-25andutils.Template.rb:76-92.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..rubocop.yml,boolean.rb,utils.rbacross ~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