HYPERFLEET-914: adapt /review-pr skill for CI non-interactive mode#32
HYPERFLEET-914: adapt /review-pr skill for CI non-interactive mode#32rafabene wants to merge 1 commit intoopenshift-hyperfleet:mainfrom
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds a non-interactive CI mode to the review-pr skill toggled by Sequence Diagram(s)sequenceDiagram
participant CI as CI Runner
participant Skill as review-pr Skill
participant GH as GitHub API
participant Repo as PR/Repo
CI->>Skill: invoke review-pr (CI=true, inputs)
Skill->>Skill: analyze code, generate recommendations & impact warnings
alt recommendations exist
loop for each recommendation
Skill->>GH: POST /repos/{owner}/{repo}/pulls/{number}/comments (path, line, commit oid)
GH-->>Skill: 201 Created or error
alt post failed
Skill->>GH: POST general PR comment (file:line + recommendation)
GH-->>Skill: 201 Created
end
end
end
alt impact warnings exist
Skill->>GH: POST single aggregated general PR comment (impact warnings)
GH-->>Skill: 201 Created
end
alt no recommendations and no impact warnings
Skill->>GH: POST general PR comment "✅ No issues found"
GH-->>Skill: 201 Created
end
Skill-->>CI: exit (single final summary line)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@hyperfleet-code-review/README.md`:
- Around line 180-227: The markdown code fences in the "Testing CI Mode Locally"
/ CI section around the YAML and bash examples (the block starting with "name:
pr-review" / the bash snippet using "CI=true claude -p ...") use backtick fences
and must be changed to tilde fences (~~~) to satisfy MD048; update each fenced
block that includes the YAML with "name: pr-review" and the bash example so
their opening and closing ``` are replaced with ~~~, ensuring indentation and
language hint (yaml, bash) remain the same.
In `@hyperfleet-code-review/skills/review-pr/SKILL.md`:
- Around line 224-225: Update SKILL.md to permit a single final CI summary line
to match output-format.md: replace or amend the bullet that currently reads "No
terminal output" (the phrase "No terminal output") to state that there should be
no streaming terminal output except for one final summary line formatted as "CI
review complete: ..." so the CI behavior is consistent with output-format.md and
the single-summary-line rule.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1693da73-4321-4965-bbb9-53811c14da8c
📒 Files selected for processing (4)
hyperfleet-code-review/.claude-plugin/plugin.jsonhyperfleet-code-review/README.mdhyperfleet-code-review/skills/review-pr/SKILL.mdhyperfleet-code-review/skills/review-pr/output-format.md
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
476daba to
3ad2cac
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
hyperfleet-code-review/README.md (1)
123-123: Clarify inline-comment wording to include fallback behavior.These lines state that recommendations are posted as inline comments unconditionally, but Line 232 (and
skills/review-pr/output-format.md:192-211) documents a fallback to a general PR comment when inline posting fails. Please make the wording non-absolute to avoid operator confusion.Suggested wording update
-- **CI mode**: Activated when `CI=true` is set in the environment. Posts all recommendations as inline comments on the PR without interactive prompts. See [CI Integration](`#ci-integration`) for details. +- **CI mode**: Activated when `CI=true` is set in the environment. Attempts to post recommendations as inline comments on the PR (falls back to a general PR comment with file/line reference if inline posting fails), without interactive prompts. See [CI Integration](`#ci-integration`) for details.-The `/review-pr` skill supports non-interactive CI mode for automated PR reviews in Prow jobs or other CI systems. When `CI=true` is set, the skill posts all recommendations directly as inline comments on the PR instead of using interactive pagination. +The `/review-pr` skill supports non-interactive CI mode for automated PR reviews in Prow jobs or other CI systems. When `CI=true` is set, the skill attempts to post recommendations as inline comments on the PR (with fallback to a general PR comment when inline posting fails) instead of using interactive pagination.As per coding guidelines, "Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity."
Also applies to: 157-157
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@hyperfleet-code-review/README.md` at line 123, Update the "**CI mode**" description to remove the absolute claim that recommendations are always posted as inline comments; change the sentence that currently reads "Posts all recommendations as inline comments on the PR without interactive prompts." to a non-absolute phrasing that notes CI mode will attempt to post inline comments but will fall back to posting a single general PR comment if inline posting fails (ensure the wording mentions the fallback behavior and preserves the note about CI=true and no interactive prompts). Reference the "**CI mode**" section and the existing fallback behavior documented elsewhere so the new sentence clearly communicates attempt+fallback rather than an unconditional guarantee.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@hyperfleet-code-review/README.md`:
- Line 123: Update the "**CI mode**" description to remove the absolute claim
that recommendations are always posted as inline comments; change the sentence
that currently reads "Posts all recommendations as inline comments on the PR
without interactive prompts." to a non-absolute phrasing that notes CI mode will
attempt to post inline comments but will fall back to posting a single general
PR comment if inline posting fails (ensure the wording mentions the fallback
behavior and preserves the note about CI=true and no interactive prompts).
Reference the "**CI mode**" section and the existing fallback behavior
documented elsewhere so the new sentence clearly communicates attempt+fallback
rather than an unconditional guarantee.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1cb4d097-f9e7-4a30-bbe6-18bff2126aca
📒 Files selected for processing (5)
CLAUDE.mdhyperfleet-code-review/.claude-plugin/plugin.jsonhyperfleet-code-review/README.mdhyperfleet-code-review/skills/review-pr/SKILL.mdhyperfleet-code-review/skills/review-pr/output-format.md
✅ Files skipped from review due to trivial changes (2)
- hyperfleet-code-review/.claude-plugin/plugin.json
- CLAUDE.md
🚧 Files skipped from review as they are similar to previous changes (2)
- hyperfleet-code-review/skills/review-pr/SKILL.md
- hyperfleet-code-review/skills/review-pr/output-format.md
667a6cb to
1dcda1b
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@hyperfleet-code-review/skills/review-pr/output-format.md`:
- Around line 196-203: In
hyperfleet-code-review/skills/review-pr/output-format.md the fenced code blocks
causing MD048 warnings use backticks (```bash / ``` / ```text); update each of
those fences (the CI example blocks shown around the snippet and the other
occurrences flagged at lines referenced in the review) to use tilde fences
(~~~bash / ~~~ / ~~~text) so that all code block openers and closers are
consistent with the linter; replace every ``` opener/closer in the file examples
with the corresponding ~~~ variant (preserving the language tag like bash or
text) to resolve MD048.
- Around line 190-191: The statement "When CI mode is enabled (`CI=true` — see
SKILL.md Dynamic context), the skill posts results directly to the PR as GitHub
comments instead of printing to the terminal" contradicts the later requirement
that two specific terminal lines must still be printed; update the CI-mode
description to explicitly state the exception: when `CI=true` the skill posts
results to PR comments but must still emit the required CI start/complete
terminal lines (the two terminal lines referenced later) so CI consumers aren’t
broken, or alternatively remove/modify the later terminal-line requirement and
make both behaviors consistent; edit the paragraph containing "When CI mode is
enabled (`CI=true` — see SKILL.md Dynamic context)" and the section describing
the "two terminal lines" so they clearly document the single correct behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a86787d5-3135-4ccc-a0c5-e8e2665ef65b
📒 Files selected for processing (5)
CLAUDE.mdhyperfleet-code-review/.claude-plugin/plugin.jsonhyperfleet-code-review/README.mdhyperfleet-code-review/skills/review-pr/SKILL.mdhyperfleet-code-review/skills/review-pr/output-format.md
✅ Files skipped from review due to trivial changes (3)
- hyperfleet-code-review/.claude-plugin/plugin.json
- CLAUDE.md
- hyperfleet-code-review/README.md
🚧 Files skipped from review as they are similar to previous changes (1)
- hyperfleet-code-review/skills/review-pr/SKILL.md
a36997e to
13ba1d6
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
hyperfleet-code-review/skills/review-pr/output-format.md (1)
188-191:⚠️ Potential issue | 🟡 MinorClarify that CI mode still outputs terminal lines.
Line 190-191 states the skill posts results "instead of printing to the terminal," but lines 240-252 explicitly require two terminal output lines (startup and completion). This contradiction could mislead implementers.
📝 Proposed fix to clarify terminal behavior
-When CI mode is enabled (`CI=true` — see SKILL.md Dynamic context), the skill posts results directly to the PR as GitHub comments instead of printing to the terminal. No `AskUserQuestion` prompts are used. +When CI mode is enabled (`CI=true` — see SKILL.md Dynamic context), the skill posts results directly to the PR as GitHub comments (non-interactive), with only the CI startup and completion status lines written to terminal output. No `AskUserQuestion` prompts are used.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@hyperfleet-code-review/skills/review-pr/output-format.md` around lines 188 - 191, The documentation's "CI mode" paragraph incorrectly states results are posted "instead of printing to the terminal"; update that paragraph to clarify that CI mode (CI=true) still emits the required two terminal output lines (startup and completion) while avoiding AskUserQuestion prompts and posting full results as GitHub comments, explicitly referencing "CI mode", "CI=true", "AskUserQuestion", and the startup/completion terminal output lines to remove the contradiction.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@hyperfleet-code-review/README.md`:
- Around line 159-167: Update the "How It Works" steps to include the two CI
terminal output lines emitted in CI mode: add a startup line before analysis
(`CI review started: reviewing <PR-URL>...`) and a completion line after posting
(`CI review complete: N recommendations posted (X blocking, Y nit) to
<PR-URL>`); modify the section that lists steps 1–6 so the startup line appears
immediately before step 1 and the completion line appears immediately after step
6, matching the behavior described in output-format.md and SKILL.md.
---
Duplicate comments:
In `@hyperfleet-code-review/skills/review-pr/output-format.md`:
- Around line 188-191: The documentation's "CI mode" paragraph incorrectly
states results are posted "instead of printing to the terminal"; update that
paragraph to clarify that CI mode (CI=true) still emits the required two
terminal output lines (startup and completion) while avoiding AskUserQuestion
prompts and posting full results as GitHub comments, explicitly referencing "CI
mode", "CI=true", "AskUserQuestion", and the startup/completion terminal output
lines to remove the contradiction.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 16643bd7-62d0-4b29-9a8d-9ba2ebda64de
📒 Files selected for processing (5)
CLAUDE.mdhyperfleet-code-review/.claude-plugin/plugin.jsonhyperfleet-code-review/README.mdhyperfleet-code-review/skills/review-pr/SKILL.mdhyperfleet-code-review/skills/review-pr/output-format.md
✅ Files skipped from review due to trivial changes (2)
- hyperfleet-code-review/.claude-plugin/plugin.json
- CLAUDE.md
13ba1d6 to
61f4121
Compare
61f4121 to
0b84249
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (2)
hyperfleet-code-review/README.md (2)
170-177:⚠️ Potential issue | 🟠 Major
ANTHROPIC_API_KEYis missing from the CI environment requirements.Line 170-177 lists required variables but omits the Claude API key, which is required for execution unless explicitly pre-baked in the image. Add it (or explicitly document the baked-in assumption) to prevent broken CI setups.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@hyperfleet-code-review/README.md` around lines 170 - 177, The README's CI env variables table omits ANTHROPIC_API_KEY; update the table (the same place listing CI, GH_TOKEN, JIRA_API_TOKEN, JIRA_AUTH_TYPE, JIRA_SERVER) to include a row for `ANTHROPIC_API_KEY` (mark as Yes unless the image truly bakes it in) and either document that the key must be provided in CI or explicitly state the baked-in image assumption so CI consumers know whether they must set `ANTHROPIC_API_KEY`.
161-166:⚠️ Potential issue | 🟡 MinorHow-it-works steps are missing the two CI terminal lines documented elsewhere.
Line 161-166 currently skips the startup/completion terminal output, but Line 251 and the skill docs define both lines as CI behavior. Please add them in this section to keep CI docs consistent and avoid operator confusion.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@hyperfleet-code-review/README.md` around lines 161 - 166, The "How-it-works" ordered list is missing the two CI terminal output lines (startup and completion) that are documented elsewhere; update the How-it-works section in README.md to insert a startup terminal output line (e.g., "CI terminal: skill started (CI=true)") at the beginning of the sequence and a completion terminal output line (e.g., "CI terminal: skill completed") at the end so it matches the CI behavior described in the CI behavior/skill docs; ensure the wording matches the existing CI documentation for consistency.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@hyperfleet-code-review/README.md`:
- Around line 170-177: The README's CI env variables table omits
ANTHROPIC_API_KEY; update the table (the same place listing CI, GH_TOKEN,
JIRA_API_TOKEN, JIRA_AUTH_TYPE, JIRA_SERVER) to include a row for
`ANTHROPIC_API_KEY` (mark as Yes unless the image truly bakes it in) and either
document that the key must be provided in CI or explicitly state the baked-in
image assumption so CI consumers know whether they must set `ANTHROPIC_API_KEY`.
- Around line 161-166: The "How-it-works" ordered list is missing the two CI
terminal output lines (startup and completion) that are documented elsewhere;
update the How-it-works section in README.md to insert a startup terminal output
line (e.g., "CI terminal: skill started (CI=true)") at the beginning of the
sequence and a completion terminal output line (e.g., "CI terminal: skill
completed") at the end so it matches the CI behavior described in the CI
behavior/skill docs; ensure the wording matches the existing CI documentation
for consistency.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4027b9c3-21b5-4695-8280-2758d710605e
📒 Files selected for processing (5)
CLAUDE.mdhyperfleet-code-review/.claude-plugin/plugin.jsonhyperfleet-code-review/README.mdhyperfleet-code-review/skills/review-pr/SKILL.mdhyperfleet-code-review/skills/review-pr/output-format.md
✅ Files skipped from review due to trivial changes (2)
- CLAUDE.md
- hyperfleet-code-review/.claude-plugin/plugin.json
🚧 Files skipped from review as they are similar to previous changes (2)
- hyperfleet-code-review/skills/review-pr/SKILL.md
- hyperfleet-code-review/skills/review-pr/output-format.md
0b84249 to
8f251a2
Compare
- Detect CI=true in Dynamic context for non-interactive execution - Post all recommendations as inline PR comments (with fallback) - Post impact warnings as a single general PR comment - Post "no issues found" comment when zero findings - Use model text for terminal output (Bash echo is invisible in pipe mode) - Enforce AskUserQuestion in interactive mode - Skip interactive features in CI: self-review fixes, comment mode, review comment responses, follow-up ticket creation, navigation - Document CI invocation with stream-json + jq for real-time output - Bump plugin version 0.5.0 -> 0.6.0
8f251a2 to
d905409
Compare
There was a problem hiding this comment.
♻️ Duplicate comments (1)
hyperfleet-code-review/skills/review-pr/output-format.md (1)
190-191:⚠️ Potential issue | 🟠 MajorClarify terminal output behavior to prevent misimplementation.
Line 190 states the skill posts to GitHub "instead of printing to the terminal," but lines 240-253 require two specific terminal lines (startup and completion). This contradiction could mislead implementers to suppress all terminal output, breaking CI observability.
The intent appears to be: post findings to GitHub (not terminal pagination) while still emitting status lines to the terminal. The current phrasing doesn't clearly convey this distinction.
📝 Suggested clarification
-When CI mode is enabled (`CI=true` — see SKILL.md Dynamic context), the skill posts results directly to the PR as GitHub comments instead of printing to the terminal. No `AskUserQuestion` prompts are used. +When CI mode is enabled (`CI=true` — see SKILL.md Dynamic context), the skill posts review findings directly to the PR as GitHub comments (non-interactive), with only the CI startup/completion status lines written to terminal output. No `AskUserQuestion` prompts are used.Note: This issue was previously flagged and marked as addressed in commit a36997e, but the current text still contains the ambiguity.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@hyperfleet-code-review/skills/review-pr/output-format.md` around lines 190 - 191, The CI-mode description is ambiguous: it says the skill posts results to GitHub "instead of printing to the terminal" which conflicts with later requirements to still emit two status lines (startup and completion) and disables AskUserQuestion prompts; update the wording around "CI=true" / "SKILL.md Dynamic context" to explicitly state that in CI mode the skill posts findings and reports as GitHub comments while still writing two small status lines to stdout (a startup line and a completion line) for CI observability, and that AskUserQuestion prompts and interactive pagination of findings must be suppressed; ensure the new text mentions "CI mode (CI=true)", "AskUserQuestion", and the startup/completion terminal status lines so implementers know to keep those two status prints but not print paginated findings to the terminal.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@hyperfleet-code-review/skills/review-pr/output-format.md`:
- Around line 190-191: The CI-mode description is ambiguous: it says the skill
posts results to GitHub "instead of printing to the terminal" which conflicts
with later requirements to still emit two status lines (startup and completion)
and disables AskUserQuestion prompts; update the wording around "CI=true" /
"SKILL.md Dynamic context" to explicitly state that in CI mode the skill posts
findings and reports as GitHub comments while still writing two small status
lines to stdout (a startup line and a completion line) for CI observability, and
that AskUserQuestion prompts and interactive pagination of findings must be
suppressed; ensure the new text mentions "CI mode (CI=true)", "AskUserQuestion",
and the startup/completion terminal status lines so implementers know to keep
those two status prints but not print paginated findings to the terminal.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f007465b-9557-440c-9f67-84f1fafe1a7b
📒 Files selected for processing (5)
CLAUDE.mdhyperfleet-code-review/.claude-plugin/plugin.jsonhyperfleet-code-review/README.mdhyperfleet-code-review/skills/review-pr/SKILL.mdhyperfleet-code-review/skills/review-pr/output-format.md
✅ Files skipped from review due to trivial changes (3)
- hyperfleet-code-review/.claude-plugin/plugin.json
- CLAUDE.md
- hyperfleet-code-review/skills/review-pr/SKILL.md
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Summary
CI=trueenvironment variable in the skill's Dynamic contextecho, which is invisible in pipe mode)jq, env vars, Prow job example, known limitations0.5.0→0.6.0Test plan
/review-prwithoutCI=true— verify interactive mode is unchanged (pagination, AskUserQuestion prompts)CI review started: reviewing <PR-URL>...andCI review complete: N recommendations posted (X blocking, Y nit) to <PR-URL>⚙ Bash: Fetch PR details,⚙ Read: path/to/file,⚙ Agent: Security checks)Summary by CodeRabbit
New Features
Documentation
Chores