ci: close the issues a merge answered, and the device requests the catalogue has #1906
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1906
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "ci/close-merged-issues"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Jay asked why the issues are still open when the PR that addresses them is merged,
and why there is no workflow closing them out.
Forgejo does honour closing keywords in a merged pull request body - #1635 closed
#1526 that way - so the mechanism works. What was missing is everything around it:
nothing catches the pull request that forgets the keyword, and nothing can ever close
a
[Device]:request whose device lands later in an unrelated pull request. Sevenrequests are open right now (#130, #742, #743, #803, #807, #808, #810) after months of
merges, because
scripts/sweep-device-requests.jsanswers "is this modelled?" onlywhen somebody remembers to run it.
.forgejo/workflows/close-merged-issues.ymlruns on every push tomain(not on aschedule: on this instance
schedule:runs are created and never handed to a runner)and does two sweeps through
scripts/close-merged-issues.js:closing keyword cites, adds the merged pull request body where the squash subject
names one, and closes any of those issues still open, commenting first with the
commit SHA and the pull request;
[Device]:request, whetherdevices/has themodel, and closes the ones it demonstrably has, naming the spec path and the model.
The device matcher is not a second matcher: the normaliser, the candidate generator and
the guards are imported from
scripts/sweep-device-requests.js. A near miss stays amiss -
OptiXtrans E6616Xis not the cataloguedE6616, and #130's "Dream Wall Pro(UDW-PRO)" is not the catalogued "UDW", which
variantOfSameCoderefuses.The keyword rule is anchored to what this instance actually does, and the evidence is
in the repository: #1867's body opens "Does not close #743", #1873's opens
"Refs #742 - ... it does not close the issue" and later carries the heading
"## What would close #742". All three name a number next to a keyword, none claims a
fix, and both issues are still open - which is what Forgejo decided at merge. A looser
parser closed both of them in a dry run against the real data. So a keyword now has to
open a line or a sentence, and the claim that did work ("Fixes #1526.") still parses.
Idempotent by construction: every comment carries a marker naming the commit or the
device it closed, an issue already closed is skipped, a number that belongs to a pull
request is skipped, and an issue a human reopened after one of these closes is left
alone rather than re-closed. Dry-run is the default and a manual dispatch keeps it
(
dry_rundefaults totrue); only the push run applies, and no path fails the build.Dry run against the real tracker, on the code path the push run uses:
None of the seven is genuinely modelled, so none is closed. Over the last 400 commits
the keyword sweep reports "0 issue(s) would be closed" while skipping 95 issues that
are already closed - it is reading the claims and agreeing with the merges that landed.
test/close-merged-issues.test.jspins 72 assertions: the real PR bodies above, anumber merely mentioned, a variant, an accessory ("shield for NanoBeam NBE-M5-19"), a
pull request number, dry-run writing nothing, one comment and one close in apply mode,
and the reopen case.
docs/CI.md gains "What a merge closes" with the two-sweep table, what it will not close
and why, and the exact local dry run. No engine/ or devices/ change and no existing
check weakened.
58437e671cb8ab9efc50