Skip to content

--no-public-ip output: warnings once, 'none (private only)' in the ready box; unquote bool flag help (#1443, #1441) - #1452

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1443-1441-nopub-output
Oct 31, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1443-1441-nopub-output

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1443
Fixes #1441

#1443: --no-public-ip launch output

  • Pre-flight warnings printed once. PreflightNoPublicIP now writes each line through Client.reportPreflightOnce. A line this client has already written is skipped. So when Launch repeats the check after the CLI's (a cache hit), it prints nothing new, and job array members, each checked in Launch, don't repeat the warnings either. The safety check itself still runs and still refuses the launch exactly as before; only the duplicate output is gone.
    • Caveat: the dedupe is per client and by line text, not per writer. A caller that first sends the check to io.Discard and then to stderr would see nothing the second time. No caller does that today (only tests use io.Discard).
  • Ready box. progress.renderSuccess shows progress.NoPublicIP ("none (private only)") when PublicIP is empty. The dry run's noPublicIPPlan is now that same constant. A --no-public-ip launch also skips the "Getting public IP" step (launchedPublicIP), so it no longer looks up an address that doesn't exist.

#1441: bool flag help with a bogus value name

  • pflag's UnquoteUsage treats the first back-quoted span in a usage string as the flag's value name. There was no generic gate for this, so this PR adds TestBoolFlagUsageHasNoValueName. It walks every command under rootCmd, runs each bool flag in LocalFlags() through pflag.UnquoteUsage, and fails on any value name. If the walk finds no bool flags at all, it fails, because that means the walk is broken.
  • On unmodified main the gate found three such flags, not two: --no-public-ip, --allow-missing-endpoints and --wait-for-ssh. The backticks are gone from all three. make gen-docs regenerated docs-gen/launch.md.

Gates (each watched failing against a revert that compiles)

  • TestPreflightNoPublicIPRepeatPrintsNothingNew (pkg/aws): a wire fake whose interface endpoints sit only in the other AZ, so the check warns four times. The test checks the same subnet twice. The first check must print exactly 4 cross-AZ warnings, and the second must print nothing.
    • Revert (reportPreflightOnce always writes): FAIL, and all 4 warnings print again on the second check.
  • TestSuccessSummaryNamesAMissingPublicIP (pkg/progress): the empty-IP row must read none (private only), and a real IP must be shown unchanged.
    • Revert: FAIL with row " Public IP " shows "", the exact symptom from the issue.
  • TestLaunchedPublicIPSkipsTheLookupForNoPublicIP (cmd): counts calls to the lookup function: 0 under --no-public-ip, 1 otherwise.
    • Revert: FAIL, 1 lookups.
  • TestBoolFlagUsageHasNoValueName: on unmodified main it fails for the three flags above. It passes with the fix.

Checks

make check, make lint (0 issues), semgrep scan --config=auto --error ., and make gen-docs + make check-docs (clean). make api-snapshot showed no change: progress.NoPublicIP is new and exported, but pkg/progress is not in the snapshot set.

This touches pkg/aws/client.go only to add one Client field, next to privateNets.

@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 81.48148% with 5 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/launch_single.go 66.66% 4 Missing ⚠️
pkg/aws/private_network.go 87.50% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

…IP, unquote bool flag help (#1443, #1441)

PreflightNoPublicIP writes each line once per client, so Launch's repeat
check after the CLI's (and each job array member's) adds nothing. The launch
summary shows 'none (private only)' for an instance with no public IP, and a
--no-public-ip launch skips the public-IP lookup. Backticks in three bool
flags' usage made pflag show 'spawn connect' as a value name; a gate walks
every command's bool flags through pflag.UnquoteUsage.

Fixes #1443
Fixes #1441
@scttfrdmn
scttfrdmn force-pushed the fix/1443-1441-nopub-output branch from 0a1ca0b to 0a963e3 Compare October 31, 2026 00:01
@scttfrdmn
scttfrdmn merged commit e810120 into main Oct 31, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1443-1441-nopub-output branch October 31, 2026 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant