Skip to content

ci: auto-heal spec-sync PRs by regenerating the models#15

Open
wei-hai wants to merge 1 commit into
mainfrom
ci/spec-sync-autoheal
Open

ci: auto-heal spec-sync PRs by regenerating the models#15
wei-hai wants to merge 1 commit into
mainfrom
ci/spec-sync-autoheal

Conversation

@wei-hai

@wei-hai wei-hai commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a Sync spec auto-heal workflow that eliminates the manual generate step on the automated spec-sync PRs.

Why

The spec-sync automation opens a PR that updates only the vendored spec/openapi.yaml, not the generated client. The drift check then fails on every sync PR until a maintainer checks out the branch, regenerates, and commits. This makes that automatic.

How

  • Triggers only on chore/sync-v2-spec-* branches (ordinary PRs untouched).
  • Regenerates the low layer and, if it changed, commits and pushes back onto the PR branch — so CI re-runs and the drift check goes green.
  • No drift ⇒ nothing pushed ⇒ cannot loop.
  • Push uses a SPEC_SYNC_TOKEN secret (contents:write) instead of the default GITHUB_TOKEN, because a GITHUB_TOKEN push does not re-trigger required checks (GitHub's recursive-run guard). Workflow-level permissions stay contents: read.

Setup required

Add a SPEC_SYNC_TOKEN repo secret — a fine-grained PAT (or app token) with contents:write on this repo. Until it exists, the job fails fast with an actionable message and nothing else changes.

Verified

Hygiene scanner + YAML parse pass. The regen command mirrors the drift check exactly (byte-for-byte), so it produces precisely what the check expects.

🤖 Generated with Claude Code

Spec-sync PRs update the vendored spec but not the generated client, so the
drift check fails on every one until someone regenerates by hand. This adds a
workflow that regenerates on chore/sync-v2-spec-* branches and pushes the result
back onto the PR, turning it green automatically.

Requires a SPEC_SYNC_TOKEN secret (contents:write) so the push re-triggers CI;
without it the job fails with a clear message and behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@wei-hai
wei-hai requested review from a team as code owners July 23, 2026 16:01
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@wei-hai, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 27 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0b062aba-133c-4876-9f35-01b5aed1b7d4

📥 Commits

Reviewing files that changed from the base of the PR and between 1d8d09b and 1a656ed.

📒 Files selected for processing (1)
  • .github/workflows/sync-autoheal.yml

Warning

.coderabbit.yaml has a parsing error

The CodeRabbit configuration file in this repository has a parsing error and default settings were used instead. Please fix the error(s) in the configuration file. You can initialize chat with CodeRabbit to get help with the configuration file.

💥 Parsing errors (1)
Validation error: Too big: expected string to have <=250 characters at "tone_instructions"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/spec-sync-autoheal
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch ci/spec-sync-autoheal

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.

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.

1 participant