Skip to content

fix(logs,doctor,footprint): cache after EC2 forgets, --region narrows lookups, honest hints - #1220

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/1160-1161-logs-doctor-footprint
Oct 20, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
fix/1160-1161-logs-doctor-footprint

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fixes #1160
Fixes #1161

spawn logs (#1160)

  • When EC2 no longer lists the instance, showTerminatedLog now looks in the console cache by name or instance ID before failing. Each cached dump gets an <id>.name sidecar so a name can be resolved; if several dumps share a name, the newest wins. The sidecar is pruned by the same TTL.
  • resolveInstance, recentlyGoneHint and logs' findRecentlyGone now search only the region given by the global --region (through a new listInstancesForLookup seam). Without --region they search every region, as before. This is a behaviour change, so it's listed under Changed.
  • IAM baseline: spawn's own repo has no user-facing baseline policy listing actions. The only action-listing templates are for the reaper, the bot and the portal, and none of those reads console output. So there was nothing to amend here; the umbrella site already lists ec2:GetConsoleOutput as optional. Instead, a denied console read now produces an error that names ec2:GetConsoleOutput.

spawn doctor (#1161)

  • The VPC hint now says --subnet-id.
  • The Route 53 hint says --dns goes through the spore.host DNS updater, and that Route 53 access in the account is needed only to deploy a custom updater.
  • "Nitro fleet" is added to the list of checks skipped when credentials fail.
  • No default VPC: decided as a Warn, not a Fail, when the region has subnets. The probe calls DescribeSubnets and wraps the new doctor.ErrNoDefaultVPC, and the hint tells you to pass --subnet-id on every launch or run aws ec2 create-default-vpc. A region with no subnet at all (or whose subnets can't be listed) still Fails. The reasoning is in a comment in Run and in the CHANGELOG.

spawn footprint (#1161)

Gates. Each was watched failing against a revert that compiles:

  • Removing the cache fallback, or skipping the .name write, fails TestLogsCacheIsReachableAfterEC2ForgetsTheInstance (by-name and by-ID subtests) and TestLogsCacheByNamePicksTheNewest.
  • lookupRegion returning "", or logs passing "", fails TestInstanceLookupsHonourTheGlobalRegion, which counts the calls through the seam.
  • Dropping the denial hint fails TestConsoleReadDenialNamesThePermission.
  • TestSkippedListNamesEveryAWSCheck discovers its expected set from a passing run, so it fails if "Nitro fleet" is dropped.
  • --subnet, or Fail in place of Warn, fails TestVPCHintNamesTheRealFlagAndNoDefaultVPCIsAWarn.
  • The old Route 53 wording fails TestRoute53HintDoesNotClaimDNSBreaks.
  • A single ListRules call fails TestFootprintReadsEveryPageOfRules.
  • Restoring the old cmd/footprint.go fails TestFootprintTextDoesNotCallAMatchedNameABlindSpot, which checks every quoted name in footprintExactNames against the sentence it appears in, plus the two help gates in cmd/footprint_test.go.

Checks. make check passes every step except check-build-tags, which fails the same way on unmodified main here (/private/tmp paths). make gen-docs and check-docs pass, as does semgrep --config=auto --error. Only unexported pkg/aws symbols were added, so the API snapshot doesn't change. Nothing was run against AWS.

@scttfrdmn scttfrdmn added this to the v0.137.0 milestone Oct 20, 2026
@codecov

codecov Bot commented Oct 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 58.55856% with 46 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/logs.go 56.75% 25 Missing and 7 partials ⚠️
pkg/doctor/aws_prober.go 0.00% 6 Missing ⚠️
pkg/aws/footprint.go 69.23% 3 Missing and 1 partial ⚠️
cmd/footprint.go 33.33% 2 Missing ⚠️
cmd/utils.go 77.77% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn force-pushed the fix/1160-1161-logs-doctor-footprint branch from 33ea319 to fcf8d56 Compare October 20, 2026 07:30
@scttfrdmn
scttfrdmn merged commit fe98bf8 into main Oct 20, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the fix/1160-1161-logs-doctor-footprint branch October 20, 2026 07:48
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