Repository navigation
fix(dns,cost): honour --profile when signing; dns help and dns delete tags (#967, #1159) - #1228
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ete removes its tags spawn dns register/delete signed the updater request through dns.NewClient, which loads the ambient chain, and spawn cost's pricer did the same, so --profile/SPORE_PROFILE reached neither (#967). Both now use the config the command loaded through the shared loader (dns.NewClientWithConfig, cost.NewClient(cfg)). A discovered gate keeps cmd off every exported pkg/ function that loads the ambient config. spawn dns --help listed its subcommands (and spawn --help listed status) with blank descriptions; the dns long text claimed names register only with --dns. spawn dns delete now removes every spawn:dns-* tag instead of blanking spawn:dns-name, and docs/custom-dns.md no longer claims spawn status prints the registered status (#1159). Fixes #1159 Fixes #967
scttfrdmn
force-pushed
the
fix/1159-967-dns-cli
branch
from
October 20, 2026 08:31
acfec46 to
87a1afe
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes for
spawn dnsandspawn cost: they now honour--profile, the help text is fixed, anddns deletecleans up all its tags.#967:
--profilereaches the signature.spawn dns registerandspawn dns deleteresolved the instance with a client that honours--profile, then signed the updater request throughdns.NewClient, which loads the ambient chain.dns.NewClientWithConfig(awsClient.Config(), …).dns.NewClientstays as-is for spored and delegates to it.cost.NewClientnow takes the command'saws.Configand builds both the sweep-table client and the on-demand pricer from it. Before, the pricer lazily loaded the ambient chain (with its own --account / SPORE_ACCOUNT is accepted but never checked (only spawn doctor reads it) #1118 check). The cfg comes fromloadAWSConfig, so the shared loader's account guard applies.cost.NewClient's signature changed. pkg/cost isn't in the API snapshot, and nothing outside spawn calls it (checked across ~/src/spore-host).#1159: help text,
dns deletetags, and the docs claim.updateCommandDescriptionsnow appliesspawn.dns.{list,register,delete}.short. They existed in libs but were never used.spawn statuswith a blank Short. It has no i18n key, so the Short is set in code.spawn dns's long text is now spawn's own (dnsLongHelp). libs'spawn.dns.longis wrong in en/es/ja/pt: it says names register "with --dns flag" and givesdns deletea DNS name. Filed as i18n: spawn.dns.long says names register 'with --dns flag' and dns delete takes a name (en/es/ja/pt); no spawn.status keys libs#60, so spawn can go back to the i18n key once it's fixed.spawn dns deletenow removes everyspawn:dns-*tag on the instance with the newaws.Client.DeleteInstanceTags: name, domain, endpoint, and spored's status/error. Before, it setspawn:dns-name=""(still a tag) and left the rest.spawn statusshowsspawn:dns-status: registered. It says what status prints and how to read the tag. The page's account IDs are spore.host's own infra account (the deploy script's real default) and AWS-doc placeholders, so I left them.Gates (each watched failing against a compiling revert)
TestDNSDeleteSignsWithTheProfileAndRemovesTheDNSTagsruns the real root commandspawn dns delete <id> --yes --profile otheragainst Substrate, through a recording proxy.--profile otherhas its own keys in a temp AWS config; the environment holds different ones. The updater is served locally by swapping only the transport of the command's own DNS client.LoadDefaultConfig→ FAIL ("signed by TESTAMBIENT…").TestCostPricesWithTheProfilerunsspawn cost sw-967 --profile otherwith a seeded sweep. The GetItem and the Price ListGetProductscall must both be signed by the profile. Revert: the pricer loads the ambient config → FAIL.TestEveryCommandHasAShortDescriptionwalks the whole cobra tree after i18n init. It fails if discovery finds nothing, and also checks that the dns long help mentions--name.i18n.T("spawn.dns.long")→ FAIL.TestCommandsCallNoAmbientPkgLoaderextends Make spawn burst and every other command honour --region and --profile (#939) #966's gate one level into pkg/, as the issue suggested. It discovers every exported top-level pkg/ function that callsLoadDefaultConfigwithout explicit credentials, excluding the three shared loaders (a 3-entry list, because they apply the profile through an options slice the AST can't see). Package cmd may reference none of them. Revert: a compilingvar _ = dns.NewClientin cmd → FAIL. Limitation, stated in the test: one level only. It would not have found pkg/cost's unexported pricer, which the behaviour test covers.Checks
make checkpasses every step exceptcheck-build-tags, which fails identically on unmodified origin/main on this machine.make check-docsandsemgrep scan --config=auto --error .are clean.make api-snapshotis regenerated (additions only in pkg/aws). The cmd SDK-import allowlist droppedcost.go: dynamodb, which its own gate required.Not verified
Nothing was run on AWS.
Merge note: this touches the same
docs/custom-dns.mdsection and## [Unreleased]as #1218, so whichever merges second needs a mechanical rebase (make changelog-fixfor the CHANGELOG).Fixes #1159
Fixes #967