cli: converge's Device column is as wide as the longest name in the answer (#1732) #1733

Merged
jaylouisw merged 1 commit from fix/1116-2105 into main 2026-11-16 21:22:22 +00:00
Owner

Fixes #1732.

pad() right-pads and never truncates, so the fixed 23-character Device column did not widen for a longer name - the name ran into the instant. Default names are label + '-' + last four characters of the id, and 1475 of the 2329 catalogue specs exceed 22 characters that way, so an untouched ISR 4331 lab printed:

Process   Device                 Ready   Basis
ospf      ISR 4331 branch router-r116000 ms  hello 10 s + exchange, then SPF hold  (pending)

which reads as the instant r116000 ms on a device named router-r1. The heading was hand-typed on top of that and put Basis at column 41 over data at 43.

Change: widths come from the data, with the table's existing minimums (10/23/10) as floors, so a lab of short names prints byte-for-byte what it printed before and the docs/CONVERGENCE.md / docs/LINK-STATE.md samples stay true; header and rows are built from the one set of widths so they cannot drift apart (the rule show lldp neighbors follows since #1265). Both doc samples re-aligned, and CONVERGENCE.md gains a sentence on the widening.

Test: test/converge-table-geometry.test.js - 17 assertions, 6 failing on main (default 25-character name, a 41-character name, short names unchanged, and pending/converged sharing one geometry).

Gates: syntax-check 362 files OK; the eleven converge/link/clock suites pass; npm test 291 suites / 10,353 assertions / 0 failed (442.8 s).

Fixes #1732. `pad()` right-pads and never truncates, so the fixed 23-character Device column did not widen for a longer name - the name ran into the instant. Default names are `label + '-' + last four characters of the id`, and 1475 of the 2329 catalogue specs exceed 22 characters that way, so an untouched ISR 4331 lab printed: ``` Process Device Ready Basis ospf ISR 4331 branch router-r116000 ms hello 10 s + exchange, then SPF hold (pending) ``` which reads as the instant `r116000 ms` on a device named `router-r1`. The heading was hand-typed on top of that and put `Basis` at column 41 over data at 43. **Change:** widths come from the data, with the table's existing minimums (10/23/10) as floors, so a lab of short names prints byte-for-byte what it printed before and the `docs/CONVERGENCE.md` / `docs/LINK-STATE.md` samples stay true; header and rows are built from the one set of widths so they cannot drift apart (the rule `show lldp neighbors` follows since #1265). Both doc samples re-aligned, and CONVERGENCE.md gains a sentence on the widening. **Test:** `test/converge-table-geometry.test.js` - 17 assertions, 6 failing on main (default 25-character name, a 41-character name, short names unchanged, and pending/converged sharing one geometry). **Gates:** syntax-check 362 files OK; the eleven converge/link/clock suites pass; `npm test` **291 suites / 10,353 assertions / 0 failed** (442.8 s).
cli: converge's Device column is as wide as the longest name in the answer (#1732)
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 19s
CI / Server smoke test (pull_request) Successful in 15s
CI / Docker build (pull_request) Successful in 30s
CI / Test (Node 18) (pull_request) Successful in 59s
CI / Test (Node 20) (pull_request) Successful in 1m0s
CI / Test (Node 22) (pull_request) Successful in 57s
CI / Arm auto-merge (pull_request) Successful in 5s
c21fe11e74
pad() right-pads without truncating, so any name past 22 characters ran into
the instant: 'ospf      ISR 4331 branch router-r116000 ms' reads as 'r116000 ms'
on a device called 'router-r1'. That default name (label + '-' + four characters
of the id) exceeds the 23-character column for 1475 of the 2329 catalogue specs,
so the misreading was the untouched-lab output, not an edge case. The heading
was hand-typed on top of it and put Basis at column 41 over data at 43.

Widths now come from the data with the old minimums (10/23/10) as floors, so a
short-named lab prints exactly what it printed before and the docs samples still
match; header and rows are built from one set of widths. 17 assertions in
test/converge-table-geometry.test.js, 6 of which fail on main.
jaylouisw force-pushed fix/1116-2105 from c21fe11e74
All checks were successful
CI / Classify the change (pull_request) Successful in 14s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 19s
CI / Server smoke test (pull_request) Successful in 15s
CI / Docker build (pull_request) Successful in 30s
CI / Test (Node 18) (pull_request) Successful in 59s
CI / Test (Node 20) (pull_request) Successful in 1m0s
CI / Test (Node 22) (pull_request) Successful in 57s
CI / Arm auto-merge (pull_request) Successful in 5s
to c813fef5d8
All checks were successful
CI / Classify the change (pull_request) Successful in 13s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 15s
CI / Server smoke test (pull_request) Successful in 16s
CI / Test (Node 20) (pull_request) Successful in 52s
CI / Test (Node 18) (pull_request) Successful in 58s
CI / Docker build (pull_request) Successful in 28s
CI / Test (Node 22) (pull_request) Successful in 57s
CI / Arm auto-merge (pull_request) Successful in 12s
2026-11-16 21:17:54 +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!1733
No description provided.