Skip to content

fix(ci): ignore OpenAPI version comment in generated TS file diff#438

Merged
FSM1 merged 2 commits into
mainfrom
fix/ci-api-spec-version-diff
Apr 1, 2026
Merged

fix(ci): ignore OpenAPI version comment in generated TS file diff#438
FSM1 merged 2 commits into
mainfrom
fix/ci-api-spec-version-diff

Conversation

@FSM1

@FSM1 FSM1 commented Apr 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • The Verify API Spec & Client CI step fails on the release-please branch because version bumps (e.g. 0.35.0 → 0.36.0) change the * OpenAPI spec version: comment in every generated TS file
  • The openapi.json check already excludes info.version — this applies the same treatment to generated TS files using git diff -I 'OpenAPI spec version'

Test plan

  • Verify the release-please branch CI passes after merge
  • Verify that actual schema changes (not just version comments) are still caught

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • CI validation updated to ignore version-only differences in generated API client files.
    • Prevents pipeline failures caused solely by changes to version metadata in generated outputs, allowing builds to proceed when no functional code changes are present.

Release-please bumps the version in package.json, which propagates to
the OpenAPI spec version embedded in every generated TS file's header
comment. The openapi.json check already excludes info.version; this
applies the same treatment to the generated TS files using git diff -I.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 72aaf9c41c17
Copilot AI review requested due to automatic review settings April 1, 2026 13:56
@coderabbitai

coderabbitai Bot commented Apr 1, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ede21766-0bb8-4128-be76-a8691893c9f9

📥 Commits

Reviewing files that changed from the base of the PR and between 1cdd50e and 34a4311.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Walkthrough

CI workflow step updated to ignore diffs that only change the "OpenAPI spec version" comment when verifying generated TypeScript API client and model files.

Changes

Cohort / File(s) Summary
CI Workflow
.github/workflows/ci.yml
Adjusted the git-diff check for generated client/model paths to ignore hunks matching the regex ^ \* OpenAPI spec version: [0-9], so version-only changes no longer fail the "Generated API client is out of date" check.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: ignoring OpenAPI version comments in generated TypeScript file diffs during CI verification.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-api-spec-version-diff

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

Release Preview

No version bumps detected. All changes are in unversioned paths or use exempt commit types.

Copilot AI left a comment

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.

Pull request overview

Updates the CI “Verify API Spec & Client” step to avoid failing release-please PRs when only the generated client header comment changes due to OpenAPI spec version bumps.

Changes:

  • Adjusts the generated TypeScript diff check to ignore lines matching OpenAPI spec version.
  • Keeps the existing semantic openapi.json comparison that already excludes info.version.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
.github/workflows/ci.yml (1)

168-168: Tighten the ignore regex to match only the generated header line.

Current pattern works, but it’s broader than needed. Anchoring to the exact comment format reduces accidental ignores.

Proposed tweak
-          git diff --exit-code -I 'OpenAPI spec version' packages/api-client/src/generated/ packages/api-client/src/models/ \
+          git diff --exit-code -I '^[[:space:]]*\* OpenAPI spec version: ' packages/api-client/src/generated/ packages/api-client/src/models/ \
             || (echo "Generated API client is out of date. Run 'pnpm api:generate' and commit changes." && exit 1)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/ci.yml at line 168, The git diff invocation currently uses
a broad ignore pattern (-I 'OpenAPI spec version') which can accidentally skip
unrelated changes; update the ignore regex used in the git diff --exit-code
command (the -I 'OpenAPI spec version' argument) to anchor to the exact
generated header line and comment format (use start/end anchors and the exact
prefix used in generated files) so only the intended OpenAPI header is ignored.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In @.github/workflows/ci.yml:
- Line 168: The git diff invocation currently uses a broad ignore pattern (-I
'OpenAPI spec version') which can accidentally skip unrelated changes; update
the ignore regex used in the git diff --exit-code command (the -I 'OpenAPI spec
version' argument) to anchor to the exact generated header line and comment
format (use start/end anchors and the exact prefix used in generated files) so
only the intended OpenAPI header is ignored.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e73528a9-d37e-4fb1-b4cd-7c140a8176f7

📥 Commits

Reviewing files that changed from the base of the PR and between c7f72b6 and 1cdd50e.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Tighten the -I regex from broad substring match to the exact generated
comment format (^ \* OpenAPI spec version: [0-9]) so unrelated changes
containing "OpenAPI spec version" are not accidentally suppressed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 26107ce29db7
@FSM1 FSM1 enabled auto-merge (squash) April 1, 2026 14:03
@codecov

codecov Bot commented Apr 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.80%. Comparing base (c7f72b6) to head (34a4311).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #438      +/-   ##
==========================================
+ Coverage   62.29%   71.80%   +9.51%     
==========================================
  Files         135      114      -21     
  Lines       10085     7168    -2917     
  Branches     1051     1051              
==========================================
- Hits         6282     5147    -1135     
+ Misses       3586     1804    -1782     
  Partials      217      217              
Flag Coverage Δ
api 84.91% <ø> (ø)
api-client 84.91% <ø> (ø)
core 84.91% <ø> (ø)
crypto 84.91% <ø> (ø)
desktop 14.40% <ø> (-16.82%) ⬇️
sdk 84.91% <ø> (ø)
sdk-core 84.91% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 34 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@FSM1 FSM1 merged commit c19c501 into main Apr 1, 2026
27 checks passed
@FSM1 FSM1 deleted the fix/ci-api-spec-version-diff branch April 14, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants