Skip to content

feat(ci): Add Claude Code workflow - #1185

Open
AkhileshNegi wants to merge 1 commit into
mainfrom
ci/claude-code-github-action
Open

AkhileshNegi wants to merge 1 commit into
mainfrom
ci/claude-code-github-action

Conversation

@AkhileshNegi

@AkhileshNegi AkhileshNegi commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes #PLEASE_TYPE_ISSUE_NUMBER

Summary

  • Before: No automated workflow for reviews or interactive assistant.
  • Now: Introduces a workflow with two jobs: one for interactive assistance and one for automated review.
  • Jobs trigger on specific actions and utilize defined criteria for reviews.
  • Supports fetching PR details with a shallow checkout.

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

  • ready-for-review is 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.
  • Cost: every trigger is a full agent run billed to the API key. concurrency with cancel-in-progress on the review job keeps a remove/re-add of the label from stacking runs.
  • Fork PRs: the pull_request trigger doesn't expose secrets to forks, so the review job silently no-ops there. Deliberate — pull_request_target would expose the key to untrusted code.
  • actions/checkout@v7 matches continuous-integration.yml (upstream's example is on v6).
  • The repo's Stop hook (wiki-update.sh) also applies to these runs. On the read-only review job it exits 0; on the claude job it will nudge for a docs/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.yml with two jobs:

Job Trigger What it does
claude @claude in an issue body/title, a PR comment, or a review Interactive assistant — answers, or pushes a fix commit
review ready-for-review label added to a PR Automated review, posted as inline comments + one summary comment

The review job doesn't carry its own review criteria. It reads .claude/commands/pr-review.md from the checkout and follows it from "What to check" onward, so the bot review and a locally-run /pr-review apply 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 view instead — the checkout is fetch-depth: 1.

Before this can run

  • Install the Claude GitHub App on the ProjectTech4DevAI org — needs an org owner, not just repo admin.
  • Add ANTHROPIC_API_KEY as a repository (or org) Actions secret.

Until both are done, the jobs are inert — nothing else in CI is affected.

Notes

  • ready-for-review is 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.
  • Cost: every trigger is a full agent run billed to the API key. concurrency with cancel-in-progress on the review job keeps a remove/re-add of the label from stacking runs.
  • Fork PRs: the pull_request trigger doesn't expose secrets to forks, so the review job silently no-ops there. Deliberate — pull_request_target would expose the key to untrusted code.
  • actions/checkout@v7 matches continuous-integration.yml (upstream's example is on v6).
  • The repo's Stop hook (wiki-update.sh) also applies to these runs. On the read-only review job it exits 0; on the claude job it will nudge for a docs/wiki/ update when the change is structural, which is the intended behaviour.

Checklist

  • YAML validated (parses, both jobs present)
  • Ran fastapi run --reload app/main.py — N/A, CI-only change
  • Tests — N/A, no application code touched

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

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ready-for-review

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 4980f4d5-b173-49d1-9f57-aafe589ddbd2

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

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.

@github-actions github-actions Bot changed the title ci: add Claude Code GitHub Action feat(ci): Add Claude Code workflow Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

OpenAPI changes   ⚪ No API surface changes

Note

This PR does not modify the API contract.

main87cd15b3 · generated by oasdiff

@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@Ayush8923 Ayush8923 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added few comments.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines +59 to +72
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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few points:

  1. 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.
  2. 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.

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.

2 participants