Explain when a red-green head is already in the base #3203

Manually merged
github merged 1 commit from github-bot/gh-3203 into gh-pr/3203/base 2026-12-03 16:34:31 +00:00 AGit
Owner

@⁠merzleckeier on GitHub · 2026-12-02 18:58 UTC · original
merzleckeier:fix/red-green-base-contains-head → main · +15 −3 · 2 files · 1 commits · merged 2026-12-03 16:17 UTC

Claimed in the coordination issue as TEST-RED-GREEN-BASE-CONTAINS-HEAD.

What and why

When the selected base already contains a PR head, scripts/red_green.py reports that the pull request changes no test. That message is misleading for a PR that added tests and has since been merged, as observed with #3148 and discussed in #3188. Compare the resolved head with the merge base to report the reason explicitly. The red not constructible verdict, exit status, and JSON shape stay the same.

Tested

  • A synthetic Git regression merges a branch that changed a test. It failed with the old reason and passed with this change. The existing unmerged branch with no test still reports its original reason.
  • python -I tests/test_red_green.py on Linux: 37 passed, one platform-specific skip.
  • On the same commit, all 38 tests passed under Wine 11.22 with Windows Python 3.12.10 and Git for Windows 2.56.1.windows.2.
  • Checked real head 1f158fe57 (#3148) with --no-cargo. With current main as base it reports that the head is already included. With the head’s first parent as the base it still selects tests/test_x64_recomp.py and reports red then green.
  • git diff --check and python -I scripts/check_no_game_data.py passed.

GPUs tested: n/a (synthetic Git fixtures and CPU-only checks).

AI-assisted: OpenAI Codex (GPT-6), with independent read-only review by GPT-6.2 Sol.

Checklist

  • Based on upstream main (b41763227).
  • One topic.
  • Synthetic fixtures only.
**@⁠merzleckeier** on GitHub · 2026-12-02 18:58 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3203) `merzleckeier:fix/red-green-base-contains-head` → `main` · +15 −3 · 2 files · 1 commits · merged 2026-12-03 16:17 UTC Claimed in the coordination issue as [TEST-RED-GREEN-BASE-CONTAINS-HEAD](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/2570). ### What and why When the selected base already contains a PR head, `scripts/red_green.py` reports that the pull request changes no test. That message is misleading for a PR that added tests and has since been merged, as observed with #3148 and discussed in #3188. Compare the resolved head with the merge base to report the reason explicitly. The `red not constructible` verdict, exit status, and JSON shape stay the same. ### Tested - A synthetic Git regression merges a branch that changed a test. It failed with the old reason and passed with this change. The existing unmerged branch with no test still reports its original reason. - `python -I tests/test_red_green.py` on Linux: 37 passed, one platform-specific skip. - On the same commit, all 38 tests passed under Wine 11.22 with Windows Python 3.12.10 and Git for Windows 2.56.1.windows.2. - Checked real head `1f158fe57` (#3148) with `--no-cargo`. With current `main` as base it reports that the head is already included. With the head’s first parent as the base it still selects `tests/test_x64_recomp.py` and reports `red then green`. - `git diff --check` and `python -I scripts/check_no_game_data.py` passed. GPUs tested: n/a (synthetic Git fixtures and CPU-only checks). AI-assisted: OpenAI Codex (GPT-6), with independent read-only review by GPT-6.2 Sol. ### Checklist - [x] Based on upstream `main` (`b41763227`). - [x] One topic. - [x] Synthetic fixtures only.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 19:27:36 +00:00
Author
Owner

@⁠fiestorra on GitHub · 2026-12-02 19:39 UTC · original

VERIFY-3203 — Windows nativo, independent of the author's Linux/Wine runs

