Repository navigation
ci: skip AI review on draft PRs - #305
Conversation
Gate the ai-review jobs on `draft == false` so Kimi/Codex/Claude only run once a PR is actually open for review. PRs opened directly as non-draft still fire the `opened` event; draft → ready transitions fire `ready_for_review`. Issue-comment triggers (`/kimi`, `/codex`, `/claude`) are unaffected.
🤖 Kimi Code ReviewThis change correctly prevents AI review jobs from running on draft pull requests while preserving the ability to trigger reviews via issue comments. The short-circuit evaluation in the condition ( Verdict: LGTM. The logic is sound and the implementation follows GitHub Actions best practices. Automated review by Kimi (Moonshot AI) · kimi-k2.5 · custom prompt |
🤖 Codex Code ReviewNo findings. The change in ai-review.yml and the equivalent guards at ai-review.yml and ai-review.yml looks correct: automatic review jobs are skipped for draft PRs on Residual risk is minimal and operational rather than code-level: this relies on the reusable review workflows continuing to handle Automated review by OpenAI Codex · gpt-5.4 · custom prompt |
Greptile SummaryAdds Confidence Score: 5/5Safe to merge — the condition logic is correct and handles all documented trigger scenarios. Single-file CI change with no P0/P1 findings. The No files require special attention.
|
| Filename | Overview |
|---|---|
| .github/workflows/ai-review.yml | Adds if guards to all three AI review jobs to skip execution on draft PRs, while preserving issue_comment triggers and ready_for_review behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Workflow triggered] --> B{Event type?}
B -->|issue_comment| C[Run AI review jobs]
B -->|pull_request| D{PR is draft?}
D -->|Yes - opened as draft| E[Skip all AI review jobs]
D -->|No - opened as non-draft| C
B -->|pull_request - ready_for_review| F["draft == false at event time"]
F --> C
C --> G[kimi-review]
C --> H[codex-review]
C --> I[claude-review]
Reviews (1): Last reviewed commit: "ci: skip AI review on draft PRs" | Re-trigger Greptile
…ctions (lambdaclass#763) ## 🗒️ Description / Motivation `lambdaclass/actions` `v1` has moved on since our pin (`2127455`, Sep 1). It now ships three more reviewers (DeepSeek, Gemini, Grok), a `/review` command that triggers every reviewer a repo calls, and a Claude reviewer that is a single Messages API call instead of a Claude Code agent run. This PR brings us up to date and adds the new reviewers. ## What Changed `.github/workflows/ai-review.yml` only: | Change | Detail | |---|---| | Pin bump | Kimi, Codex, Claude: `2127455` → `ad22254` (what `v1` points at today), still SHA-pinned as in lambdaclass#713 | | New reviewers | `ai-review-deepseek.yml`, `ai-review-gemini.yml`, `ai-review-grok.yml` | | Comment gate | Each job starts on a comment only when it begins with its own command (`/kimi`, `/codex`, `/claude`, `/deepseek`, `/gemini`, `/grok`) or `/review`. Before, every PR comment spawned one run per reviewer that then skipped inside the called workflow | | `permissions:` | `contents: read` + `pull-requests: write`, which is all the called workflows declare; the repo default grants write to everything | ## Correctness / Behavior Guarantees How a review triggers: ``` pull_request: opened / ready_for_review └─ not a draft (this workflow) └─ head repo == this repo (called workflow) └─ all 6 reviewers run issue_comment: created └─ starts with /review or /<name> (this workflow) └─ on a PR, author is OWNER / MEMBER / COLLABORATOR (called workflow) └─ /review → all 6, /<name> → that one ``` Behavior changes reviewers should know about: - **Missing secrets.** DeepSeek, Gemini and Grok need `DEEPSEEK_API_KEY`, `GEMINI_API_KEY` and `XAI_API_KEY`, which this repo does not have yet. Until they are added, each of those reviewers posts a "secret is not set" comment and fails its check on every PR. - **A review that does not happen now fails its check** (upstream change): an empty response or provider outage is red rather than green with a comment. - **Claude reviewer** is now one API call over the diff (no checkout, no tools), defaulting to `claude-opus-5-5` at `effort: high`. We passed none of the removed inputs (`max_turns`, `allowed_tools`), so no `with:` changes are needed. - Default models moved upstream: Kimi `kimi-k3.1-pro`, Codex `gpt-6.1-sol`. ## Tests Added / Run - `actionlint -ignore SC2086 -ignore 'specifying action "\$/' .github/workflows/ai-review.yml` (same flags as `pr_lint_gha.yaml`): clean - `gh actions-lock --verify` (same as `verify-lockfile.yml`): all 13 workflows valid; reusable workflows are not tracked in `actions.lock`, so it needs no update ## Related Issues / PRs - Related to lambdaclass#713 (action pinning), lambdaclass#305 (skip drafts), lambdaclass#69 (adopt `lambdaclass/actions`) ## ✅ Verification Checklist - [x] Ran `make fmt`: n/a, no Rust changes - [x] Ran `make lint`: n/a, no Rust changes - [x] Ran `make test`: n/a, no Rust changes
Summary
ai-review.ymljobs ongithub.event.pull_request.draft == falseso Kimi/Codex/Claude reviews only run once a PR is actually up for review.types: [opened, ready_for_review]so PRs opened directly as non-draft still trigger (onlyopenedfires in that case;ready_for_reviewfires on draft → ready)./kimi,/codex,/claude) are preserved viagithub.event_name == 'issue_comment'in the gate.Test plan
ready_for_reviewevent./claude(or/kimi,/codex) on any PR — the corresponding job still runs.