Repository navigation
ci: a new report's RE id must not be one main or an earlier open pull request has - #1639
Merged
Merged
Conversation
…rlier open pull request has fails the PII guard job, so the later one is renumbered before two reports carry one number
…e judgement has failure-first tests, run in the PII guard job like its neighbours
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.
Summary
A new CI step in the PII guard job,
tools/ci/check_re_id_reuse.py, fails a pull request that adds a report (reports/**/RE-NN-*.md) whose id another report of the merged tree already has, or that an earlier open pull request (a lower number) also adds. The later pull request fails, asdocs/maintaining.mdalready says it is renumbered. Griffin asked for it through the project questions on 2026-11-10.Motivation
On 2026-11-10 two pull requests carried an RE-392 before either was opened, and a contributor's pull request took an id another was about to use: renumbering after both land means rewriting the code, probes and changelog entries that cite it. The rule existed on paper (
reports/README.md,docs/maintaining.md); nothing enforced it.Changes
tools/ci/check_re_id_reuse.py: reads the reports a pull request adds from the API's file list (a report it only edits or renames is not new), looks for another path with the id in the checked-out tree (the merge of the pull request intomain, so that ismain's, or the pull request's own second file), and for an earlier open pull request adding the same id. API failures are NOT MEASURED warnings, ascited-commits.pydoes, never red. A push checks nothing..github/workflows/ci.yml: the step, after the API docs step, withGH_TOKEN, and a step for the pure tests.tools/ci/test_check_re_id_reuse.py: ten failure-first cases of the pure rule (an id on main at another path, two new reports under one id, an earlier open pull request, a fresh id, the pull request's own file,RE-12.md,RE-3againstRE-30, non-report paths, a subdirectory, no new report).docs/maintaining.md,reports/README.md: say that CI enforces it.Testing
End to end against the real API and a real checkout, from a scratch worktree of
main(the pure rule also has the failure-first tests this repository keeps for its CI scripts,tools/ci/test_check_re_id_reuse.py, run in the PII guard job: a pure helper, ten cases):reports/element-framing/RE-385-other.mdadded to the tree:::error::RE-385 is already the id of reports/element-framing/RE-385-other.md on main: take the next free id, exit 1.RE-385-dup.md, against the real open pull requests:::error::RE-385 is also added by #1620, opened first (...), exit 1.reused) tried against nine cases: an id on main at another path, two new reports under one id, an earlier open pull request, a fresh id, the pull request's own file in the merge tree, aRE-12.mdname, non-report paths,RE-3againstRE-30, a subdirectory report. All as expected.actionlintand a YAML load ofci.ymlpass; the new file has the mode of its neighbours.Audit-honesty checklist
Breaking changes
None.
Related issues
Griffin's 2026-11-10 project questions; follows the RE-392 collision (#1632, #1637).