Select from the merge base, not the base branch tip - #14
Merged
Conversation
A pull request event names two commits, and the discover job diffed them directly. That answers how the two trees differ, which stops being the same question as what the branch did the moment the base branch moves on without it: everything merged into the base since the branch left comes back in that diff, in reverse, as though this branch had touched it. amd/skills#207 edits one skill and got behavioral legs for all seven, because its branch predates a base commit touching .github/workflows/evals.yml -- an infra path, so selection re-ran the entire catalog off a file the branch never opened. Two other skills came back the same way and failed on their own. Diff from the merge base instead. It lives in `select --since BASE HEAD` rather than in the workflow's inline Python, because a decision made in YAML cannot be tested or re-run by hand, and this is the one that decides what a run costs. `--changed` still reads a list of paths from stdin for a caller that works them out some other way. There is no merge base for unrelated histories, or in a clone too shallow to hold one. That falls back to the plain diff with a warning: selecting too much costs a slow run, selecting too little ships an untested change. Replaying amd/skills#207 against this build plans one leg (hyperloom-workload-optimizer on its Instinct runner) plus routing, down from eleven behavioral legs. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
This PR ensures that only the required tests run when needed. Before this PR, the "branch diff" was done pointing at the wrong reference, causing excessive tests to run).