Skip to content

jj bisect run --trust-endpoints - #10016

Open
badp wants to merge 2 commits into
jj-vcs:mainfrom
badp:bisect/verify-endpoints
Open

jj bisect run --trust-endpoints#10016
badp wants to merge 2 commits into
jj-vcs:mainfrom
badp:bisect/verify-endpoints

Conversation

@badp

@badp badp commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

This MR (originally stacked on top of #10015, but I'm not sure how to do that on gitlab) attempts to implement #9188:

  • if a new --trust-endpoints argument is not passed,
  • a list of validations is generated for each commit in heads(REVSETS) and parents(roots(REVSETS));
  • Bisector::next_step returns a NextStep::Verify step for each of these validations,
  • If a validation fails, bisect::run::cmd_bisect_run fails early with a BisectionResult::VerificationFailed and some diagnostics

A few shortcuts you might not be happy about:

  • the use of {evaluation:#?}s in writeln! calls
  • some naming choices (what's an "endpoint" anyway? calling it an expected_evaluation gets ugly in test_bisection)
  • there's no feedback given on how many verifications are required (e.g. if you decide to target/debug/jj bisect run --verify-endpoints false -r 'all()' on the jj repository you'll have a bit of a bad time)
  • I was hoping to split the work in two separate "backend" and "frontend" commits, but I wasn't very successful: the "backend" commit ends up holding most of the "frontend" implementation also

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added/updated tests to cover my changes
  • I fully understand the code that I am submitting (what it does,
    how it works, how it's organized), including any code drafted by an LLM.
  • For any prose generated by an LLM, I have proof-read and copy-edited with
    an eye towards deleting anything that is irrelevant, clarifying anything
    that is confusing, and adding details that are relevant. This includes,
    for example, commit descriptions, PR descriptions, and code comments.

@badp
badp requested a review from a team as a code owner August 19, 2026 21:45
@badp badp changed the title Bisect/verify endpoints jj bisect run --verify-endpoints Aug 19, 2026
@badp
badp marked this pull request as draft August 19, 2026 22:00
@badp
badp force-pushed the bisect/verify-endpoints branch 5 times, most recently from 68b41c1 to 820d512 Compare August 19, 2026 23:07
@badp
badp marked this pull request as ready for review August 19, 2026 23:09
Comment thread cli/src/commands/bisect/run.rs Outdated
Comment thread cli/src/commands/bisect/run.rs Outdated
Comment thread cli/src/commands/bisect/run.rs Outdated
Comment thread cli/src/commands/bisect/run.rs Outdated
Comment thread lib/src/bisect.rs Outdated
Comment thread lib/src/bisect.rs Outdated
Comment thread CHANGELOG.md Outdated
@badp
badp force-pushed the bisect/verify-endpoints branch 2 times, most recently from 86142eb to 4198f68 Compare August 20, 2026 08:16
Comment thread cli/src/commands/bisect/run.rs Outdated
@badp
badp force-pushed the bisect/verify-endpoints branch 2 times, most recently from 6a69afb to 6fb6f0e Compare August 20, 2026 22:31
@badp badp changed the title jj bisect run --verify-endpoints jj bisect run --trust-endpoints Aug 20, 2026
Comment thread cli/src/commands/bisect/run.rs Outdated
Comment thread cli/tests/test_bisect_command.rs Outdated
Comment thread CHANGELOG.md Outdated
Comment thread cli/src/commands/bisect/run.rs Outdated
Comment thread cli/src/commands/bisect/run.rs Outdated
Comment thread cli/tests/test_bisect_command.rs Outdated
Comment thread cli/tests/test_bisect_command.rs
@badp
badp force-pushed the bisect/verify-endpoints branch 3 times, most recently from e58b459 to 1c45377 Compare August 27, 2026 07:56
This implements the core of jj-vcs#9188 
without actually introducing a single test or parameter to trigger the 
new behavior.
@badp
badp force-pushed the bisect/verify-endpoints branch 2 times, most recently from 7bebef9 to 2f29240 Compare August 27, 2026 21:14
This commit holds the rest of the implementation for --trust-endpoints: 
the new argument, the new documentation, the new tests.
@badp
badp force-pushed the bisect/verify-endpoints branch from 2f29240 to f08672d Compare August 27, 2026 21:24
///
/// In order for bisection to be meaningful, `COMMAND` must succeed for
/// every revision in `heads(REVSETS)`, and it must fail for every revision
/// in `parents(roots(REVSETS))`; if you are using `--find-good`, these

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: It should be parents(REVSETS) ~ REVSETS. Consider this graph:

D
|\
| C
B |
|/
A

With jj bisect run -r B::D, we want C to be included (and parents(roots(REVSETS)) won't include it).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh, yes. And obviously a test for that would be good to prevent regressions. Sorry that I didn't notice until now.

/// In order for bisection to be meaningful, `COMMAND` must succeed for
/// every revision in `heads(REVSETS)`, and it must fail for every revision
/// in `parents(roots(REVSETS))`; if you are using `--find-good`, these
/// checks are reversed. (Note that `parents(roots(REVSETS))` contains

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there's a mention of the revset here too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants