Fix/reject empty service block - #270
Merged
Merged
Conversation
`"my-service": {}` is meaningless on its own — a service with no policy
simply goes unmentioned. In practice it means a declaration was lost
between the file and the registry.
That is not hypothetical. An older CLI serialized the contract without
`volumes:`, so a submit succeeded, the stored contract held an empty
block where the declaration should have been, and the bake reset a volume
the author had asked to keep. Nothing surfaced: not the submit, not the
bake, not the clone — until someone queried the database and noticed the
`{}`.
It happened twice, on two different stacks, for the same reason. The
second time cost another resubmit to discover.
Parsing now rejects it and names the service. The check sits in
`TargetConfigContract`'s deserializer, so it covers the CLI reading a
stacker.yml and the server validating a submitted contract alike.
All four marketplace templates still parse.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
An `env_file` line `commonDomain=` resolves to the empty string rather
than failing, so `domain: "${commonDomain}"` became `domain: ""` and
travelled all the way to the target. There the NPM role posted a proxy
host with no name, NPM rejected it, and because the task is `no_log` the
failure surfaced as a censored error that took the whole deploy down —
after the server had been provisioned (install 4068).
Two places let the blank through, so both are closed:
- `validate_semantics` gains E008: when a proxy is enabled, every
`proxy.domains` entry must carry a domain and a usable upstream. Deploy
already refuses to run on a blocking issue, so this now fails before
any server exists. An empty `domains:` list stays legal — a proxy can
be deployed and configured through its own UI later.
- `build_deploy_form` drops blank domains from `proxy_domains`, and omits
the key entirely when nothing is left to route. A route with no name is
not a route and must never leave the CLI.
The reference's validation table was three codes behind; E005 through
E007 are written down alongside the new E008.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
No description provided.