ci: close the issues a merge answered, and the device requests the catalogue has #1906

Merged
jaylouisw merged 1 commit from ci/close-merged-issues into main 2026-11-17 21:54:23 +00:00
Owner

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. Seven
requests are open right now (#130, #742, #743, #803, #807, #808, #810) after months of
merges, because scripts/sweep-device-requests.js answers "is this modelled?" only
when somebody remembers to run it.

.forgejo/workflows/close-merged-issues.yml runs on every push to main (not on a
schedule: on this instance schedule: runs are created and never handed to a runner)
and does two sweeps through scripts/close-merged-issues.js:

  • keyword sweep: reads the pushed commits from the compare API, takes the ones a
    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 sweep: asks, for every open [Device]: request, whether devices/ has the
    model, 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 a
miss - OptiXtrans E6616X is not the catalogued E6616, and #130's "Dream Wall Pro
(UDW-PRO)" is not the catalogued "UDW", which variantOfSameCode refuses.

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_run defaults to true); 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:

$ FORGEJO_TOKEN=... node scripts/close-merged-issues.js --from 2ba6a7da --to b1d25b35 --explain
close-merged-issues
  repo      : jaylouisw/packetforge
  api       : http://odin:3000/api/v1
  catalogue : 2345 distinct model names
  mode      : DRY RUN - nothing will be closed
  commits   : 1 (b1d25b3..b1d25b3)

keyword sweep - issues a merged commit claims to fix
  no closing keyword in these commits

device sweep - [Device]: requests the catalogue already answers
  left open #810: no exact entry in devices/ for "OptiXtrans E9624"
  left open #808: no exact entry in devices/ for "OptiXtrans E9612"
  left open #807: no exact entry in devices/ for "OptiXtrans E9605"
  left open #803: no exact entry in devices/ for "OptiXtrans E6616X"
  left open #743: no exact entry in devices/ for "Huawei OceanProtect X8100/X9100 Backup Storage"
  left open #742: no exact entry in devices/ for "Huawei OceanProtect E8000 Backup Storage"
  left open #130: no exact entry in devices/ for "Ubiquiti UniFi Dream Wall Pro (UDW-PRO)"
  open [Device] requests examined: 7, present in devices/: 0

