Fix Bunny review CI state handling#1925
Conversation
# Conflicts: # src-tauri/src/commands/storage/commands/entities.rs # src-tauri/src/http_dispatch.rs
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
✅ Bunny Review CompletedTip Review posted. The specimen has left the observation table.
|
🐰 Bunny ReviewWarning Anomalies remain. 3 finding(s): Note Mode: 🧭 Specimen Summary
🔎 Isolated Defects
🤖 Repair prompt for isolated Bunny findings✅ Control Checks
❓ Open Questions
🧪 Observations
📝 Reviewer NotesWarning Withheld 1 model finding(s) because their diff locations failed validation. 🧰 CI Status
|
| BUNNY_REVIEW_SKILL_PATH: /tmp/bunny-review-tool/.github/bunny-review/SKILL.md | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| run: | | ||
| HEAD_SHA=$(gh pr view "$PR_NUM" --json headRefOid -q .headRefOid) |
There was a problem hiding this comment.
⚠️ MEDIUM: Head resync leaves status pinned to the old SHA
Location: .github/workflows/bunny-review.yml:115
A fascinating split-brain specimen: the workflow re-reads the live PR head and may checkout that newer commit before producing the review, but the exported
PR_HEAD_SHAused for commit statuses remains the earlier value from the previous step. If the PR advances between checkout and review, Bunny can inspect and comment on one commit while marking another commit as reviewed. The real head is then left without the status the branch protection organism expects.
Tip
Suggested fix: After the resync, export the corrected HEAD_SHA back into GITHUB_ENV, or have every status publication use the same freshly resolved SHA as the review execution.
🤖 Repair prompt for agents
Use this as an implementation handoff, not as reviewer prose. Keep the response concise, technical, and direct.
Task: verify and repair `.github/workflows/bunny-review.yml` around line 115.
Finding: Head resync leaves status pinned to the old SHA
Severity: medium
Suggested repair: After the resync, export the corrected `HEAD_SHA` back into `GITHUB_ENV`, or have every status publication use the same freshly resolved SHA as the review execution.
Validate the fix with the narrowest relevant check.
If the finding is stale, leave the code unchanged and record why.
| }) | ||
| } | ||
|
|
||
| fn default_for_agents(state: &AppState, id: &str) -> bool { |
There was a problem hiding this comment.
ℹ️ LOW: Test helper masks deleted connection rows
Location: src-tauri/src/http_dispatch.rs:1147
A charming little anesthetic:
default_for_agentsconverts a missing connection row intofalse, exactly the value expected for the demoted default. If a future remote create or update regression deleteslanguage-ainstead of clearingdefaultForAgents, these tests would applaud absence as success. The prior direct row assertions at least demanded that the specimen still exist.
Tip
Suggested fix: Require the connection row to exist in the helper, then read defaultForAgents; absence should fail the test rather than masquerade as a cleared flag.
🤖 Repair prompt for agents
Use this as an implementation handoff, not as reviewer prose. Keep the response concise, technical, and direct.
Task: verify and repair `src-tauri/src/http_dispatch.rs` around line 1147.
Finding: Test helper masks deleted connection rows
Severity: low
Suggested repair: Require the connection row to exist in the helper, then read `defaultForAgents`; absence should fail the test rather than masquerade as a cleared flag.
Validate the fix with the narrowest relevant check.
If the finding is stale, leave the code unchanged and record why.
| json!({ | ||
| "id": "default-chat-preset", | ||
| "name": "Default Chat", | ||
| "mode": "chat", |
There was a problem hiding this comment.
ℹ️ LOW: Default preset guard now ignores legacy default shape
Location: src-tauri/src/http_dispatch.rs:1420
A curious narrowing of the experiment: the remote default-preset mutation test now seeds only
isDefault: true, while the removed fixture also exercised the legacydefault: trueshape. Adjacent readers still treatisDefault ?? defaultas the contract, so a hostablestorage_updatepath that forgets legacy defaults could mutate protected presets without this test noticing. The guard may be healthy; this specimen simply stopped proving the older blood type still matches.
Tip
Suggested fix: Restore a legacy-shape assertion or add a second remote update test where the preset is protected by default: true rather than only isDefault: true.
🤖 Repair prompt for agents
Use this as an implementation handoff, not as reviewer prose. Keep the response concise, technical, and direct.
Task: verify and repair `src-tauri/src/http_dispatch.rs` around line 1420.
Finding: Default preset guard now ignores legacy default shape
Severity: low
Suggested repair: Restore a legacy-shape assertion or add a second remote update test where the preset is protected by `default: true` rather than only `isDefault: true`.
Validate the fix with the narrowest relevant check.
If the finding is stale, leave the code unchanged and record why.
Summary
Fixes Bunny Review CI state handling, PR status reporting, and draft PR coverage.
Bunny Reviewcommit status on the PR head instead of relying on a custom check-runCommittoHead, and includes a subject onBasewhen resolvablerefactorWhy
The previous workflow could stamp the latest PR SHA while reviewing an older checkout, advance incremental state after failed model runs, and fail to show Bunny as a PR-head status/check. Draft PRs were also skipped by the auto-dispatch gate, which meant Bunny would not run until the PR became ready for review.
Validation
Local:
python3 -m py_compile .github/bunny-review/bunny_review.py.github/bunny-review/bunny_review.pynode scripts/check-workflow-names.mjsgit diff --checkLive fork test PRs targeting
Promansis:fix/bunny-review-ci:Bunny Reviewstatus context appears on the PR head and clean full review completesHead/Baselabels and base subjectNITPICKrefactorUpstream note
The code and workflow are repository-agnostic, but automatic dispatch still depends on upstream Actions token policy. If upstream has read-only workflow tokens, the
pull_request_targetdispatcher can still be blocked fromgh workflow rununtil upstream allows write tokens or uses an app/PAT-backed dispatch path.