fix(forge): pr status doesn't tell a work-in-progress PR to rebase #132

Merged
HumanBean merged 1 commit from HumanBean/Longshot:fix/status-wip-mergeable into main 2026-11-13 05:56:37 +00:00
Owner

Why

forge.py pr status told every work-in-progress PR "Mergeable: no (rebase onto main)", because Forgejo answers mergeable: false for any WIP PR, whatever its base. That sent people and agents rebasing PRs that were already on main's head (#121 was one).

What changed

  • forge: mergeable_note() in scripts/forge.py, used by cmd_pr_status(). A ready PR keeps "yes" or "no (rebase onto main)". A WIP PR now gets "not while it is work in progress (Forgejo merges no WIP PR)", plus whether its merge base is main's head (from GET /branches/main): "no rebase needed", "main has moved past its base: rebase if it conflicts", or, when either can't be read, "whether it needs a rebase shows once it is ready".
  • tests: tests/test_forge_pr.py's stand-in Forgejo answers /branches/main; a new test_status_mergeable_of_a_wip_pr covers the four cases.

Flags and settings

None.

Measurements

main: 341d63a4 (2026-11-13)
this PR: fix/status-wip-mergeable @ 9d0d744f
Hardware: Linux (CachyOS), Python 3; no GPU involved
Scene: none: a command-line tool, nothing in the game
Method: tests/test_forge_pr.py offline; pr status against the live forge on #107 (WIP) and #108 (ready); python -I -B tests/run_all.py
How to reproduce: python -I scripts/forge.py pr status 107

main @ 341d63a4 this PR @ 9d0d744f
pr status 107 (WIP, main past its base) Mergeable: no (rebase onto main) Mergeable: not while it is work in progress (Forgejo merges no WIP PR); main has moved past its base: rebase if it conflicts
pr status 108 (ready, mergeable) Mergeable: yes Mergeable: yes
tests/test_forge_pr.py 24 tests pass 25 tests pass
$ python -I -B tests/test_forge_pr.py
Ran 25 tests in 0.187s
OK
$ python -I -B tests/run_all.py
460 passed, 7 failed, 69 skipped in 72 s (linux, 24 at once)

Testing

Tested:

  • tests/test_forge_pr.py on Linux: 25 of 25 pass.
  • pr status on the live forge: #107 (WIP) and #108 (ready), as in the table.
  • python -I -B tests/run_all.py on Linux: 460 passed, 7 failed, 69 skipped. The 7 fail on main on this PC too (its environment): test_bake_portability, test_builder_log_read_only, test_program_cache_cleanup, test_control, test_longshot_ctl, test_program_cache_one_variant, test_vram_budget_row.

Not tested:

  • Windows: the change is standard library Python with no file or console handling of its own.

Needs other testers:
None

Screenshots

Nothing on screen.

Risk and rollback

Only the Mergeable line of pr status changes, and it costs one more API call for a WIP PR. Reverting the commit restores it.

Issues

See #121

Checklist

For everyone

  • One topic.
  • The title is a Conventional Commit (type(scope): description).
  • Rebased on current main.
  • python -I -B tests/run_all.py run and passing (any failure that also fails on main is named above).
  • Tested in the game, or what wasn't is named under Testing.
  • Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests).
  • Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported.
  • No game files, dumps, build output or generated files.
  • third_party/ untouched (a new folder with a PROVENANCE.md instead).
  • The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled.

If applicable

  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.
  • A check under tests/ that reads changed source updated in this PR, not weakened.

🤖 Generated with Claude Code

