Repository navigation
fix(tree-compare): default Base to the older revision - #2139
felipebergamin merged 4 commits into
Conversation
| <SortableHead | ||
| className="text-center" | ||
| intlKey="treeCompare.sideB" | ||
| intlKey="treeCompare.target" |
There was a problem hiding this comment.
since we are renaming from sideA/sideB, I believe we could use nomenclature closer to what github does with base/compare, instead of base/target
There was a problem hiding this comment.
Also, if we are already changing nomenclature, might be worth to change url params as well.
I would go with the proposal from @mentonin of using two dots ...
There was a problem hiding this comment.
Those comments are not blockers. But suggestions.
There was a problem hiding this comment.
@alanpeixinho I agree with the changes to the URL params. But I changed only on frontend, I'm afraid that changing the API params now can break other API consumers (I don't know if someone is already consuming the comparison api)
also renamed Target to Compare
2f6dc14 to
ae9a94a
Compare
|
@alanpeixinho requesting a new review because I changed the URL params and renamed the Base/Target to Base/Compare. Also requesting review from @tales-aparecida |
| } | ||
|
|
||
| /** Mirror backend _CHANGE_COUNT_SELECT categories for A→B transitions. */ | ||
| /** Mirror backend _CHANGE_COUNT_SELECT categories for base→target transitions. */ |
There was a problem hiding this comment.
change base -> compare
| )} | ||
| > | ||
| {side} | ||
| {side === 'base' ? 'B' : 'C'} |
There was a problem hiding this comment.
nit: Do we still need those labels? They were more important when we named sides A and B
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.
Replace the hashA/hashB search params with a single git-style `range` param, `<base>..<compare>`, so the URL reads the same way the page is labelled. Either side may be empty; the page still fills the missing side (compare defaults to the branch head, base to the revision before it) and rewrites the URL once both are known. The API request params (hash_a/hash_b) are unchanged. Part of kernelci#2130 Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi> Co-authored-by: Cursor <cursoragent@cursor.com>
Main's grouped tests table and tree-compare kci-dev button still referenced the old side names after the Base/Compare rename, so the frontend typecheck failed on the merge with main. Signed-off-by: Felipe Bergamin <felipebergamin@profusion.mobi> Co-authored-by: Cursor <cursoragent@cursor.com>
6ce3a54 to
e6b3ab7
Compare
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 is the previous revision and Compare is the current or latest checkout. Opening compare from tree details pre-fills the viewed commit as Compare and the page fills Base with the revision before it. The selector, tables, grouped tests table, and details drawer say Base and Compare instead of Side A and Side B, matching GitHub's naming.
The URL now carries one git-style param,
range=<base>..<compare>, instead ofhashAandhashB. Either side may be empty; the page fills the missing side and rewrites the URL once both are known. Once both hashes are set they are not reordered by timestamp. Only the swap button exchanges them. Change types (regression, fixed, and so on) follow Base to Compare. The API request params (hash_a,hash_b) are unchanged.Closes #2130
How to test
/tree?i=300), pick a tree's latest checkout, and click "Compare revisions". The URL should readcompare?range=..<hash>and then change torange=<previous>..<hash>once commits load.Visual reference