Skip to content

fix(tree-compare): default Base to the older revision - #2139

Open
felipebergamin wants to merge 2 commits into
kernelci:mainfrom
profusion:fix/2130/swap-default-compare-revisions
Open

felipebergamin wants to merge 2 commits into
kernelci:mainfrom
profusion:fix/2130/swap-default-compare-revisions

Conversation

@felipebergamin

@felipebergamin felipebergamin commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

What it is

Tree compare treated A as “from” and B as “to”, but defaulted A to the branch head and B to the previous revision. A failure on the newest checkout was therefore labelled fixed instead of a regression.

Defaults are now chronological: Base (hashA) is the previous revision, Target (hashB) is the current/latest checkout. Opening compare from tree details pre-fills the viewed commit as Target. Selector, tables, and the details drawer say Base/Target instead of Side A/B.

URL params stay hashA/hashB. Once both hashes are set, they are not reordered by timestamp; only an explicit swap exchanges them. Change types (regression, fixed, …) follow Base → Target.

Closes #2130

How to test

  1. Open tree listing with a wide window (/tree?i=300), pick a tree’s latest checkout, click Compare revisions.
  2. Confirm Target is the current head and Base is the previous revision; a PASS→FAIL from previous to head shows as a regression.
  3. Change Base and Target in the dropdowns (including newer as Base and older as Target). Reload: order stays as selected; summary and row change types follow Base → Target.
  4. Click swap: hashes, columns, and change types invert together.
  5. Optional: open compare from the oldest commit in the history graph. Base may stay empty (known, non-critical; listing/latest-checkout path is unaffected).

Visual reference

image image

The compare page defaulted side A to the branch head and side B to the
previous revision, while deriveCompareChange reads A as the 'from' side.
A test that started failing on the newest revision was therefore
classified as 'fixed' instead of a regression.

Default side B to the branch head and side A to the revision before it,
and pre-fill the current revision as side B when opening compare from
Tree Details, so the default A -> B direction is oldest -> newest.

Closes kernelci#2130
Side A/B hid the comparison direction. Use Base (from) and Target (to) in
the selector, tables, and drawer; URL params stay hashA/hashB.
@felipebergamin
felipebergamin marked this pull request as ready for review September 25, 2026 18:24

This branch has not been deployed

No deployments
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.

[AB Comparison] Swap default revisions in A-B comparison

1 participant