Repository navigation
Conversation
|
The fix covers parts 2 and 3, and the tests read well. Two small things:
Neither blocks the merge for me. Part 1 (how old a baseline may be) is still open in #2226; the printed line is a good interim. |
…line (xcl-dev#2226) The PR's own smoke block already had to be free of "(uncommitted changes)", but a main block with local changes counted as main. When several main blocks had the PR's title and time, the first pasted one was the baseline, so an older, more favourable run could be put first. - A main block whose commit line says "(uncommitted changes)" is not a baseline; when it is the only one, the check says to rerun on a clean main. - With the commit distance known (`main_behind`: git rev-list locally, compare/...main ahead_by on GitHub), the baseline is the matching block of the newest main commit; without it, the first block as before. - How many commits behind main each main block is gets printed, not judged: the cut-off for an old baseline is the maintainer's call. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3369021 to
4e4c508
Compare
|
Thanks, both fixed in
AI use: Claude Code (Claude Opus 5.5) made the change and drafted this reply. |
|
Code review on
|
|
Re-read the new head ( LGTM from me. The new head needs a fresh CI approval; the approved run ( |
|
Updated review on
|
The smoke check of
pr_check.pylet the author pick themainbaseline: a main block with local changes counted as main (the PR's block already had to be clean), and with several matching main blocks the first pasted one was used, so an older, more favourable run could be put first. Fixes parts 2 and 3 of #2226; part 1 (how old a baseline may be) is reported, not judged.What is in it
scripts/pr_check.py:commit:line says(uncommitted changes)is not a baseline; when only such a block is there, the check asks for a rerun on a clean checkout of main;check(..., main_behind=...): with the distance of each main commit from main known, the baseline is the block of the newest main commit with the PR's title and time, wherever it is pasted; without it, or when any candidate's distance is unknown (a failed API call), the first block as before (main_baseline);main()gives that distance (git rev-list --count <sha>..origin/mainwith--local,compare/<sha>...mainahead_byon GitHub) and prints one line per main block,main regression run <sha>: N commit(s) behind main, without failing on it.scripts/test_pr_check.py:test_a_main_run_with_uncommitted_changes_is_not_a_baseline,test_the_newest_main_block_is_the_baseline_whatever_its_place(both orders of an old and a current main block; withoutmain_behind, or with an unknown distance, the first block is used; a failing comparison names the baseline's distance).Tested
python -m unittest discover -s scripts -p "test_pr_check.py": 15 tests, OK. Withpr_check.pyfrommainthe two new tests fail (one failure, one error), the other 13 pass.python scripts/pr_check.py --localon a body with two main blocks (cbc296aand currentmain) and a PR block: prints54 commit(s) behind mainand0 commit(s) behind main, thendescription ok.Regression run
scripts/changes, not the runtime.Not tested
main_behind(compare/...mainahead_by) against the real API in the workflow; the local path was run.AI use
🤖 Generated with Claude Code