feat(ci): Add Claude Code workflow - #1185
AkhileshNegi wants to merge 1 commit into
Conversation
Two jobs in one workflow: - `claude` — responds to @claude mentions in issues, PR comments and reviews. - `review` — auto-reviews a PR when the `ready-for-review` label is added, reusing the repo's own checklist in .claude/commands/pr-review.md so the bot review and the local /pr-review pass apply the same conventions. Requires an ANTHROPIC_API_KEY repository secret and the Claude GitHub App installed on the org. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
OpenAPI changes ⚪ No API surface changesNote This PR does not modify the API contract.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
can we implement an agent bot for this so that whenever it needs to comment on a PR or an issue, it does so through the respective PR/issue itself?
| PR NUMBER: ${{ github.event.pull_request.number }} | ||
|
|
||
| Review this PR against the repository's own review checklist. | ||
|
|
||
| 1. Read `.claude/commands/pr-review.md` and follow it from the "What to check" | ||
| section onward, together with "How to write the comments" and "Output format". | ||
| 2. Skip its "Gather the diff" section — that one assumes a local clone. Use | ||
| `gh pr diff` for the diff and `gh pr view` for the description and commits. | ||
| 3. Read the full files at non-trivial change sites before judging them, and | ||
| check `docs/wiki/INDEX.md` for the touched module before claiming that a | ||
| helper, service, or entity does not already exist. | ||
|
|
||
| Post specific findings as inline comments citing path:line, and the summary as | ||
| a single top-level comment. Review only — do not modify files. |
There was a problem hiding this comment.
a few points:
- we should also add type-safety rules so the agent checks for them as well. or maybe in the code-review command as well. otherwise, over time, any tends to start getting used everywhere.
- we should add some rules around code quality as well, such as keeping functions below a certain number of lines, following the DRY principle, and checking for unnecessary code duplication.
Issue
Closes #PLEASE_TYPE_ISSUE_NUMBER
Summary
Checklist
Before submitting a pull request, please ensure that you mark these task.
fastapi run --reload app/main.pyordocker compose upin the repository root and test.Notes
ready-for-reviewis the same label CodeRabbit uses (.coderabbit.yaml), so labelling a PR now fires both reviewers. If that turns out to be noise, drop one — changing the label here is a one-line edit.concurrencywithcancel-in-progresson the review job keeps a remove/re-add of the label from stacking runs.pull_requesttrigger doesn't expose secrets to forks, so the review job silently no-ops there. Deliberate —pull_request_targetwould expose the key to untrusted code.actions/checkout@v7matchescontinuous-integration.yml(upstream's example is on v6).Stophook (wiki-update.sh) also applies to these runs. On the read-only review job it exits 0; on theclaudejob it will nudge for adocs/wiki/update when the change is structural, which is the intended behaviour.Original PR description
Issue
N/A — infra setup.
Summary
Adds
.github/workflows/claude.ymlwith two jobs:claude@claudein an issue body/title, a PR comment, or a reviewreviewready-for-reviewlabel added to a PRThe
reviewjob doesn't carry its own review criteria. It reads.claude/commands/pr-review.mdfrom the checkout and follows it from "What to check" onward, so the bot review and a locally-run/pr-reviewapply the same conventions and output format. Updating the checklist updates both.It skips that file's "Gather the diff" section (which assumes a local clone with full history) and uses
gh pr diff/gh pr viewinstead — the checkout isfetch-depth: 1.Before this can run
ProjectTech4DevAIorg — needs an org owner, not just repo admin.ANTHROPIC_API_KEYas a repository (or org) Actions secret.Until both are done, the jobs are inert — nothing else in CI is affected.
Notes
ready-for-reviewis the same label CodeRabbit uses (.coderabbit.yaml), so labelling a PR now fires both reviewers. If that turns out to be noise, drop one — changing the label here is a one-line edit.concurrencywithcancel-in-progresson the review job keeps a remove/re-add of the label from stacking runs.pull_requesttrigger doesn't expose secrets to forks, so the review job silently no-ops there. Deliberate —pull_request_targetwould expose the key to untrusted code.actions/checkout@v7matchescontinuous-integration.yml(upstream's example is on v6).Stophook (wiki-update.sh) also applies to these runs. On the read-only review job it exits 0; on theclaudejob it will nudge for adocs/wiki/update when the change is structural, which is the intended behaviour.Checklist
fastapi run --reload app/main.py— N/A, CI-only change