Try to load manifest during spin build
#2527
Merged
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.
This partly, but only partly, addresses #2520.
With this change,
spin build
attempts to load the full manifest, falling back to the subset only if that fails, and emitting a warning for the non-build-related validation failure. This will catch schema errors such asallowed_outbound_hsots = ...
:HOWEVER.
The problem in #2520 relates to variable name validation, and that does not happen at manifest load, or even lockfile creation, but in the trigger when it tries to resolve the variables. Checking that in the loader would require additional validation logic in the loader, similar to how we validate kebab-ids. Nothing stops us adding that validation logic, but it's not there now, and for this PR I didn't want to extend load-time validation (with who knows what consequences) but only run the existing load-time validation at build time. If we decide to add variable name validation at load time then
spin build
with this PR will inherit it.