Repository navigation
fix(work-item-pipeline): item_done's push_and_open_pr silently no-ops on a branch-name mismatch - #558
Conversation
…m's actual branch differently across call sites — `push_branch` used `resolve_worktree_branch` (checks what's really on disk), while `branch_diverged`/`is_pr_merged`/`relabel_pr_completed`/`pr_ci_status` all used the naive `task_branch_name` guess. When those two disagree (a renamed branch, or a worktree predating the current slugged-naming scheme), `branch_diverged` checks a branch that doesn't match what was actually pushed, finds \"nothing diverged\", and `item_done` returns `Ok` with no push, no PR, no comment, no state change — reproduced live on item #331. Fix: added `flare_git_core::worktree::resolve_item_task_branch(item, repo_root)` as the single source of truth for \"what branch is this item's worktree actually on\" (reads the real checkout, falls back to `task_branch_name` only if no worktree exists yet), and switched every one of those call sites to use it instead of recomputing the guess independently. Also fixed a related issue this WIP surfaced: `run_or_resume_with_sender`'s periodic heartbeat call didn't carry the owner override across the async workflow-engine thread boundary, so `item_heartbeat` calls made from deep in the loop could silently fail owner checks — same class of bug as the earlier `finalize`-step owner-identity fix (PR #531). Verified: `cargo build --lib` and `cargo build -p flare-git-core --lib` clean; `cargo fmt --check` clean; `cargo clippy --tests -- -A unsafe_code -A clippy::pedantic -D warnings` clean on both `agentflare` and `flare-git-core`; `flare-git-core::worktree::tests` (41/41), `work_item_pipeline::*` (54/54, 2 pre-existing ignores unrelated), and the new `item_pr_failure_tests` integration tests (2/2) all pass.
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 43 minutes Limit details: You’ve used the included review currently available. Your 60 included PR review attempts over the past 7 days set your current allowance at 1 review per hour. Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits within each organization. For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
Comment |
Root-causes and fixes
item_done's silent no-op: it computed the item's actual branch differently across call sites —push_branchusedresolve_worktree_branch(checks what's really on disk), whilebranch_diverged/is_pr_merged/relabel_pr_completed/pr_ci_statusall used the naivetask_branch_nameguess. When those two disagree (a renamed branch, or a worktree predating the current slugged-naming scheme),branch_divergedchecks a branch that doesn't match what was actually pushed, finds "nothing diverged", anditem_donereturnsOkwith no push, no PR, no comment, no state change — reproduced live on item #331.Fix: added
flare_git_core::worktree::resolve_item_task_branch(item, repo_root)as the single source of truth for "what branch is this item's worktree actually on" (reads the real checkout, falls back totask_branch_nameonly if no worktree exists yet), and switched every one of those call sites to use it instead of recomputing the guess independently.Also fixed a related issue this WIP surfaced:
run_or_resume_with_sender's periodic heartbeat call didn't carry the owner override across the async workflow-engine thread boundary, soitem_heartbeatcalls made from deep in the loop could silently fail owner checks — same class of bug as the earlierfinalize-step owner-identity fix (PR #531).Verified:
cargo build --libandcargo build -p flare-git-core --libclean;cargo fmt --checkclean;cargo clippy --tests -- -A unsafe_code -A clippy::pedantic -D warningsclean on bothagentflareandflare-git-core;flare-git-core::worktree::tests(41/41),work_item_pipeline::*(54/54, 2 pre-existing ignores unrelated), and the newitem_pr_failure_testsintegration tests (2/2) all pass.Opened by
claude-codeon flared:c997d745ae66 for item #512 via agentflare.