Repository navigation
ci: label pull requests that conflict with main needs rebase (PR-CONFLICT-LABEL) - #155
Merged
ubiquitarianism merged 1 commit intoNov 24, 2026
Conversation
…NFLICT-LABEL) Every pull request is reviewed by hand, and with over a hundred open the reviewer has no quick way to skip the ones that cannot merge as they stand. tools/pr_conflict_label.py asks the GitHub API for each open pull request's `mergeable` and labels the conflicting ones `needs rebase`, removing the label once they merge cleanly again; an answer GitHub has not computed yet is asked again a few times and otherwise left for the next run. .github/workflows/conflict-label.yml runs it on a push to main (all open pull requests), on a pull request being opened, reopened or pushed to (that one), and hourly. The job uses pull_request_target so a fork's pull request can be labeled, and is safe with it: it checks out main, never the pull request, and the tool reads only the API, so no pull request code runs. Its token can read contents and write pull requests, nothing else; tests/test_pr_conflict_label.py checks that, and the tool against a fake API. The pull request template also asks for `Fixes: #N` and `GPUs tested:` lines and has checklist items for "based on current main" and "one topic"; tests/test_docs_pr_template.py checks the new prompts, and CONTRIBUTING.md gets a short Pull requests section. The process is modelled on AnyPS5's (boykopovar/AnyPS5); the code is written here, not copied.
Merged
4 tasks done
aslan2142
pushed a commit
that referenced
this pull request
Nov 24, 2026
…-CONFLICT-LABEL-LOAD) conflict-label.yml (#155) started a run on every push to every pull request through pull_request_target. On this repository that queued 265 runs within a day, some waiting five hours, in the same runner queue as CI, No Game Data and Runtime, whose oldest queued run waited six hours. Drop the pull_request_target trigger and put every run in one concurrency group. Each run already checks every open pull request, so a push to main and the hourly schedule cover what the per-PR runs did; a rebased pull request loses the label within the hour instead of at once. At most one run waits at a time. The workflow also no longer has a trigger that hands a fork's pull request a write token. tests/test_pr_conflict_label.py fails on the old workflow and checks that no pull request trigger, per-PR group or --pr comes back; the tool's docstring and CONTRIBUTING.md say what runs it now.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: PR-CONFLICT-LABEL (#14)
Depends on: none. #56 and #100 also edit
CONTRIBUTING.md, but only its lines 15–25; this adds a section at the end of the file and does not conflict with either.What and why
Every pull request here is reviewed by hand, and 109 are open. Right now, 23 of them conflict with
mainand can't be merged until their authors rebase, but nothing marks which ones. This adds aneeds rebaselabel so a reviewer can skip them and their authors know what to do. It's modelled on AnyPS5's contributing pipeline. The code was written here, not copied (AnyPS5 is GPL-2.0).tools/pr_conflict_label.py(standard library only)--pr), it reads GitHub'smergeableanswer and labels the conflicting onesneeds rebase. Once a pull request merges cleanly again, the label is removed.mergeablein the background and answersnulluntil it's done. An unknown answer is asked again up to 4 times, 10 s apart, and otherwise left alone for the next run. The tool never guesses.d93f0b, "Conflicts with the base branch: rebase it on main").--dry-runprints what it would change and writes nothing..github/workflows/conflict-label.ymlruns the tool:main, checking all open pull requests, since a merge can make others conflict;pull_request_targetopened/reopened/synchronize, checking that one pull request, since a rebase can clear a conflict;workflow_dispatch.Security.
pull_request_targetis what gives a fork's pull request a token that can write labels. Here it's safe:persist-credentials: false.permissions: {}. The job getscontents: readandpull-requests: writeonly.actions/checkoutis pinned to the same SHA as the other workflows.tests/test_pr_conflict_label.pychecks all of these properties in the workflow file.PR template and CONTRIBUTING.md
Fixes:(Fixes: #Ncloses the issue on merge) andGPUs tested:(vendor, model, driver and OS).mainand merges cleanly" and "one topic; follow-up work goes in a new pull request". The existing claim,Depends on:andAI-assisted:lines are kept.tests/test_docs_pr_template.pynow requires the new prompts.CONTRIBUTING.mdgets a short Pull requests section at the end: one topic per pull request, fill in the template, and what the label means.This workflow only starts running once it's on
main, becausepull_request_targetuses the base branch's copy. So it can't label anything from this pull request.Tested
tests/test_pr_conflict_label.py: 12 tests against a fake GitHub API, all OK. They cover everydecide()case, retrying an uncomputed merge and then leaving it alone, creating the label once and only when needed, an existing label (422), a label removed in the meantime (404), closed pull requests being skipped, dry runs writing nothing, paging past 100, and the workflow's checkout and permission rules. Breakingdecide()makes the suite fail.--dry-run, read-only GETs with my token):109 checked: 23 labeled, 0 unlabeled, 0 not computed yet. I spot-checked against GitHub: docs, tools: point repository links at ProjectLeonida/Leonida #100, docs(i18n): shaders, assets and runtime run together since #1797 in the de, es and ja quickstarts (PROC-544) #52 and runtime: build again on MSVC after #9576 (slot 14 console descriptor heap) #141 reportCONFLICTINGand were flagged; rdna2spirv: zero the tfe/lwe status VGPR on image_load and image_load_mip (SHADER-1266) #98 and rdna2spirv: a computed value written to EXEC sets the lanes of its bits (SHADER-1264) #24 reportMERGEABLEand were not.tests/test_docs_pr_template.py,test_ci_registration.py(the new test file is picked up by the standard-library loop),test_docs_links.py,test_text_write_line_endings.py,test_runtime_paths.py,test_no_game_data_workflow.py,python -m compileall -q make_game.py tools tests, andscripts/check_no_game_data.pyon every changed file.actionlintisn't installed here, so thejactionlintjob in CI is the first lint of it.GPUs tested: n/a (CI and docs only)
AI-assisted: yes (Claude Code)
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a: no translator change)