Repository navigation
fix(plugin): strict launch config and plugin config decoding (#1116) - #1210
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
A missing or unparseable launch --config file, unknown launch.yaml keys (name: instead of ref:, instance_type:), an empty ref and undeclared plugin config keys were all accepted silently; each is now an error.
scttfrdmn
force-pushed
the
fix/plugin-strict-decode
branch
from
October 20, 2026 06:11
939bd8f to
44bf007
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 #1116
Owner decision on #1116: strict decoding is accepted as a behaviour change in this minor release (CHANGELOG
### Changed).What changes:
collectPluginDeclarationsreturns theloadLaunchConfigerror instead of dropping it.buildLaunchConfigcalls it up front, so a bad--configfails before any AWS work on the single, sweep, pipe and--dry-runpaths; the user-data and Windows-guard call sites propagate it too.loadLaunchConfigdecodes withyaml.Decoder.KnownFields(true), so a top-levelinstance_type:/ttl:or aplugins:entry written asname:is an error naming the line, with a hint about the file's shape. An entry with norefis an error naming its index. An empty file is still an empty config.PluginSpec.ResolvedConfigno longer passes undeclared keys through. It rejects them and lists the keys the plugin accepts (or says it declares none). This coversspawn plugin install --config, spored's launch-time install and preflight.Gates, each watched failing against a revert that compiles:
TestCollectPluginDeclarations_BadConfigFileIsAnErrorandTestBuildLaunchConfig_RefusesBadLaunchConfigFilefail when the error is dropped again (if cfg, err := ...; err == nil).TestCollectPluginDeclarations_BadConfigFileIsAnError(name/instance_type/confg cases) fails withKnownFields(false).TestResolvedConfig_RejectsUndeclaredKeysfails with the rejection disabled (&& false).Not changed: spored's launch-time path still only logs a
resolve configfailure. As before for a missing required key, it records no plugin state, sospawn plugin statusshows nothing. The CLI install path surfaces it.Related: the spore-plugins integration workflow passes
auth_keyto tailscale, which declares onlytag(required). It already failed on the missingtag, and now fails onauth_keyas well. Tracked in spore-host/spore-plugins#29.Checks:
make checkpasses up tocheck-build-tags, which fails identically on unmodified main in a /private/tmp worktree. semgrep is clean. No help text changed.