Repository navigation
Conversation
…remote ref nearestPatchBaseline ran merge-base and rev-list once per remote-tracking ref, so collecting node outputs scaled with the number of origin branches. On repositories with a few thousand branches this kept the runner busy for minutes after every node. Only refs pointing into recorded..HEAD can be closer than the recorded baseline, so list that range once and count just those candidates. The selected baseline is unchanged.
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.
What changed
At the end of each SOP node, patch inventory collection probed every origin remote-tracking ref with separate
merge-baseandrev-listprocesses. On a repository with thousands of remote branches, this kept the runner busy for minutes after every node, so it did not pick up the next task.nearestPatchBaselinenow listsrecorded..HEADonce and counts only refs whose tips are in that range. If the recorded baseline is invalid, it uses one merged-ref query instead of probing ancestry ref by ref. Ref ordering, filtering, and strict count comparison are unchanged.Scope
Compatibility
The selected baseline is unchanged, including ties, refs at HEAD,
origin/HEAD, merged upstream refs, and invalid recorded baselines. There are no schema or runner-protocol changes and no migration is required.Validation
Relevant checks passed:
gofmt -l internal/gitwork— no output.go vet ./....go test ./internal/gitwork/ -run 'Baseline|Patch' -count=1 -v— all seven new scenarios passed and matched the retained scan implementation.python3 scripts/check-public.py.Performance was measured once per implementation in a temporary repository with 2,000 unrelated remote branches and one published intermediate commit. Both implementations selected that same commit. Process starts, including HEAD resolution, were counted with a Git wrapper, and the temporary measurement code was removed.
Safety