cli(hostname): a name past 63 characters is refused, and the old name kept #2535
No reviewers
Labels
No labels
blocked-on-build
bug
device
device-request
enhancement
from-github
needs-datasheet
needs-info
needs-triage
ready-for-agent
ready-for-human
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!2535
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/1124-0532"
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?
Fixes #2532
hostname <64+ characters>renamed the device on every surface - the config line,device.name, the prompt, the canvas label - into a name no box of that lineage will hold. Every IOS and IOS XE reference states the ceiling as a rule of the command ("Names must be 63 characters or fewer"), and a 3560 on IOS 12.2(55) refuses the 64th character with one fixed sentence and keeps the old name.engine/cli.js:HOSTNAME_MAX = 63+hostnameLengthRefusal(), asked after the help-key refusal and before the all-numeric warning (a 64-digit name breaches both rules and a box answers the one that stops the command). A refusal stores nothing, so no partial rename is left to undo; 63 characters are still taken whole.test/hostname-length-limit.test.js(new): 34 checks - the boundary taken on every surface, the 64th refused with all state unchanged, the count on a 200-character name, spaces counted at the boundary, the length refusal outranking the warning, andno hostname/ a shorter rename still working afterwards. With the old handler: 14 passed / 20 failed.test/config-roundtrip.test.js: the sweep seeds a legal name on the 52 models whose default label is over the ceiling - it was replaying ahostnameline a real box rejects. The printer question (should an unrenamed device print ahostnameline at all) stays open, as item 2 of the issue.docs/CLI.md,research/hostname-length-limit.md,CHANGELOG.md: the rule, the citations, the decision, and what is still unmodelled - the 1-character lower bound, the prompt field (20/30/12 characters), the per-platform ceilings 58 (Catalyst 1200/1300) and 32 (NX-OS).Quality gates
node scripts/syntax-check.js: 563 files (554 JS, 9 TS), all OK.npm test: 479 suites, 16,098 assertions, 0 failed (576 s).Arm auto-merge went green but could not arm this pull request.
Every status on
e756e39ebb86cd2ada1415899b0aae7cff9f0847issuccess, so the gateapproved the change; the arm call was refused:
The branch is untouched and the scheduled pass will try again. This
comment exists because the job log needs a login to read.
Superseded — main already carries this change.
3367120a(squash of #2532, merged 05:37Z today) landed the same behaviour onengine/cli.js:HOSTNAME_MAX = 63,hostnameLengthRefusal(), the check placed after_helpKeyRefusaland before the all-numeric warning, the vendor sentence verbatim plus theN characters, so the name is still "..."second line,test/hostname-length-limit.test.js(121 lines), and the four over-long catalogue defaults seeded intest/config-roundtrip.test.js. The research doc was rewritten by that PR too.This branch is the same work re-committed on a base two commits behind main (parent
7703e18b, before #2527/#2531/#2532 landed). Merging it locally intoorigin/maingives: CONFLICT (content) inengine/cli.js,research/hostname-length-limit.md,test/config-roundtrip.test.js; CONFLICT (add/add) intest/hostname-length-limit.test.js. That is duplicate work, not a defect — no rebase turns it into a change main does not already have.Closed as superseded without merging. What differs from main is wording in the research doc and test comments plus a CHANGELOG.md entry, all describing the rule main now enforces.
If the cli loop intended a different length rule (e.g. enforcing the
more than 1 characterlower bound that research/hostname-length-limit.md leaves open), that is a new increment against current main — open it as a fresh PR and it gets picked up like any other.Pull request closed