Scripts: let local PR checks use an upstream main ref #2646

Open
github-bot wants to merge 1 commit from github-bot/gh-2646 into main AGit
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 04:57 UTC · original
luckyteagirl:codex/pr-check-local-main-ref → main · +39 −1 · 2 files · 1 commits · open

A fork checkout can have a stale origin/main, which makes the local PR checker reject a retail smoke report from the current upstream main. Use --local --main-ref upstream/main to check against a fetched upstream branch.

What is in it

  • Add --main-ref to the local checker, with origin/main as the default.
  • Exercise both refs with a temporary Git repository in the CLI test.

Tested

  • The new CLI test failed before the fix because the checker rejected the flag.
  • python -B -m unittest discover -s scripts -p 'test_*.py' -v: 26 passed, 0 failed, 0 skipped on Windows.
  • After updating the smoke fixture for PR #2219's required exit and peak commit fields, the combined tree's full Python suite passed 32/32; before the fixture update, the focused test failed with exactly those two missing-field diagnostics. The standalone branch still passed 26/26.
  • git diff --check passed.

Regression run

  • Not applicable. Only the Python checker and its tests changed.

Not tested

  • Rust/GPU tests and a retail smoke run. This changes only the Python PR checker and its tests.

AI use

  • Codex (GPT-6.2 Sol) implemented the option, wrote the regression test, and ran the Python checks.
**@⁠luckyteagirl** on GitHub · 2026-11-26 04:57 UTC · [original](https://github.com/xcl-dev/xcl/pull/2646) `luckyteagirl:codex/pr-check-local-main-ref` → `main` · +39 −1 · 2 files · 1 commits · open A fork checkout can have a stale `origin/main`, which makes the local PR checker reject a retail smoke report from the current upstream main. Use `--local --main-ref upstream/main` to check against a fetched upstream branch. **What is in it** - Add `--main-ref` to the local checker, with `origin/main` as the default. - Exercise both refs with a temporary Git repository in the CLI test. **Tested** - The new CLI test failed before the fix because the checker rejected the flag. - `python -B -m unittest discover -s scripts -p 'test_*.py' -v`: 26 passed, 0 failed, 0 skipped on Windows. - After updating the smoke fixture for PR #2219's required `exit` and `peak commit` fields, the combined tree's full Python suite passed 32/32; before the fixture update, the focused test failed with exactly those two missing-field diagnostics. The standalone branch still passed 26/26. - `git diff --check` passed. **Regression run** - Not applicable. Only the Python checker and its tests changed. **Not tested** - Rust/GPU tests and a retail smoke run. This changes only the Python PR checker and its tests. **AI use** - Codex (GPT-6.2 Sol) implemented the option, wrote the regression test, and ran the Python checks.
A fork can have a stale origin/main and reject valid upstream smoke baselines. Let local callers specify the fetched main ref while keeping origin/main as the default.

Exercise the default and alternate refs in a temporary Git repository.

Assisted-by: Codex (GPT-6.2 Sol)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:14:31 +00:00
Author
Owner

@⁠luckyteagirl on GitHub · 2026-11-26 05:20 UTC · original

Thanks for the precise repro. I added both fields to the synthetic smoke block in 00765166 and updated the PR description. The focused test reproduced the two missing-field diagnostics on the combined tree before the edit; after the edit, the combined Python suite passed 32/32 and this branch passed 26/26. The new head is in upstream CI now.

Codex assisted with the fixture and checks; the root session's exact model identifier is not exposed to me.

**@⁠luckyteagirl** on GitHub · 2026-11-26 05:20 UTC · [original](https://github.com/xcl-dev/xcl/pull/2646#issuecomment-7183406061) Thanks for the precise repro. I added both fields to the synthetic smoke block in `00765166` and updated the PR description. The focused test reproduced the two missing-field diagnostics on the combined tree before the edit; after the edit, the combined Python suite passed 32/32 and this branch passed 26/26. The new head is in upstream CI now. Codex assisted with the fixture and checks; the root session's exact model identifier is not exposed to me.
Author
Owner

@⁠fromthemoonx on GitHub · 2026-11-26 05:05 UTC · original · edited 2026-11-26 06:03 UTC

Rerun on the new head 0076516: fixed. The script tests pass alone (26 of 26), merged onto main (26 of 26) and together with #2219 (32 of 32).


On 9fa03d5: The script tests passed on Windows (26 of 26), but together with #2219 (my PR, also open, also in pr_check.py) the new test_local_check_uses_requested_main_ref failed. Two lines in its fixture fix that for either merge order.

#2219 makes the checker require exit and peak commit lines in the PR's smoke block. This test's run block has neither, so on 9fa03d5 merged with #2219's 8d99ad3 (no conflict) the --main-ref upstream/main call exits 1:

- the PR's regression run (`xcl-smoke` block of commit 1234567890abcdef) has no `exit` line
- the PR's regression run (`xcl-smoke` block of commit 1234567890abcdef) has no `peak commit` line

With exit: 0x0 and peak commit: 4000 MB added to that run string (scratch, only in this test):

python -B -m unittest discover -s scripts -p 'test_*.py'
9fa03d5 as is 26 passed
9fa03d5 + the two lines 26 passed
9fa03d5 merged with #2219, as is 32 run, 1 failed (this test)
9fa03d5 merged with #2219, + the two lines 32 passed

Windows 11 Pro 26300, Python 3.12. --main-ref shows in --help as described.

AI use: Claude Code (Claude Opus 5.5) ran the checks and wrote this comment.

**@⁠fromthemoonx** on GitHub · 2026-11-26 05:05 UTC · [original](https://github.com/xcl-dev/xcl/pull/2646#issuecomment-7183176445) · edited 2026-11-26 06:03 UTC **Rerun on the new head `0076516`: fixed. The script tests pass alone (26 of 26), merged onto `main` (26 of 26) and together with #2219 (32 of 32).** --- *On `9fa03d5`:* The script tests passed on Windows (26 of 26), but together with #2219 (my PR, also open, also in `pr_check.py`) the new `test_local_check_uses_requested_main_ref` failed. Two lines in its fixture fix that for either merge order. #2219 makes the checker require `exit` and `peak commit` lines in the PR's smoke block. This test's `run` block has neither, so on `9fa03d5` merged with #2219's `8d99ad3` (no conflict) the `--main-ref upstream/main` call exits 1: ``` - the PR's regression run (`xcl-smoke` block of commit 1234567890abcdef) has no `exit` line - the PR's regression run (`xcl-smoke` block of commit 1234567890abcdef) has no `peak commit` line ``` With `exit: 0x0` and `peak commit: 4000 MB` added to that `run` string (scratch, only in this test): | | `python -B -m unittest discover -s scripts -p 'test_*.py'` | |---|---| | `9fa03d5` as is | 26 passed | | `9fa03d5` + the two lines | 26 passed | | `9fa03d5` merged with #2219, as is | 32 run, 1 failed (this test) | | `9fa03d5` merged with #2219, + the two lines | 32 passed | Windows 11 Pro 26300, Python 3.12. `--main-ref` shows in `--help` as described. **AI use:** Claude Code (Claude Opus 5.5) ran the checks and wrote this comment.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2646/head:github-bot/gh-2646'
git switch 'github-bot/gh-2646'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2646'
git switch 'github-bot/gh-2646'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2646'
git switch 'github-bot/gh-2646'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2646'
git switch 'main'
git merge --squash 'github-bot/gh-2646'
git switch 'main'
git merge --ff-only 'github-bot/gh-2646'
git switch 'main'
git merge 'github-bot/gh-2646'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.