Cancel superseded CI runs on pull requests #1070

Closed
jaylouisw wants to merge 5 commits from gh/1438 into main
Owner

Every push to a PR queued another full matrix — three Node versions, Docker build, server smoke, CodeQL — and nothing cancelled the previous one when the branch was updated. With the device-request stream, a branch often gets several pushes before review, and each one added ~9 jobs to a queue that is already thousands deep. Nothing is gained by finishing a run whose commit is no longer the head.

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

Cancellation is limited to pull_request events: a push to main or a release tag always runs to completion, because that is the build of record.

Deliberately kept to this one change — all eight required check names in branch protection are still produced by the same jobs, so a PR can still go green. Cutting the work inside those jobs is the next saving, but it needs per-job verification against branch protection and does not belong bundled with a change that only removes redundant runs.


Opened by @Jaylouisw on the GitHub mirror: https://github.com/Jaylouisw/packetforge/pull/1438
Branch gh/1438 carries their commits verbatim (head 7f06af8d5f).
CI will run here. Merge here and the mirror carries the result back to GitHub.

Every push to a PR queued another full matrix — three Node versions, Docker build, server smoke, CodeQL — and nothing cancelled the previous one when the branch was updated. With the device-request stream, a branch often gets several pushes before review, and each one added ~9 jobs to a queue that is already thousands deep. Nothing is gained by finishing a run whose commit is no longer the head. ```yaml concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} ``` Cancellation is limited to `pull_request` events: a push to `main` or a release tag always runs to completion, because that is the build of record. Deliberately kept to this one change — all eight required check names in branch protection are still produced by the same jobs, so a PR can still go green. Cutting the work *inside* those jobs is the next saving, but it needs per-job verification against branch protection and does not belong bundled with a change that only removes redundant runs. --- Opened by **@Jaylouisw** on the GitHub mirror: https://github.com/Jaylouisw/packetforge/pull/1438 Branch `gh/1438` carries their commits verbatim (head 7f06af8d5f80). CI will run here. Merge here and the mirror carries the result back to GitHub. <!-- gh-pr: 1438 -->
The feature table advertised '91 models / 17 vendors' against a catalogue of 1494 models across 243 vendors, listed 9 of the 25 device categories, and described the protocol set as 'ARP, ICMP echo request/reply, TTL handling' when the simulator requires fourteen protocol modules - vlan, lag, stp, acl, ospf, bgp, dns, lldp, ipv6, ra, scion, nat, flow - and its L3 row omitted the OSPF and BGP routes that feed the same table.

Counts verified rather than guessed: 1494 models, 243 vendors, 25 categories, 64 media, 8 families, 19 cages, all read out of the registry and engine/media.js in this tree.

The addition that matters more than the numbers: a 'What this does not model yet' section. DHCP and VRRP are complete, tested libraries that the simulator never calls - so 'ip address dhcp' sets a flag nothing reads and a configured VRRP group elects nobody. There are no ICMP errors, so no traceroute. OSPF and BGP compute routes without exchanging packets. A line like that costs a paragraph and stops the README from being the thing that misleads someone into building a lab the engine cannot run.
Add UISP Console and LiteBeam 5AC XR from the vendor figures
Some checks failed
CI / Test (Node 18) (pull_request) Successful in 1m16s
CI / Test (Node 20) (pull_request) Successful in 1m15s
CI / Server smoke test (pull_request) Successful in 26s
CI / Docker build (pull_request) Failing after 11s
CI / Workflow lint (pull_request) Successful in 10s
CI / Test (Node 22) (pull_request) Successful in 1m9s
CodeQL / Analyze (pull_request) Failing after 13s
c8cf6597fe
Two hardware requests (#1404, #1403) that were genuinely missing - the rest of the Ubiquiti UFiber/wave stream in the issue queue is already in the catalogue, so this fills the gap rather than repeating a lane's work.

UISP-Console: 8 LAN GbE RJ45 + 1 LAN 1/10G SFP+, 1 WAN GbE RJ45 + 1 WAN 1/10G SFP+, per the vendor networking-interface table. The eight LAN ports sit in one bridge group and the WAN side carries the wan role, because the box is a gateway and a switch at once; without that split a lab would show LAN-to-WAN traffic passing with no gateway. Its SFP+ cages declare speedCaps [1000, 10000] rather than 10G alone - a 1G module in a 10G cage is a supported configuration and the test proves it is accepted at 1G instead of refused as a downgrade.

LBE-5AC-XR: 29 dBi parabolic, 5.15-5.85 GHz, 25 dBm conducted, 450+ Mbps throughput, one GbE port. The radio is modelled at 867 Mbps, the 80 MHz 2x2 airMAX ac PHY rate, matching the other 5AC LiteBeams - 450+ Mbps is a throughput claim, not a line rate, and putting it in speedCaps would have understated the hardware. The antenna cage refuses copper with E_WIRELESS_TO_WIRED through both canMate and validateLink, and two XRs still associate.

83 suites, 4181 assertions, 30 new in test/uisp-console-lbe-xr.test.js.
Running the documented regeneration step on a clean tree rewrote all four examples: lab1 +59 lines, lab2 +34, lab3 +435, lab4 +111. The committed JSON was a state the serializer could no longer produce - it predates the seq field, and its device and link entries differ too, not just the header. Every lab still loaded and pinged, which is why it survived: nothing failed, the cost just landed on the next contributor who added a lab and inherited 639 lines of unrelated churn.

So this does two things. It regenerates the four files from build-examples.js, which is the documented way to produce them; and it adds test/examples-generated.test.js, which re-serialises each committed file and fails if the result differs, naming the keys that drifted and printing the command that fixes it.

Verified by reverting the examples and running the new test against the committed state: four failures, one per lab, each naming devices, links and seq. After regeneration: 21 assertions, 0 failed. A generator that could shuffle ids or ordering would make every regeneration a diff, so the test also asserts each file serialises identically twice, and it pings two of the labs so a clean round trip cannot hide a lab that no longer works.

85 suites, 4232 assertions.
Closes #643. DrayTek had 15 open hardware requests and four models in the catalogue; this fills the biggest of them from the 2540x series datasheet, which documents both switches side by side.

P2540x and G2540X are the same 48-port Gigabit Layer 2+ switch with six 10G SFP+ uplinks numbered 49-54 and one RJ-45 console, 216 Gbps switching capacity and static routing plus a DHCP server so inter-VLAN traffic does not depend on the gateway. The only difference is the one that decides whether a device boots: the P2540x supplies PoE/PoE+ (802.3af/at, Type A) on all 48 copper ports with a 400 W budget and 30 W per port; the G2540X supplies nothing.

Kept as two specs rather than one with a flag, because a lab that puts an access point on a G2540X port should see it fail to power, and 48 ports at 30 W is 1440 W - the budget is deliberately smaller than the per-port maximum, so the switch has to be asked what it can actually deliver rather than assumed.

Both declare their connector explicitly on the template and the uplinks, so they add nothing to the 3396 undeclared-template-port count in #1398. The SFP+ cages declare speedCaps [1000, 10000]: a 1G module in a 10G cage is supported, and the test proves it negotiates at 1G instead of being refused as a downgrade.

86 suites, 4262 assertions, 30 new in test/draytek-2540x.test.js.
Cancel superseded CI runs on pull requests
Some checks failed
CI / Test (Node 18) (pull_request) Successful in 1m20s
CI / Test (Node 20) (pull_request) Successful in 1m12s
CI / Server smoke test (pull_request) Successful in 33s
CI / Docker build (pull_request) Failing after 11s
CI / Workflow lint (pull_request) Successful in 10s
CodeQL / Analyze (pull_request) Failing after 7s
CI / Test (Node 22) (pull_request) Successful in 1m20s
7f06af8d5f
Every push to a PR queued another full matrix - three Node versions, Docker build, server smoke, CodeQL - and nothing cancelled the previous one when the branch was updated. In this repository that is the normal case rather than the exception: the device-request stream means a branch often gets several pushes before it is reviewed, and each one added nine jobs to a queue that is already thousands deep. Nothing is gained by finishing a run whose commit is no longer the head.

Concurrency group is workflow + ref, and cancellation is limited to pull_request events: a push to main or a release tag always runs to completion, because that is the build of record and the thing an artefact is cut from.

Deliberately kept to this one change. The eight required check names in branch protection are all still produced by the same jobs - 'Test (Node 18/20/22)', 'Docker build', 'Server smoke test', 'Analyze (javascript)', 'CodeQL', 'Workflow lint' - so a PR can still go green. Cutting the work inside those jobs, which would be the next saving, has to be done per job and verified against branch protection, and it is not something to bundle with a change that only removes redundant runs.
Author
Owner

Every piece of this is already on main — landed separately, before the bridge carried the branch across. Rather than merge a branch whose diff would undo newer work, here is where each part went.

part of this PR where it lives now
DrayTek VigorSwitch G2540x / P2540x pair on main, with test/draytek-2540x.test.js
Regenerated example labs + drift test on main, test/examples-generated.test.js
UISP Console + LiteBeam 5AC XR #1125 (this branch's version of the Console, with the LAN/WAN split, replaced the older one)
README rewrite main's README has moved on since — the absolute Forgejo-URL rule, the mirror section. This branch's version predates that and conflicts.
Cancel superseded CI runs already implemented — see below

The CI change, specifically

The YAML in this PR edits .github/workflows/ci.yml, which was deleted from this repository in #1059: CI runs on the forge now, under .forgejo/workflows/. Merging it would resurrect a workflow that cannot run here.

The intent is already in the workflow that does run:

concurrency:
  group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
  cancel-in-progress: ${{ github.event_name == 'pull_request' }}

A superseded PR run is cancelled; post-merge runs on main are keyed on the SHA so they never cancel each other. That second half is the correction this repo needed — with the group keyed on github.ref alone, every post-merge verification run on main shared one group and cancelled its siblings, so main was only ever verified when nothing else was happening.

Closing as superseded. The contribution itself was right, and the thinking in it about queue depth is the same reasoning that led to the per-job timeouts and the changes gating.

Original: GitHub pull request #1438.

Every piece of this is already on `main` — landed separately, before the bridge carried the branch across. Rather than merge a branch whose diff would undo newer work, here is where each part went. | part of this PR | where it lives now | |---|---| | DrayTek VigorSwitch G2540x / P2540x pair | on `main`, with `test/draytek-2540x.test.js` | | Regenerated example labs + drift test | on `main`, `test/examples-generated.test.js` | | UISP Console + LiteBeam 5AC XR | **#1125** (this branch's version of the Console, with the LAN/WAN split, replaced the older one) | | README rewrite | `main`'s README has moved on since — the absolute Forgejo-URL rule, the mirror section. This branch's version predates that and conflicts. | | **Cancel superseded CI runs** | already implemented — see below | ### The CI change, specifically The YAML in this PR edits `.github/workflows/ci.yml`, which was **deleted from this repository** in #1059: CI runs on the forge now, under `.forgejo/workflows/`. Merging it would resurrect a workflow that cannot run here. The intent is already in the workflow that does run: ```yaml concurrency: group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: ${{ github.event_name == 'pull_request' }} ``` A superseded PR run is cancelled; post-merge runs on `main` are keyed on the SHA so they never cancel each other. That second half is the correction this repo needed — with the group keyed on `github.ref` alone, every post-merge verification run on `main` shared one group and cancelled its siblings, so `main` was only ever verified when nothing else was happening. Closing as superseded. The contribution itself was right, and the thinking in it about queue depth is the same reasoning that led to the per-job timeouts and the `changes` gating. Original: GitHub pull request #1438.
jaylouisw closed this pull request 2026-11-08 20:28:30 +00:00
Some checks failed
CI / Test (Node 18) (pull_request) Successful in 1m20s
CI / Test (Node 20) (pull_request) Successful in 1m12s
CI / Server smoke test (pull_request) Successful in 33s
CI / Docker build (pull_request) Failing after 11s
CI / Workflow lint (pull_request) Successful in 10s
CodeQL / Analyze (pull_request) Failing after 7s
CI / Test (Node 22) (pull_request) Successful in 1m20s

Pull request closed

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!1070
No description provided.