Skip to content

Auto-fix nightly lint failures with Claude Code (PR-only)#1952

Closed
bmander wants to merge 1 commit into
mainfrom
claude-fix-nightly-lint
Closed

Auto-fix nightly lint failures with Claude Code (PR-only)#1952
bmander wants to merge 1 commit into
mainfrom
claude-fix-nightly-lint

Conversation

@bmander

@bmander bmander commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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 per CLAUDE.md, verify lint is green, and open a PR for human review. It never merges.

How it's wired

  • Trigger: workflow_run on completion of "Android Nightly" (+ manual workflow_dispatch). Decoupled from android-nightly.yml so a slow fix+verify cycle can't tangle with that workflow's concurrency: nightly, cancel-in-progress.
  • detect job (cheap gate): workflow_run fires on the whole nightly's conclusion, so this job inspects the run's jobs and proceeds only if the lint job specifically failed — not all-brands or smoke-api23. It also captures the failing head_sha.
  • fix job: checks out the failing commit, reproduces lintObaGoogleDebug (capturing console + HTML/XML reports), then hands them to anthropics/claude-code-action@v1. Prompt is scoped to CLAUDE.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 40 and timeout-minutes: 60.

Before this can run

  • ANTHROPIC_API_KEY repo 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.
  • PR-trigger caveat: as written it uses the default 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's github_token.

Notes

  • Opened as a draft deliberately — this is infrastructure to review before enabling, and the bot itself only ever proposes (never auto-merges), consistent with CLAUDE.md's human-sign-off gate on lint opt-outs/heuristics.

🤖 Generated with Claude Code

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>
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 24f10551-39c8-44ea-aa23-4330fd72f6e3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude-fix-nightly-lint

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.

@bmander

bmander commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

Will not implement until such time as we have an org Anthropic account (or similar).

@bmander bmander closed this Jul 19, 2026
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