Repository navigation
fix(upgrade-spored): tags-only refusal names a real spored for non-spawn launchers (#1423) - #1424
Merged
Merged
Conversation
…n-spawn launchers (#1423) spawn:version is the launching spawn's version only when spawn:created-by is spawn; spawn-ts writes its own library version there (e.g. 0.7.0), for which no spored exists. Otherwise name spawn:spored-version, else the frozen tags-reading spored 0.149.0 (#1419), and say which. spawn:created-by now has a reader, so it leaves the tag contract's readOutsideThisRepo allowlist.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 #1423
launchConfigUpgradeGuard's tags-only refusal (#1420) told the user to pin--version <spawn:version>. Only spawn writes its own version there: spawn-ts writesspawn:created-by=spawn-tsand its library version (e.g. 0.7.0), for which no spored exists.New
tagsReadingSpored(tags)picks the spored to name, and the message says which source it used:spawn:version, only whenspawn:created-byisspawn(spored is versioned in lockstep with spawn). This is the same hint as before for spawn-launched instances.spawn:spored-version, which spored reports itself.sporedinstall.FrozenLatestVersion(0.149.0), the last spored that reads the settings from tags (spawn ≤ v0.148.x installs the latest spored, so v0.150.0's spored ignores the launch settings those CLIs write as tags (#1359) #1419).A candidate that isn't a MAJOR.MINOR.PATCH release (e.g. a
devspawn:version), or that is at or abovelaunchconfig.FirstSporedVersion(and so reads only the object), is skipped.Values written to
spawn:created-by. On instances spawn writes onlyspawn(pkg/aws/tags.go).spawn reaper deployis written on the reaper Lambda, not on instances, and the IAM and bot values are on other resources. lagotto and spore-host-mcp launch through spawn's pkg/launcher and pkg/tasklaunch, so they writespawn, and they don't setCallerVersion, so they write nospawn:versionat all. Those instances fall back to step 2 or step 3, where before the message said "--version its launching spawn's version". spawn-ts writesspawn-ts.Other code that reads
spawn:version. None of it derives a spored or bootstrap version from it:spawn statusandsporedUpgradeNoticeusespawn:spored-version.cmd/reaper_skew.go,pkg/reaperdeploy) reads the Lambda's ownspawn:versiontag.pkg/aws/ami_mgmt.goreads the AMI's version tag, and image provenance copies the tag as provenance.spawn:created-bynow has a reader, soTestSpawnTagContractrequired removing it from thereadOutsideThisRepoallowlist.Gates (
TestUpgradeSporedTagsOnlyHintNamesARealSpored), each watched failing against a revert that compiles:--version 0.149.0and never--version 0.7.0. Againstcmd/upgrade_spored.goreverted to main, the hint was--version 0.7.0, so it FAILED on both assertions. A second case uses spored-version 0.141.2 to show the tag is actually read.--version 0.142.0. This passes on main, as a preservation gate should. Against a mutant fix that ignores thecreated-by == spawnbranch, the hint was--version 0.141.2, so it FAILED.--version 0.149.0. Against main the hint was "--version its launching spawn's version", so it FAILED. Adevspawn:version also falls back. Against main it was--version dev, whichupgradeSporedTargetwould reject.Checks:
make checkandmake lintpass from /private/tmp (0 issues in 10 modules).semgrep scan --config=auto --error .is clean.