dry run: 0 issue(s) would be closed, 0 were touched

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.js pins 72 assertions: the real PR bodies above, a
number 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.

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. Seven requests are open right now (#130, #742, #743, #803, #807, #808, #810) after months of merges, because `scripts/sweep-device-requests.js` answers "is this modelled?" only when somebody remembers to run it. `.forgejo/workflows/close-merged-issues.yml` runs on every push to `main` (not on a schedule: on this instance `schedule:` runs are created and never handed to a runner) and does two sweeps through `scripts/close-merged-issues.js`: - keyword sweep: reads the pushed commits from the compare API, takes the ones a 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 sweep: asks, for every open `[Device]:` request, whether `devices/` has the model, 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 a miss - `OptiXtrans E6616X` is not the catalogued `E6616`, and #130's "Dream Wall Pro (UDW-PRO)" is not the catalogued "UDW", which `variantOfSameCode` refuses. 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_run` defaults to `true`); 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: $ FORGEJO_TOKEN=... node scripts/close-merged-issues.js --from 2ba6a7da --to b1d25b35 --explain close-merged-issues repo : jaylouisw/packetforge api : http://odin:3000/api/v1 catalogue : 2345 distinct model names mode : DRY RUN - nothing will be closed commits : 1 (b1d25b3..b1d25b3) keyword sweep - issues a merged commit claims to fix no closing keyword in these commits device sweep - [Device]: requests the catalogue already answers left open #810: no exact entry in devices/ for "OptiXtrans E9624" left open #808: no exact entry in devices/ for "OptiXtrans E9612" left open #807: no exact entry in devices/ for "OptiXtrans E9605" left open #803: no exact entry in devices/ for "OptiXtrans E6616X" left open #743: no exact entry in devices/ for "Huawei OceanProtect X8100/X9100 Backup Storage" left open #742: no exact entry in devices/ for "Huawei OceanProtect E8000 Backup Storage" left open #130: no exact entry in devices/ for "Ubiquiti UniFi Dream Wall Pro (UDW-PRO)" open [Device] requests examined: 7, present in devices/: 0 dry run: 0 issue(s) would be closed, 0 were touched 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.js` pins 72 assertions: the real PR bodies above, a number 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.
ci: close the issues a merge answered, and the device requests the catalogue has
All checks were successful
CI / Classify the change (pull_request) Successful in 9s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 15s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 24s
CI / Test (Node 20) (pull_request) Successful in 47s
CI / Test (Node 18) (pull_request) Successful in 54s
CI / Test (Node 22) (pull_request) Successful in 51s
CI / Arm auto-merge (pull_request) Successful in 6s
58437e671c
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. Seven
requests are open right now (#130, #742, #743, #803, #807, #808, #810) after months of
merges, because `scripts/sweep-device-requests.js` answers "is this modelled?" only
when somebody remembers to run it.

`.forgejo/workflows/close-merged-issues.yml` runs on every push to `main` (not on a
schedule: on this instance `schedule:` runs are created and never handed to a runner)
and does two sweeps through `scripts/close-merged-issues.js`:

- keyword sweep: reads the pushed commits from the compare API, takes the ones a
  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 sweep: asks, for every open `[Device]:` request, whether `devices/` has the
  model, 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 a
miss - `OptiXtrans E6616X` is not the catalogued `E6616`, and #130's "Dream Wall Pro
(UDW-PRO)" is not the catalogued "UDW", which `variantOfSameCode` refuses.

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_run` defaults to `true`); 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:

    $ FORGEJO_TOKEN=... node scripts/close-merged-issues.js --from 2ba6a7da --to b1d25b35 --explain
    close-merged-issues
      repo      : jaylouisw/packetforge
      api       : http://odin:3000/api/v1
      catalogue : 2345 distinct model names
      mode      : DRY RUN - nothing will be closed
      commits   : 1 (b1d25b3..b1d25b3)

    keyword sweep - issues a merged commit claims to fix
      no closing keyword in these commits

    device sweep - [Device]: requests the catalogue already answers
      left open #810: no exact entry in devices/ for "OptiXtrans E9624"
      left open #808: no exact entry in devices/ for "OptiXtrans E9612"
      left open #807: no exact entry in devices/ for "OptiXtrans E9605"
      left open #803: no exact entry in devices/ for "OptiXtrans E6616X"
      left open #743: no exact entry in devices/ for "Huawei OceanProtect X8100/X9100 Backup Storage"
      left open #742: no exact entry in devices/ for "Huawei OceanProtect E8000 Backup Storage"
      left open #130: no exact entry in devices/ for "Ubiquiti UniFi Dream Wall Pro (UDW-PRO)"
      open [Device] requests examined: 7, present in devices/: 0

    dry run: 0 issue(s) would be closed, 0 were touched

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.js` pins 72 assertions: the real PR bodies above, a
number 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.
jaylouisw force-pushed ci/close-merged-issues from 58437e671c
All checks were successful
CI / Classify the change (pull_request) Successful in 9s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 15s
CI / Server smoke test (pull_request) Successful in 8s
CI / Docker build (pull_request) Successful in 24s
CI / Test (Node 20) (pull_request) Successful in 47s
CI / Test (Node 18) (pull_request) Successful in 54s
CI / Test (Node 22) (pull_request) Successful in 51s
CI / Arm auto-merge (pull_request) Successful in 6s
to b8ab9efc50
All checks were successful
CI / Classify the change (pull_request) Successful in 10s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 7s
CI / Server smoke test (pull_request) Successful in 19s
CI / Test (Node 20) (pull_request) Successful in 49s
CI / Docker build (pull_request) Successful in 24s
CI / Test (Node 18) (pull_request) Successful in 55s
CI / Test (Node 22) (pull_request) Successful in 53s
CI / Arm auto-merge (pull_request) Successful in 17s
2026-11-17 21:52:17 +00:00
Compare
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
jaylouisw/packetforge!1906
No description provided.