fix(ci): ignore OpenAPI version comment in generated TS file diff#438
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughCI workflow step updated to ignore diffs that only change the "OpenAPI spec version" comment when verifying generated TypeScript API client and model files. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Release PreviewNo version bumps detected. All changes are in unversioned paths or use exempt commit types. |
There was a problem hiding this comment.
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.jsoncomparison that already excludesinfo.version.
There was a problem hiding this comment.
🧹 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
📒 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
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Summary
Verify API Spec & ClientCI 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 fileopenapi.jsoncheck already excludesinfo.version— this applies the same treatment to generated TS files usinggit diff -I 'OpenAPI spec version'Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit