pr_conflict_label: read the open pull requests 100 per request (TOOLS-PR-CONFLICT-LABEL-RATE-LIMIT) #3116

Merged
lorentsob merged 1 commit from upstream-pr/3116 into main 2026-12-02 21:29:55 +00:00
lorentsob commented 2026-12-02 11:43:09 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by lorentsob on 2026-12-02T11:43:09Z.


Claimed in the coordination issue as: TOOLS-PR-CONFLICT-LABEL-RATE-LIMIT (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7344305222)

What and why

tools/pr_conflict_label.py asks for every open pull request by number, once per attempt. The workflow's token gets
1,000 requests an hour for the whole repository, so with many hundreds open a run spends them all, stops before the
last pull requests and leaves none for the other workflows that hour:

ApiError: HTTP 403: { "message": "API rate limit exceeded for installation. ...

That is how Needs rebase label failed on main from 27 November to 1 December: run 45977772822 (about 1,500 open),
46273987960, 46274246229 and 46275295800 (about 700 open), 46608955886 and, last, 46666290577 on 1 December at
14:20 UTC (about 700 open). It has been green since the closures of 1 December brought the open count to about 210,
but each run still costs one request per open pull request, and the count only has to climb back for it to fail
again. Labels then go stale: a pull request that conflicts is not labeled and one that was rebased keeps
needs rebase.

A run over every open pull request now reads them 100 per request through the GraphQL API (number, mergeable,
labels): 3 requests per attempt for today's 210 open, 7 for 700, instead of one per pull request. What it decides and
writes is unchanged, and --pr N still asks for each number as before. A pull request closed between two attempts
is skipped. Since a listing is cheap, its attempts are 60 seconds apart instead of 10 (LIST_WAIT): a pass of one
request per pull request took about 3.5 minutes for 208 open, and that was the time GitHub had to compute the merges
a push to main reset; the three waits keep about as much.

This complements #3099 (CI-LABEL-HOURLY), which keeps the workflow to its hourly run: that one cuts the number of
runs, this one the cost of each run. They change different files.

Tested

  • python -I tests/test_pr_conflict_label.py on main 40ac04183: 17 of 17 pass (the run over 1,500 also checks
    the three waits are LIST_WAIT). The same tests against main's
    tools/pr_conflict_label.py: 4 errors, one of them the HTTP 403 above (a fake API that allows 1,000 requests for
    1,500 pull requests).
  • The query, read-only against this repository with a personal token on 2 December: 210 open pull requests in 3
    pages, cost 1 point per page; 57 CONFLICTING, 0 UNKNOWN, and the same 57 labeled needs rebase, which is what
    the current run left.
  • Not run: the workflow itself with an Actions token, which I cannot do from a fork. The first run on main after
    the merge is the real check.
  • Not proven: that a GraphQL listing starts GitHub's background merge computation the way GET /pulls/N is
    documented to. Today's listing found no UNKNOWN to watch, and main did not move while I could look. If it does
    not, a pull request a push left UNKNOWN keeps its label as it is until a later run finds it computed (the run
    never guesses); --pr N still asks the REST way.
  • Not the same change as the LABEL-JOB-RETRY claim in the coordination issue (retry of dropped connections and 5xx in
    github_api): that one retries a failed call, this one makes far fewer calls and does not touch github_api.
  • python -I scripts/check_no_game_data.py on the two changed files: clean.

Tested on macOS (Apple M5 Max). GPUs tested: n/a

AI-assisted: yes (Claude Fable 5.2 wrote the first version, Claude Opus 5.5 the rebase and the changes after review;
a separate read-only reviewer agent on Claude Fable 5.2 audited the diff twice. From its first pass: the listing's
wait between attempts, the docstring's account of the 403 and two comments were fixed; it found no blocker.)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)
<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5605692066 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3116). Originally posted by [lorentsob](https://github.com/lorentsob) on 2026-12-02T11:43:09Z. --- Claimed in the coordination issue as: TOOLS-PR-CONFLICT-LABEL-RATE-LIMIT (https://github.com/ProjectLeonida/mandy/issues/2570#issuecomment-7344305222) ### What and why `tools/pr_conflict_label.py` asks for every open pull request by number, once per attempt. The workflow's token gets 1,000 requests an hour for the whole repository, so with many hundreds open a run spends them all, stops before the last pull requests and leaves none for the other workflows that hour: ``` ApiError: HTTP 403: { "message": "API rate limit exceeded for installation. ... ``` That is how `Needs rebase label` failed on `main` from 27 November to 1 December: run 45977772822 (about 1,500 open), 46273987960, 46274246229 and 46275295800 (about 700 open), 46608955886 and, last, 46666290577 on 1 December at 14:20 UTC (about 700 open). It has been green since the closures of 1 December brought the open count to about 210, but each run still costs one request per open pull request, and the count only has to climb back for it to fail again. Labels then go stale: a pull request that conflicts is not labeled and one that was rebased keeps `needs rebase`. A run over every open pull request now reads them 100 per request through the GraphQL API (number, `mergeable`, labels): 3 requests per attempt for today's 210 open, 7 for 700, instead of one per pull request. What it decides and writes is unchanged, and `--pr N` still asks for each number as before. A pull request closed between two attempts is skipped. Since a listing is cheap, its attempts are 60 seconds apart instead of 10 (`LIST_WAIT`): a pass of one request per pull request took about 3.5 minutes for 208 open, and that was the time GitHub had to compute the merges a push to `main` reset; the three waits keep about as much. This complements #3099 (CI-LABEL-HOURLY), which keeps the workflow to its hourly run: that one cuts the number of runs, this one the cost of each run. They change different files. ### Tested - `python -I tests/test_pr_conflict_label.py` on `main` `40ac04183`: 17 of 17 pass (the run over 1,500 also checks the three waits are `LIST_WAIT`). The same tests against `main`'s `tools/pr_conflict_label.py`: 4 errors, one of them the HTTP 403 above (a fake API that allows 1,000 requests for 1,500 pull requests). - The query, read-only against this repository with a personal token on 2 December: 210 open pull requests in 3 pages, cost 1 point per page; 57 `CONFLICTING`, 0 `UNKNOWN`, and the same 57 labeled `needs rebase`, which is what the current run left. - Not run: the workflow itself with an Actions token, which I cannot do from a fork. The first run on `main` after the merge is the real check. - Not proven: that a GraphQL listing starts GitHub's background merge computation the way `GET /pulls/N` is documented to. Today's listing found no `UNKNOWN` to watch, and `main` did not move while I could look. If it does not, a pull request a push left `UNKNOWN` keeps its label as it is until a later run finds it computed (the run never guesses); `--pr N` still asks the REST way. - Not the same change as the LABEL-JOB-RETRY claim in the coordination issue (retry of dropped connections and 5xx in `github_api`): that one retries a failed call, this one makes far fewer calls and does not touch `github_api`. - `python -I scripts/check_no_game_data.py` on the two changed files: clean. Tested on macOS (Apple M5 Max). GPUs tested: n/a AI-assisted: yes (Claude Fable 5.2 wrote the first version, Claude Opus 5.5 the rebase and the changes after review; a separate read-only reviewer agent on Claude Fable 5.2 audited the diff twice. From its first pass: the listing's wait between attempts, the docstring's account of the 403 and two comments were fixed; it found no blocker.) ### Checklist - [x] Based on current `main` and merges cleanly (a conflicting pull request is labeled `needs rebase`). - [x] One topic; follow-up work goes in a new pull request. - [x] No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here. - [ ] A new translator rule is in the contract table of `docs/design.md`, with how it was confirmed. (n/a)
Kal0s-design commented 2026-12-02 12:43:00 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by Kal0s-design on 2026-12-02T12:43:00Z.


Ran natively on Windows 11, Python 3.13, head 10fcd88fb merged into current main. tests/test_pr_conflict_label.py passes.

I also ran open_pulls() live against this repository, read-only. It used a personal token with no write scope, and a wrapper refused any method other than GET or the /graphql POST, so nothing was labeled. The point was to check that the GraphQL listing gets mergeable resolved: with REST, the per-PR GET is what starts GitHub's background merge check.

  • Cost: 161 or 162 open pull requests took 2 GraphQL requests per listing.
  • After a push to main: a push landed between my first two listings 60 s apart. The second listing showed 118 UNKNOWN, 42 MERGEABLE and 1 CONFLICTING.
  • Listings only, every 30 s, no REST calls in between:
t ok conflict unknown
2 s 151 7 3
34 s and every 30 s up to 227 s 154 7 0

So with only GraphQL listings, the UNKNOWNs cleared within the default 4 attempts × LIST_WAIT (60 s).

  • Caveat: I can't tell whether my listing started the merge checks or whether something else did, such as another workflow's REST read or GitHub's own queue. In the second run, the 3 left at the first listing had cleared by the next one 30 s later.

Not checked: a real labeling run with the workflow's token.

GPUs tested: n/a (CPU and network only).

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7345764525 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3116#issuecomment-7345764525). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-12-02T12:43:00Z. --- Ran natively on Windows 11, Python 3.13, head `10fcd88fb` merged into current `main`. `tests/test_pr_conflict_label.py` passes. I also ran `open_pulls()` live against this repository, read-only. It used a personal token with no write scope, and a wrapper refused any method other than GET or the `/graphql` POST, so nothing was labeled. The point was to check that the GraphQL listing gets `mergeable` resolved: with REST, the per-PR `GET` is what starts GitHub's background merge check. - **Cost:** 161 or 162 open pull requests took 2 GraphQL requests per listing. - **After a push to `main`:** a push landed between my first two listings 60 s apart. The second listing showed 118 `UNKNOWN`, 42 `MERGEABLE` and 1 `CONFLICTING`. - **Listings only, every 30 s, no REST calls in between:** | t | ok | conflict | unknown | |---|---|---|---| | 2 s | 151 | 7 | 3 | | 34 s and every 30 s up to 227 s | 154 | 7 | 0 | So with only GraphQL listings, the `UNKNOWN`s cleared within the default 4 attempts × `LIST_WAIT` (60 s). - **Caveat:** I can't tell whether my listing started the merge checks or whether something else did, such as another workflow's REST read or GitHub's own queue. In the second run, the 3 left at the first listing had cleared by the next one 30 s later. Not checked: a real labeling run with the workflow's token. GPUs tested: n/a (CPU and network only). AI-assisted: yes (Claude Code).
merzleckeier commented 2026-12-02 13:31:26 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-02T13:31:26Z.

Review: COMMENTED


Independent Linux review on main 01eca4b71 + head 10fcd88fb, with Python 3.14.10 and the repository’s offline fake API. All 17 tests passed. The same test suite against main’s implementation reproduced the simulated API-limit failure in the 1,500-PR case. The merge remains clean on 128648cfe, which leaves the tool, tests, and workflow identical. The paginated run also passed the closed-between-polls and single-PR REST cases. No Actions token or live writes were used in the test. CPU only. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:review:6151741250 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3116#pullrequestreview-6151741250). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-02T13:31:26Z. **Review:** COMMENTED --- Independent Linux review on main `01eca4b71` + head `10fcd88fb`, with Python 3.14.10 and the repository’s offline fake API. All 17 tests passed. The same test suite against main’s implementation reproduced the simulated API-limit failure in the 1,500-PR case. The merge remains clean on `128648cfe`, which leaves the tool, tests, and workflow identical. The paginated run also passed the closed-between-polls and single-PR REST cases. No Actions token or live writes were used in the test. CPU only. AI-assisted with OpenAI Codex.
aegish-zagi commented 2026-12-02 14:35:03 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by aegish-zagi on 2026-12-02T14:35:03Z.


Verification — VERIFY-3116

PR #3116 — pr_conflict_label: read the open pull requests 100 per request (TOOLS-PR-CONFLICT-LABEL-RATE-LIMIT)
Head 10fcd88fb3; MERGEABLE against current main (69cd4106c) — red_green merged it with main in its scratch worktree
Tests run python -I scripts/red_green.py 3116 --remote upstream --no-cargo (runs the PR's tests on main = red, and on PR+main = green); plus tests/test_pr_conflict_label.py standalone on main beforehand
Red on main 4 tests fail/error on main: AllOpenTest.test_1500_open_pull_requests_stay_under_the_token_limit, AllOpenTest.test_a_pull_request_closed_between_two_listings_is_skipped, RunTest.test_a_graphql_error_is_not_read_as_no_pull_requests, RunTest.test_open_pulls_follows_pages
Green on PR All 17 tests in tests/test_pr_conflict_label.py pass; 13 pass on both sides; 0 regressions, 0 fail-on-both
Diff audit tools/pr_conflict_label.py switches the all-open listing to one GraphQL query per 100 PRs (number, mergeable, labels in one call) and raises ApiError on a GraphQL error payload instead of reading it as an empty list. Tests use a fake API that enforces a request limit and asserts the query shape. One topic, claim in place, no game data
Verdict PASS — red on main, green on the PR, no regressions found
Platform Linux, Python 3.12.3, no GPU (Profile Z)

AI-assisted: yes (Muse Wonder, Muse by Meta)

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7348792806 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3116#issuecomment-7348792806). Originally posted by [aegish-zagi](https://github.com/aegish-zagi) on 2026-12-02T14:35:03Z. --- Verification — VERIFY-3116 | | | |---|---| | PR | #3116 — pr_conflict_label: read the open pull requests 100 per request (TOOLS-PR-CONFLICT-LABEL-RATE-LIMIT) | | Head | 10fcd88fb3222dbbd82a5a6f1eb682ff4e04ecd5; MERGEABLE against current main (69cd4106c) — red_green merged it with main in its scratch worktree | | Tests run | `python -I scripts/red_green.py 3116 --remote upstream --no-cargo` (runs the PR's tests on main = red, and on PR+main = green); plus `tests/test_pr_conflict_label.py` standalone on main beforehand | | Red on main | 4 tests fail/error on main: AllOpenTest.test_1500_open_pull_requests_stay_under_the_token_limit, AllOpenTest.test_a_pull_request_closed_between_two_listings_is_skipped, RunTest.test_a_graphql_error_is_not_read_as_no_pull_requests, RunTest.test_open_pulls_follows_pages | | Green on PR | All 17 tests in tests/test_pr_conflict_label.py pass; 13 pass on both sides; 0 regressions, 0 fail-on-both | | Diff audit | tools/pr_conflict_label.py switches the all-open listing to one GraphQL query per 100 PRs (number, mergeable, labels in one call) and raises ApiError on a GraphQL error payload instead of reading it as an empty list. Tests use a fake API that enforces a request limit and asserts the query shape. One topic, claim in place, no game data | | Verdict | **PASS** — red on main, green on the PR, no regressions found | | Platform | Linux, Python 3.12.3, no GPU (Profile Z) | AI-assisted: yes (Muse Wonder, Muse by Meta)
MoonEyes commented 2026-12-02 18:11:54 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T18:11:54Z.


Verified #3116 on Linux: 17/17 pass merged onto current main; with main's tool the new tests are red, including the HTTP 403 rate-limit case.

Head 10fcd88fb3 (same head as the earlier checks by Kal0s-design and aegish-zagi)
Merged onto main 45dc41f95c (git merge --no-ff, clean; merge base 40ac041833, 136 commits behind)
Machine Linux, Python 3.13.18, no network calls, no game files

Ran

python -I tests/test_pr_conflict_label.py                         Ran 17 tests  OK
python -I scripts/check_no_game_data.py tools/pr_conflict_label.py tests/test_pr_conflict_label.py   exit 0

Red/green (reverted only tools/pr_conflict_label.py to main, kept the new tests):

Ran 17 tests  FAILED (errors=4)
  test_1500_open_pull_requests_stay_under_the_token_limit   pr_conflict_label.ApiError: HTTP 403: API rate limit exceeded
  test_open_pulls_follows_pages / ..._graphql_error_... / ..._closed_between_two_listings_...   no attribute 'open_pulls'

The 1,500-PR case is the one that matters: the fake API allows 1,000 requests and main's per-PR GET loop hits the 403 the description quotes from the Needs rebase label runs.

Review

  • open_pulls raises on a GraphQL errors body or a null repository instead of reading it as "no open pull requests", and a test covers it. Good: an empty answer would otherwise unlabel nothing silently but also label nothing.
  • --pr N keeps the old one-GET-per-number path (test_one_named_pull_request_is_one_request).
  • A PR closed between two listings is skipped (elif number in pulls ... else: continue), tested.
  • Not verified here (no live token used): whether a GraphQL read of mergeable starts GitHub's background merge computation the way the REST GET does. The description reports 0 UNKNOWN of 210 on a live read and the three LIST_WAIT (60 s) waits keep the old time budget, so at worst some answers stay UNKNOWN until the next hourly run, which the tool already handles by leaving the label alone.
  • Nit: ApiError(200, ...) for a GraphQL error is accurate but reads oddly in a log; harmless.

Verdict: ready. No defects. Claim TOOLS-PR-CONFLICT-LABEL-RATE-LIMIT, AI disclosure and tests present. No check runs are recorded on the head yet (mergeable_state: blocked), so CI still has to run.

AI-assisted: Claude Opus 5.5 (Claude Code), verification only.

AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.


Generated by Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7354103629 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3116#issuecomment-7354103629). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T18:11:54Z. --- **Verified #3116 on Linux: 17/17 pass merged onto current `main`; with `main`'s tool the new tests are red, including the HTTP 403 rate-limit case.** | | | |---|---| | Head | `10fcd88fb3` (same head as the earlier checks by Kal0s-design and aegish-zagi) | | Merged onto | `main` `45dc41f95c` (`git merge --no-ff`, clean; merge base `40ac041833`, 136 commits behind) | | Machine | Linux, Python 3.13.18, no network calls, no game files | **Ran** ``` python -I tests/test_pr_conflict_label.py Ran 17 tests OK python -I scripts/check_no_game_data.py tools/pr_conflict_label.py tests/test_pr_conflict_label.py exit 0 ``` **Red/green (reverted only `tools/pr_conflict_label.py` to `main`, kept the new tests):** ``` Ran 17 tests FAILED (errors=4) test_1500_open_pull_requests_stay_under_the_token_limit pr_conflict_label.ApiError: HTTP 403: API rate limit exceeded test_open_pulls_follows_pages / ..._graphql_error_... / ..._closed_between_two_listings_... no attribute 'open_pulls' ``` The 1,500-PR case is the one that matters: the fake API allows 1,000 requests and `main`'s per-PR GET loop hits the 403 the description quotes from the `Needs rebase label` runs. **Review** - `open_pulls` raises on a GraphQL `errors` body or a null `repository` instead of reading it as "no open pull requests", and a test covers it. Good: an empty answer would otherwise unlabel nothing silently but also label nothing. - `--pr N` keeps the old one-GET-per-number path (`test_one_named_pull_request_is_one_request`). - A PR closed between two listings is skipped (`elif number in pulls ... else: continue`), tested. - Not verified here (no live token used): whether a GraphQL read of `mergeable` starts GitHub's background merge computation the way the REST GET does. The description reports 0 `UNKNOWN` of 210 on a live read and the three `LIST_WAIT` (60 s) waits keep the old time budget, so at worst some answers stay `UNKNOWN` until the next hourly run, which the tool already handles by leaving the label alone. - Nit: `ApiError(200, ...)` for a GraphQL error is accurate but reads oddly in a log; harmless. **Verdict: ready.** No defects. Claim `TOOLS-PR-CONFLICT-LABEL-RATE-LIMIT`, AI disclosure and tests present. No check runs are recorded on the head yet (`mergeable_state: blocked`), so CI still has to run. AI-assisted: Claude Opus 5.5 (Claude Code), verification only. AI-assisted verification: Claude Opus (Claude Code), separate agent per batch. --- _Generated by [Claude Code](https://claude.ai/code)_
MoonEyes commented 2026-12-02 20:31:48 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-02T20:31:48Z.


RUN (independent run on Windows, head 10fcd88fb3222dbbd82a5a6f1eb682ff4e04ecd5, merged into main b41763227aeed2d23c98af84bcbc1bddc7acdc90 with git merge --no-ff)

Python 3.14.0, standard library only, no cargo, no game data, nothing written to GitHub. Merge commit 8111dc017, clean, in a throwaway worktree. The PR head is unchanged since the earlier comments (read with git ls-remote).

Green

  • python -I tests/test_pr_conflict_label.py on the merge: 17 of 17 pass.
  • python -I scripts/check_no_game_data.py tools/pr_conflict_label.py tests/test_pr_conflict_label.py: clean (rc 0).
  • The merge changes exactly two files against main: tools/pr_conflict_label.py and tests/test_pr_conflict_label.py.

Red

  • With tools/pr_conflict_label.py swapped back to main's version (restored afterwards), 4 of 17 error:
    test_1500_open_pull_requests_stay_under_the_token_limit, test_a_pull_request_closed_between_two_listings_is_skipped,
    test_a_graphql_error_is_not_read_as_no_pull_requests, test_open_pulls_follows_pages. The other 13 pass on both sides.
  • Mutations of the PR's tool, each run against the 17 tests:
    • Killed: paging stopped after the first page (2 fail); no re-listing between attempts (2); label test inverted (2); a closed PR treated as conflicting (1); a closed PR treated as unknown instead of skipped (1).
    • Survived: LIST_WAIT 60 -> 10 (the test compares the waits to the LIST_WAIT constant itself, so it cannot see the value change). Dropping answer.get("errors") or from the error check (a payload with no data still raises; a response with both errors and partial data would be read as valid). Page size first: 100 -> first: 50 (only the cost per run changes, no test counts requests of a 100-page).
    • A first mutation of the closed-PR branch (treated as mergeable and unlabeled) also survived, but it is equivalent: decide returns nothing for that pair, so it is not a real gap.

Review

  • Claim: TOOLS-PR-CONFLICT-LABEL-RATE-LIMIT, claimed in issues/2570 (link in the PR body). It matches the diff: all-open runs use GraphQL 100 per request, --pr N still uses one REST GET per number, decisions go through decide() unchanged.
  • Logic checks out: unknown PRs are listed again after wait, a closed PR is skipped, a GraphQL error raises ApiError instead of reading as an empty list, main passes sorted(pulls).
  • References to the tool in the repository: .github/workflows/conflict-label.yml, CONTRIBUTING.md, docs/i18n/fr/contributing.md, plus the tool and its test. The diff touches only the tool and its test, so the workflow and both docs are unchanged.
  • Minor: labels(first: 100) would miss needs rebase on a PR with more than 100 labels (not realistic).
  • Earlier checks on the PR, as posted, in order:
    • Kal0s-design (comment, Windows): tests/test_pr_conflict_label.py passes on head merged into main; no red run reported. Also a live read-only listing of about 161 open PRs, 2 GraphQL requests per listing, UNKNOWN cleared within 4 x 60 s; says it cannot tell what started the merge checks; no real labeling run.
    • merzleckeier (review, COMMENTED, Linux, Python 3.14.10): 17 tests pass; against main's implementation only the simulated API-limit failure of the 1,500-PR case is reported; clean merge; no token, no live writes.
    • aegish-zagi (comment, Linux, via scripts/red_green.py): 17 pass on the PR, 4 fail on main, the same four tests listed above, 0 regressions.
    • MoonEyes (comment, Linux): 17 pass merged onto main 45dc41f95c; main's tool errors 4 (the 1,500-PR case as HTTP 403, the others missing open_pulls); head unchanged. That is three comments and one review.
  • No reviewer question is open. No change requests.
  • Open uncertainty stated by the author and by Kal0s-design: whether a GraphQL listing starts GitHub's merge computation. If it does not, those PRs keep their label until the next hourly run, which is safe.
  • CI: the head has no check runs and no commit statuses (check-runs total 0, combined status pending with 0 entries). GitHub Actions is having an incident today, so I cannot say whether CI would be green or red; I do not guess.

Not covered

  • The workflow with an Actions token, a real labeling run, the live GitHub API (not touched from here).
  • The real value of LIST_WAIT and partial GraphQL errors (see surviving mutations).

Verdict

PASS. 17/17 green on the merge into current main, 4 tests red on main's tool, claim in place, no CI result available. Three weak spots in test strength (LIST_WAIT, partial errors with data, page size), not blockers.

AI-assisted (Claude Code), models: Claude Opus 5.5 (checker), separate Claude Opus 5.5 judge.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7357881982 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3116#issuecomment-7357881982). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-02T20:31:48Z. --- RUN (independent run on Windows, head `10fcd88fb3222dbbd82a5a6f1eb682ff4e04ecd5`, merged into `main` `b41763227aeed2d23c98af84bcbc1bddc7acdc90` with `git merge --no-ff`) Python 3.14.0, standard library only, no cargo, no game data, nothing written to GitHub. Merge commit `8111dc017`, clean, in a throwaway worktree. The PR head is unchanged since the earlier comments (read with `git ls-remote`). ### Green - `python -I tests/test_pr_conflict_label.py` on the merge: 17 of 17 pass. - `python -I scripts/check_no_game_data.py tools/pr_conflict_label.py tests/test_pr_conflict_label.py`: clean (rc 0). - The merge changes exactly two files against `main`: `tools/pr_conflict_label.py` and `tests/test_pr_conflict_label.py`. ### Red - With `tools/pr_conflict_label.py` swapped back to main's version (restored afterwards), 4 of 17 error: `test_1500_open_pull_requests_stay_under_the_token_limit`, `test_a_pull_request_closed_between_two_listings_is_skipped`, `test_a_graphql_error_is_not_read_as_no_pull_requests`, `test_open_pulls_follows_pages`. The other 13 pass on both sides. - Mutations of the PR's tool, each run against the 17 tests: - Killed: paging stopped after the first page (2 fail); no re-listing between attempts (2); label test inverted (2); a closed PR treated as conflicting (1); a closed PR treated as unknown instead of skipped (1). - Survived: `LIST_WAIT` 60 -> 10 (the test compares the waits to the `LIST_WAIT` constant itself, so it cannot see the value change). Dropping `answer.get("errors") or` from the error check (a payload with no `data` still raises; a response with both `errors` and partial `data` would be read as valid). Page size `first: 100` -> `first: 50` (only the cost per run changes, no test counts requests of a 100-page). - A first mutation of the closed-PR branch (treated as mergeable and unlabeled) also survived, but it is equivalent: `decide` returns nothing for that pair, so it is not a real gap. ### Review - Claim: TOOLS-PR-CONFLICT-LABEL-RATE-LIMIT, claimed in issues/2570 (link in the PR body). It matches the diff: all-open runs use GraphQL 100 per request, `--pr N` still uses one REST GET per number, decisions go through `decide()` unchanged. - Logic checks out: `unknown` PRs are listed again after `wait`, a closed PR is skipped, a GraphQL error raises `ApiError` instead of reading as an empty list, `main` passes `sorted(pulls)`. - References to the tool in the repository: `.github/workflows/conflict-label.yml`, `CONTRIBUTING.md`, `docs/i18n/fr/contributing.md`, plus the tool and its test. The diff touches only the tool and its test, so the workflow and both docs are unchanged. - Minor: `labels(first: 100)` would miss `needs rebase` on a PR with more than 100 labels (not realistic). - Earlier checks on the PR, as posted, in order: - Kal0s-design (comment, Windows): `tests/test_pr_conflict_label.py` passes on head merged into main; no red run reported. Also a live read-only listing of about 161 open PRs, 2 GraphQL requests per listing, `UNKNOWN` cleared within 4 x 60 s; says it cannot tell what started the merge checks; no real labeling run. - merzleckeier (review, COMMENTED, Linux, Python 3.14.10): 17 tests pass; against main's implementation only the simulated API-limit failure of the 1,500-PR case is reported; clean merge; no token, no live writes. - aegish-zagi (comment, Linux, via `scripts/red_green.py`): 17 pass on the PR, 4 fail on main, the same four tests listed above, 0 regressions. - MoonEyes (comment, Linux): 17 pass merged onto main `45dc41f95c`; main's tool errors 4 (the 1,500-PR case as HTTP 403, the others missing `open_pulls`); head unchanged. That is three comments and one review. - No reviewer question is open. No change requests. - Open uncertainty stated by the author and by Kal0s-design: whether a GraphQL listing starts GitHub's merge computation. If it does not, those PRs keep their label until the next hourly run, which is safe. - CI: the head has no check runs and no commit statuses (`check-runs` total 0, combined status `pending` with 0 entries). GitHub Actions is having an incident today, so I cannot say whether CI would be green or red; I do not guess. ### Not covered - The workflow with an Actions token, a real labeling run, the live GitHub API (not touched from here). - The real value of `LIST_WAIT` and partial GraphQL errors (see surviving mutations). ### Verdict PASS. 17/17 green on the merge into current `main`, 4 tests red on main's tool, claim in place, no CI result available. Three weak spots in test strength (`LIST_WAIT`, partial `errors` with `data`, page size), not blockers. AI-assisted (Claude Code), models: Claude Opus 5.5 (checker), separate Claude Opus 5.5 judge.
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
ProjectLeonida/mandy!3116
No description provided.