## Why `forge.py pr status` told every work-in-progress PR "Mergeable: no (rebase onto main)", because Forgejo answers `mergeable: false` for any WIP PR, whatever its base. That sent people and agents rebasing PRs that were already on main's head (#121 was one). ## What changed - forge: `mergeable_note()` in `scripts/forge.py`, used by `cmd_pr_status()`. A ready PR keeps "yes" or "no (rebase onto main)". A WIP PR now gets "not while it is work in progress (Forgejo merges no WIP PR)", plus whether its merge base is main's head (from `GET /branches/main`): "no rebase needed", "main has moved past its base: rebase if it conflicts", or, when either can't be read, "whether it needs a rebase shows once it is ready". - tests: `tests/test_forge_pr.py`'s stand-in Forgejo answers `/branches/main`; a new `test_status_mergeable_of_a_wip_pr` covers the four cases. ## Flags and settings None. ## Measurements main: 341d63a4 (2026-11-13) this PR: fix/status-wip-mergeable @ 9d0d744f Hardware: Linux (CachyOS), Python 3; no GPU involved Scene: none: a command-line tool, nothing in the game Method: `tests/test_forge_pr.py` offline; `pr status` against the live forge on #107 (WIP) and #108 (ready); `python -I -B tests/run_all.py` How to reproduce: `python -I scripts/forge.py pr status 107` | | main @ 341d63a4 | this PR @ 9d0d744f | |---|---|---| | `pr status 107` (WIP, main past its base) | Mergeable: no (rebase onto main) | Mergeable: not while it is work in progress (Forgejo merges no WIP PR); main has moved past its base: rebase if it conflicts | | `pr status 108` (ready, mergeable) | Mergeable: yes | Mergeable: yes | | `tests/test_forge_pr.py` | 24 tests pass | 25 tests pass | ``` $ python -I -B tests/test_forge_pr.py Ran 25 tests in 0.187s OK $ python -I -B tests/run_all.py 460 passed, 7 failed, 69 skipped in 72 s (linux, 24 at once) ``` ## Testing **Tested:** - `tests/test_forge_pr.py` on Linux: 25 of 25 pass. - `pr status` on the live forge: #107 (WIP) and #108 (ready), as in the table. - `python -I -B tests/run_all.py` on Linux: 460 passed, 7 failed, 69 skipped. The 7 fail on `main` on this PC too (its environment): `test_bake_portability`, `test_builder_log_read_only`, `test_program_cache_cleanup`, `test_control`, `test_longshot_ctl`, `test_program_cache_one_variant`, `test_vram_budget_row`. **Not tested:** - Windows: the change is standard library Python with no file or console handling of its own. **Needs other testers:** None ## Screenshots Nothing on screen. ## Risk and rollback Only the Mergeable line of `pr status` changes, and it costs one more API call for a WIP PR. Reverting the commit restores it. ## Issues See #121 ## Checklist ### For everyone - [x] One topic. - [x] The title is a Conventional Commit (`type(scope): description`). - [x] Rebased on current `main`. - [x] `python -I -B tests/run_all.py` run and passing (any failure that also fails on `main` is named above). - [x] Tested in the game, or what wasn't is named under Testing. - [x] Testing filled in: what was tested, what wasn't, and what needs other testers (with test requests). - [x] Measured: main and this PR at named commits, on the same PC, scene and settings, at least 2 interleaved runs each, the median reported. - [x] No game files, dumps, build output or generated files. - [x] `third_party/` untouched (a new folder with a `PROVENANCE.md` instead). - [x] The license is OK: GPL-3.0-or-later, nothing incompatible and nothing decompiled. ### If applicable - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. - [x] A check under `tests/` that reads changed source updated in this PR, not weakened. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(forge): pr status doesn't tell a work-in-progress PR to rebase
Some checks failed
CI / Python source checks (ubuntu-24.04, part 1/2) (pull_request) Has been skipped
CI / Python source checks (ubuntu-24.04, part 2/2) (pull_request) Has been skipped
CI / SPIR-V fixtures (global narrow load/store, direct surface atomics, F2I immediate) (pull_request) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
PR description / Description follows the template (pull_request_target) Successful in 3s
CI / Workflow lint (actionlint) (pull_request) Failing after 4s
Third-party parts / As their notes say (pull_request) Successful in 4s
9d0d744f44
Forgejo answers mergeable: false for every WIP PR, so pr status said
"no (rebase onto main)" for all of them. For a WIP PR it now says it isn't
mergeable while WIP and whether main has moved past its merge base (main's
head from the branches API); a ready PR keeps the rebase hint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HumanBean deleted branch fix/status-wip-mergeable 2026-11-13 05:56:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
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
MagicBeanDev/Longshot!132
No description provided.