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

Open
luckyteagirl wants to merge 1 commit from upstream-pr/2646 into main
luckyteagirl commented 2026-11-26 04:57:18 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T04:57:18Z.


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.
<!-- greyfinch-sync:ivall/xcl:issue:5504261622 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2646). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T04:57:18Z. --- 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 commented 2026-11-26 06:06:41 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T05:20:58Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7183406061 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2646#issuecomment-7183406061). Originally posted by [luckyteagirl](https://github.com/luckyteagirl) on 2026-11-26T05:20:58Z. --- 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.
fromthemoonx commented 2026-11-26 06:06:51 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by fromthemoonx on 2026-11-26T05:05:49Z.


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.

<!-- greyfinch-sync:ivall/xcl:comment:7183176445 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2646#issuecomment-7183176445). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-11-26T05:05:49Z. --- **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.
github-actions[bot] commented 2026-11-30 08:43:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-30T08:43:00Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7273253865 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2646#issuecomment-7273253865). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-30T08:43:00Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 08:33:34 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:33:34Z.


Triage (#1607) – head 0076516

No open or merged PR makes the same change. #2406 removes is_main_ancestor (replacing it with a --base check), so the two conflict; whichever lands second needs reworking.
No problems found in the diff: --main-ref defaults to origin/main, is only used with --local, and the test shows the default and the override giving different results.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7305477511 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2646#issuecomment-7305477511). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:33:34Z. --- **Triage (#1607)** – head 0076516 No open or merged PR makes the same change. #2406 removes `is_main_ancestor` (replacing it with a `--base` check), so the two conflict; whichever lands second needs reworking. No problems found in the diff: `--main-ref` defaults to `origin/main`, is only used with `--local`, and the test shows the default and the override giving different results. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Decodere commented 2026-12-02 09:05:00 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T09:05:00Z.


merge-check
base: 1c8b551475
head: 0076516606
merge: clean (git merge --no-edit onto 1c8b5514, git diff --check clean; scripts/pr_check.py and scripts/test_pr_check.py, +39/-1)
build: not run (Tier 0 Python script diff; no Rust code changed)
tests: python -m unittest discover -s scripts -p "test_pr_check.py" -v -> 14 passed, 0 failed (base 1c8b5514: 13 passed; new test_local_check_uses_requested_main_ref passed); python -m unittest discover -s scripts -p "test_*.py" -> 66 passed, 1 error (test_discord_mirror.py missing %ComSpec%/%SystemRoot% on Windows, same failure on base 1c8b5514). Rust workspace tests not run (Tier 0).
review: Read the full diff (+39/-1). Adds optional --main-ref (default "origin/main", scripts/pr_check.py:174) and passes o.main_ref to git merge-base --is-ancestor in --local mode (scripts/pr_check.py:194), leaving CI and default --local behavior unchanged. The new test builds a temporary git repo with distinct origin/main and upstream/main refs and proves the default fails while --main-ref upstream/main passes. No problems found.
performance: none (CLI check script in scripts/; zero runtime impact)
verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)

<!-- greyfinch-sync:ivall/xcl:comment:7340349167 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2646#issuecomment-7340349167). Originally posted by [Decodere](https://github.com/Decodere) on 2026-12-02T09:05:00Z. --- merge-check base: 1c8b551475e1e7bfe48f94448492a4c3544a2e0f head: 0076516606324eb898d50f29cc7b5f1a06bd4450 merge: clean (`git merge --no-edit` onto `1c8b5514`, `git diff --check` clean; `scripts/pr_check.py` and `scripts/test_pr_check.py`, +39/-1) build: not run (Tier 0 Python script diff; no Rust code changed) tests: `python -m unittest discover -s scripts -p "test_pr_check.py" -v` -> 14 passed, 0 failed (base `1c8b5514`: 13 passed; new `test_local_check_uses_requested_main_ref` passed); `python -m unittest discover -s scripts -p "test_*.py"` -> 66 passed, 1 error (`test_discord_mirror.py` missing `%ComSpec%`/`%SystemRoot%` on Windows, same failure on base `1c8b5514`). Rust workspace tests not run (Tier 0). review: Read the full diff (+39/-1). Adds optional `--main-ref` (default `"origin/main"`, `scripts/pr_check.py:174`) and passes `o.main_ref` to `git merge-base --is-ancestor` in `--local` mode (`scripts/pr_check.py:194`), leaving CI and default `--local` behavior unchanged. The new test builds a temporary git repo with distinct `origin/main` and `upstream/main` refs and proves the default fails while `--main-ref upstream/main` passes. No problems found. performance: none (CLI check script in `scripts/`; zero runtime impact) verdict: safe to merge hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2646:upstream-pr/2646'
git switch 'upstream-pr/2646'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2646'
git switch 'upstream-pr/2646'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2646'
git switch 'upstream-pr/2646'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2646'
git switch 'main'
git merge --squash 'upstream-pr/2646'
git switch 'main'
git merge --ff-only 'upstream-pr/2646'
git switch 'main'
git merge 'upstream-pr/2646'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!2636
No description provided.