jj bisect run --trust-endpoints - #10016
Conversation
68b41c1 to
820d512
Compare
86142eb to
4198f68
Compare
6a69afb to
6fb6f0e
Compare
2f29240 to
f08672d
Compare
f47c085 to
eb34bf2
Compare
876c9dd to
2dfe5b7
Compare
| let root_commit_range = ResolvedRevsetExpression::commit(root_commit.id().clone()); | ||
| let commit6_range = ResolvedRevsetExpression::commit(commit6.id().clone()); | ||
| let commit7_range = ResolvedRevsetExpression::commit(commit7.id().clone()); |
There was a problem hiding this comment.
nit: Let's replace _range by _expr here to better match how we typically name this kind of variables. The _range confused me because it made me think they're revset ranges (things like x..y)
| let input_range = commit7_range.ancestors(); | ||
| let input_range_without_root = input_range.minus(&root_commit_range); | ||
| let input_range_without_merge = input_range.minus(&commit7_range); | ||
| let input_range_single_branch = commit6_range.ancestors().union(&commit7_range); |
There was a problem hiding this comment.
Something like root_commit_expr.range(&commit_6_expr).union(&commit7_expr) should be better if we want to test that commit 5 gets verified. If we include the root commit as well (as .ancestors() does), then the connected() thing we added ends up including all commits. (And when you pass a non-contiguous range like 0::6|7, then you're basically telling jj bisect run to trust you that the first bad commit is one of the commits the range, not somewhere in a gap in the range.)
There was a problem hiding this comment.
whoa! if I use that as the REVSET, every single commit on the other side of the diamond gets tested.
it's obvious that I don't understand jj revsets nearly as well as I thought I did
There was a problem hiding this comment.
I don't see why that happens. Let us know if you figure it out.
2dfe5b7 to
3b30a6c
Compare
This commit implements jj-vcs#9188. This used to be a "backend" commit and a "frontend" commit; unfortunately, both commits ended up modifying both src/bisect.rs and commands/bisect/run.rs; I have then decided to squash them together. The most interesting implementation decision has been determining what exactly IS an endpoint; particularly, identifying the revisions that we can expect to be bad. According to git grep, the entire concept of "endpoints" is novel to this codebase. (Not sure I like the name...) My first choice was `parents(roots(REVSETS))`. There's not much to say about it; as a choice, it seemed to fit every test that was already in the codebase. Martin, however, pointed out a new scenario: what if you take the setup in test_bisect_nonlinear and bisect over commits 0|1|3|5|7? It would be desirable to check that commit 7's other parent, commit 6, is also good. (Let's call this the missing parent usecase.) Martin then suggested I use a slightly different expression: `parents(REVSETS) ~ REVSETS`. That does handle the missing parent usecase! But it also broke the "Gaps in the input range are allowed" usecase in test_bisect_linear: if REVSET is "1|2|4|7", that makes the bad endpoints 0, 3 and 6. But if we assert that commit 6 has to be good, that should imply that the first bad commit has to be commit 7. Instead, the bisection_steps remain evaluating commits 2 and 4. This reveals another implementation decision that I have (implicitly) made: the results of the precondition checks are NOT used to populate the rest of the bisector. This turns out to matter depending on how you define an endpoint! The next idea, and what's currently implemented, is then `parents(connected(REVSETS)) ~ connected(REVSETS)`. I'm not well versed enough in the revset language to determine if this any different to `parents(roots(REVSETS))`; both will handle gaps in the input, but both will also fail to handle missing parents! connected(0|1|3|5|7) *does* include commit 6. Given that we weren't able (yet) to find a good/simple definition of these endpoints (and, following feedback from Joseph, we actually do quote these definitions in the --help blurb for `jj bisect run`), I wonder if these expressions should've been added to the revset language itself; something like "root_endpoints()" and "head_endpoints()"...
3b30a6c to
78d5adf
Compare
This commit implements #9188. This used to be a "backend" commit and a "frontend" commit; unfortunately, both commits ended up modifying both src/bisect.rs and commands/bisect/run.rs; I have then decided to squash them together.
The most interesting implementation decision has been determining what exactly IS an endpoint; particularly, identifying the revisions that we can expect to be bad. According to git grep, the entire concept of "endpoints" is novel to this codebase. (Not sure I like the name...)
My first choice was
parents(roots(REVSETS)). There's not much to say about it; as a choice, it seemed to fit every test that was already in the codebase. Martin, however, pointed out a new scenario: what if you take the setup in test_bisect_nonlinear and bisect over commits 0|1|3|5|7? It would be desirable to check that commit 7's other parent, commit 6, is also good. (Let's call this the missing parent usecase.)Martin then suggested I use a slightly different expression:
parents(REVSETS) ~ REVSETS. That does handle the missing parent usecase! But it also broke the "Gaps in the input range are allowed" usecase in test_bisect_linear: if REVSET is "1|2|4|7", that makes the bad endpoints 0, 3 and 6. But if we assert that commit 6 has to be good, that should imply that the first bad commit has to be commit 7. Instead, the bisection_steps remain evaluating commits 2 and 4.This reveals another implementation decision that I have (implicitly) made: the results of the precondition checks are NOT used to populate the rest of the bisector. This turns out to matter depending on how you define an endpoint!
The next idea, and what's currently implemented, is then
parents(connected(REVSETS)) ~ connected(REVSETS). I'm not well versed enough in the revset language to determine if this any different toparents(roots(REVSETS)); both will handle gaps in the input, but both will also fail to handle missing parents! connected(0|1|3|5|7) does include commit 6.Given that we weren't able (yet) to find a good/simple definition of these endpoints (and, following feedback from Joseph, we actually do quote these definitions in the --help blurb for
jj bisect run), I wonder if these expressions should've been added to the revset language itself; something like "root_endpoints()" and "head_endpoints()"...