Repository navigation
fix(plugin,agent): failed state for unresolvable launch plugins, login_user for local steps, idle-terminate notification - #1333
Merged
Conversation
This was referenced Oct 26, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…n_user for local steps, idle-terminate notification - spored records a failed plugin state when a launch-time plugin's spec or config does not resolve, so plugin status shows the error (#1226). - Local plugin steps get the same instance.* variables as remote steps, including login_user from spawn:local-username; instance.id is the EC2 ID when resolvable (#1225). - spored's idle terminate sends spore-bot's ttl_expired "has terminated" event once EC2 accepts the terminate (#1205). Fixes #1225 Fixes #1226 Fixes #1205
scttfrdmn
force-pushed
the
fix/1225-1226-1205-plugin-idle
branch
from
October 26, 2026 23:01
8acd307 to
7ac465b
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.
Three fixes: plugin runtime state, the plugin template context, and spored's idle-terminate notification.
#1226: unresolvable launch-time plugin now records a failed state
When a
spawn launchplugin's spec failed to resolve, or its config did (missing required key, undeclared key), spored only logged it, andspawn plugin statussaid "not installed".LoadFromDeclarationsnow saves aStatusFailedstate with the error, through a newrecordDeclarationFailure.plugin statusandplugin listalready showError.LoadFromDeclarationsbeforeInstall, becauseInstallrefuses the config before it records any state. The push-API install path (spawn plugin install) is unchanged. It resolves config on the controller first, and leaving it alone means a bad push can't overwrite a running plugin's state.plugin.ParseRef(ref).Name. A ref that gives no valid store name (e.g. a local path) still only logs.#1225: local steps get the same
instance.*as remote stepspluginInstanceVars(instance, inst)in cmd/plugin.go buildsid,name,ipandlogin_userfor local steps.login_userusesresolveSSHUser(spawn:local-username, else ec2-user), the same sourcespawn connectand spored use.runPluginInstallreuses the instance it already resolved for the Windows guard. The vars go into the local record, so reconcile and deprovision getlogin_usertoo.instance.idis now the EC2 ID when spawn can resolve the instance, matching remote steps. Before, it was the--instancevalue as typed.ec2-user(spore-plugins repo). It can switch once this ships. Follow-up filed there (spore-sync: use {{ instance.login_user }} instead of hardcoded ec2-user (needs spawn with #1225) spore-plugins#32).#1205: idle terminate sends a notification
spore-bot lists no
idle_terminatedevent. Its Slack and Discord formatters keep a case for it only as "legacy", SMS has none, and spawn's vendored list rejects it. Per the brief, this sends the closest listed event:ttl_expired, the bot's only "has terminated" message. It is sent once EC2 has accepted the terminate.terminate()now returns the provider error, and existing callers ignore it.idle_stoppedwas rejected because its SMS offers "Wake instance" for an instance that is gone.idle_terminatedand add an SMS case. After that, spawn re-vendors the list and switches the event; the comment at the call site says so.Gates (each watched failing against a revert that compiles)
TestIdleTerminateIsAnnouncedOnceAccepted:err == nil && false(never notify): the accepted case fails.err == nil || true(notify on failure): the refused case fails.TestLoadFromDeclarations_UnresolvableRecordsFailedState(waits on a Save seam, with a hang guard):recordDeclarationFailureturned into a no-op: all 3 cases fail.&& false): both config cases fail.TestRecordDeclarationFailure_LeavesRunningPluginAlone: dropping the running/degraded guard (&& false) fails it.TestRemoteInstanceVarsMatchTheDocumentedSetandTestPluginInstanceVarsMatchTheDocumentedSet: both discover the{{ instance.* }}keys fromRender's doc comment in pkg/plugin/template.go (and fail on an empty discovery), then hold the remote and the controller context to that set. So the two contexts agree without either test listing the keys.login_useron the controller fails the controller test,TestPluginInstanceVarsLoginUserandTestPluginInstallRecordsLoginUserForTeardown. The last one drivesrunPluginInstalland reads the saved local record._ = loginUseron the remote fails the remote test.Checks
make check: all steps pass, including golangci-lint (0 issues on every module) and the hermetic tests. The exception ischeck-build-tags, which fails only on the /tmp vs /private/tmp path. It passes when run from /private/tmp/spawn-plugin.semgrep scan --config=auto --error .is clean.make check(pkg/taskiam walk racing the root release-tree test overdist/). Filed separately (test flake: TestNoGeneratedPolicyReachesTheStagingBucket walks dist/ while TestReleaseBuildLeavesTheTreeClean creates and removes it #1334).Fixes #1225
Fixes #1226
Fixes #1205