Head d7deb51a2
Merge base b41763227 = current main (the PR sits exactly on today's main; git diff --stat merge-base..main over the two files is empty)

Ran (native Windows, Python 3.13, Git for Windows, worktree detached at the PR head)

python -I tests/test_red_green.py            Ran 38 tests in 92.4s — OK

Negative control (scripts/red_green.py reverted to main, new test kept)

python -I tests/test_red_green.py Sides.test_a_head_already_in_the_base_has_a_distinct_red_reason
FAILED (failures=1)
AssertionError: 'not constructible: the pull request changes no test'
             != 'not constructible: the head is already included in the base'

The real case the change is for — a head that main already contains (#3148, head 1f158fe57), both scripts on the same commit and base:

main's scripts/red_green.py  -> "red_why": "not constructible: the pull request changes no test"
this PR's red_green.py       -> "red_why": "not constructible: the head is already included in the base"

That is the artefact this closes: the misleading verdict I wrote into docs/testing.md in #3188 reads as if a merged pull request had no test. With this change the reason names the real one.

What I could not test

  • The --mutate path and the cargo sides: not exercised here; I ran only the Python/unittest side (--no-cargo --no-python for the two single-target runs above, the full file otherwise).
  • Platform-specific skip: the author reports one skip on Linux; on Windows the run had no skip and all 38 executed.

Verdict: red then green, and the real head the PR is about reports the new reason.

Written with an AI assistant.

**@⁠fiestorra** on GitHub · 2026-12-02 19:39 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3203#issuecomment-7356511252) ## VERIFY-3203 — Windows nativo, independent of the author's Linux/Wine runs | | | |---|---| | Head | `d7deb51a2` | | Merge base | `b41763227` = current `main` (the PR sits exactly on today's `main`; `git diff --stat merge-base..main` over the two files is empty) | **Ran (native Windows, Python 3.13, Git for Windows, worktree detached at the PR head)** ``` python -I tests/test_red_green.py Ran 38 tests in 92.4s — OK ``` **Negative control (`scripts/red_green.py` reverted to `main`, new test kept)** ``` python -I tests/test_red_green.py Sides.test_a_head_already_in_the_base_has_a_distinct_red_reason FAILED (failures=1) AssertionError: 'not constructible: the pull request changes no test' != 'not constructible: the head is already included in the base' ``` **The real case the change is for** — a head that `main` already contains (`#3148`, head `1f158fe57`), both scripts on the same commit and base: ``` main's scripts/red_green.py -> "red_why": "not constructible: the pull request changes no test" this PR's red_green.py -> "red_why": "not constructible: the head is already included in the base" ``` **That is the artefact this closes**: the misleading verdict I wrote into `docs/testing.md` in #3188 reads as if a merged pull request had no test. With this change the reason names the real one. ## What I could not test - **The `--mutate` path and the cargo sides**: not exercised here; I ran only the Python/unittest side (`--no-cargo --no-python` for the two single-target runs above, the full file otherwise). - **Platform-specific skip**: the author reports one skip on Linux; on Windows the run had no skip and all 38 executed. Verdict: **red then green**, and the real head the PR is about reports the new reason. Written with an AI assistant.
Author
Owner

@⁠merzleckeier on GitHub · 2026-12-02 20:27 UTC · original

Integration check for this head (d7deb51a) and #3181 (1c62cfc6), both on main b41763227. git merge-tree is clean. In the clean combined checkout, python3 -I tests/test_red_green.py completed all 41 cases on Linux (40 passed, one platform-only skip). Both changes to the checker have coverage in the combined suite. Synthetic Git fixtures only. AI-assisted.

**@⁠merzleckeier** on GitHub · 2026-12-02 20:27 UTC · [original](https://github.com/ProjectLeonida/mandy/pull/3203#issuecomment-7357775650) Integration check for this head (`d7deb51a`) and #3181 (`1c62cfc6`), both on `main` `b41763227`. `git merge-tree` is clean. In the clean combined checkout, `python3 -I tests/test_red_green.py` completed all 41 cases on Linux (40 passed, one platform-only skip). Both changes to the checker have coverage in the combined suite. Synthetic Git fixtures only. AI-assisted.
github-bot changed target branch from main to gh-pr/3203/base 2026-12-03 16:33:51 +00:00
github manually merged commit d7deb51a22 into gh-pr/3203/base 2026-12-03 16:34:31 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/ubiquitarianism--leonida!3203
No description provided.