Skip to content

Fix/reject empty service block - #270

Merged
vsilent merged 2 commits into
devfrom
fix/reject-empty-service-block
Sep 24, 2026
Merged

vsilent merged 2 commits into
devfrom
fix/reject-empty-service-block

Conversation

@vsilent

@vsilent vsilent commented Sep 24, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

robotizeit and others added 2 commits September 23, 2026 21:32
`"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>
@vsilent
vsilent merged commit 90f4b2f into dev Sep 24, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants