fix: find open jobs when running fix from main branch#624
Merged
Conversation
When running `roborev fix` from the main branch without --branch, queryOpenJobs filtered by branch=main in the API query. This excluded jobs originally created on feature branches whose commits were later merged to main — the server-side branch filter eliminated them before filterReachableJobs could check commit-graph reachability via git merge-base --is-ancestor. Skip the API-level branch filter when the branch was auto-resolved (not passed via --branch). filterReachableJobs already handles the actual filtering using commit-graph reachability for SHA refs and branch matching for non-SHA refs. Applied the same fix to runFixList, runFixBatch, and runCompact. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a commit's SHA is no longer reachable from HEAD (e.g., after amend, squash, or rebase), git merge-base --is-ancestor returns exit code 1 and filterReachableJobs silently dropped the job. Fall back to branch matching when the SHA is unreachable: if the job's branch matches the current branch, include it. This handles amended/rebased commits on the same branch while still excluding jobs from other branches. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
roborev: Combined Review (
|
Collaborator
Author
|
False positive. This PR fixes an issue I was experiencing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Skip API-level branch filter when branch is auto-resolved.
queryOpenJobswas sendingbranch=main&branch_include_empty=trueto the server, which excluded jobs originally created on feature branches whose commits were later merged to main. When no--branchflag is passed, the API query now omits the branch filter and relies onfilterReachableJobsfor commit-graph reachability. Applied torunFixOpen,runFixList,runFixBatch, andrunCompact.Fall back to branch matching when a SHA is unreachable.
filterReachableJobsusedgit merge-base --is-ancestorto check whether a job's commit SHA is reachable from HEAD. When a commit has been amended, squashed, or rebased, the original SHA is no longer an ancestor of HEAD — but the dangling object still exists, so git returns exit code 1 (not ancestor) rather than 128 (unknown object). This causedfilterReachableJobsto silently drop the job. Now when a SHA is unreachable, it falls back to branch matching: if the job's branch matches the current branch, the job is included.🤖 Generated with Claude Code