Skip to content

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

Open
luckyteagirl wants to merge 1 commit into
xcl-dev:mainfrom
luckyteagirl:codex/pr-check-local-main-ref
Open

luckyteagirl wants to merge 1 commit into
xcl-dev:mainfrom
luckyteagirl:codex/pr-check-local-main-ref

Conversation

@luckyteagirl

@luckyteagirl luckyteagirl commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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 PR checks: the PR's smoke block must show how its run ended (#2213) #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
luckyteagirl marked this pull request as ready for review November 26, 2026 05:02
@fromthemoonx

fromthemoonx commented Nov 26, 2026 •

Copy link
Copy Markdown

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.

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)
@luckyteagirl
luckyteagirl force-pushed the codex/pr-check-local-main-ref branch from 9fa03d5 to 0076516 Compare November 26, 2026 05:20
@luckyteagirl

Copy link
Copy Markdown
Contributor Author

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.

@github-actions

Copy link
Copy Markdown

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.

@github-actions github-actions Bot added the stale No activity for 3 days; closed 4 days later unless something happens label Nov 30, 2026
@Foniass

Foniass commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale No activity for 3 days; closed 4 days later unless something happens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants