Auto-fix nightly lint failures with Claude Code (PR-only)#1952
Closed
bmander wants to merge 1 commit into
Closed
Conversation
When the nightly Android Lint leg fails, reproduce the findings and have Claude Code fix them at their source per CLAUDE.md, verify lint is green, and open a PR for human review. It never merges. Decoupled from android-nightly.yml via workflow_run so a slow fix+verify cycle can't tangle with the nightly's concurrency group. A cheap `detect` job confirms it was specifically the `lint` job that failed (not all-brands/smoke-api23) before spending runner time or API tokens. Requires an ANTHROPIC_API_KEY repo secret (not yet configured), so the workflow is inert until a maintainer adds it. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
Contributor
Author
|
Will not implement until such time as we have an org Anthropic account (or similar). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
.github/workflows/claude-fix-nightly-lint.yml. When the nightly Android Lint leg fails, this workflow reproduces the findings and has Claude Code fix them at their source perCLAUDE.md, verify lint is green, and open a PR for human review. It never merges.How it's wired
workflow_runon completion of "Android Nightly" (+ manualworkflow_dispatch). Decoupled fromandroid-nightly.ymlso a slow fix+verify cycle can't tangle with that workflow'sconcurrency: nightly, cancel-in-progress.detectjob (cheap gate):workflow_runfires on the whole nightly's conclusion, so this job inspects the run's jobs and proceeds only if thelintjob specifically failed — notall-brandsorsmoke-api23. It also captures the failinghead_sha.fixjob: checks out the failing commit, reproduceslintObaGoogleDebug(capturing console + HTML/XML reports), then hands them toanthropics/claude-code-action@v1. Prompt is scoped toCLAUDE.md: fix at source, no baseline, opt-outs only with rationale + issue link and flagged NEEDS HUMAN SIGN-OFF, verify green before claiming success (draft PR otherwise), never merge. Capped at--max-turns 40andtimeout-minutes: 60.Before this can run
ANTHROPIC_API_KEYrepo secret — not currently configured; the workflow is inert until a maintainer adds it. Adding it lets workflow runs spend against the org's Anthropic account.GITHUB_TOKEN, so CI (android.yml) will not auto-run on the bot's fix PR (GitHub limitation: token-created PRs don't trigger downstream workflows). To get CI on the fix PR, install the Claude GitHub App or pass a PAT/App token via the action'sgithub_token.Notes
CLAUDE.md's human-sign-off gate on lint opt-outs/heuristics.🤖 Generated with Claude Code