Skip to content

sandbox apply: hidden --no-template; keep labels and params called port as strings (into #374) - #375

Merged
davixcky merged 2 commits into
davido/ENG-1187/dry-run-typed-specfrom
davido/ENG-1187/apply-no-template
Sep 25, 2026
Merged

davixcky merged 2 commits into
davido/ENG-1187/dry-run-typed-specfrom
davido/ENG-1187/apply-no-template

Conversation

@davixcky

@davixcky davixcky commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Stacked: #362 ← #373 ← #374 ← this one.

Why

The template language has no escape for a literal @{. So a spec that --dry-run has rendered can't always be rendered again:

$ signadot sandbox apply -f t.yaml --dry-run=client --set 'd=build @{sha} ok' > r.yaml
$ signadot sandbox apply -f r.yaml --dry-run=client
Error: unexpanded variable: sha

The sandbox Action renders once, then validates and applies the result. So any value containing @{ after the first render failed the step: a PR title in description, an @{embed: file} of a Spring config (server.url=@{/login}), or an env value. The Action's correctness audit rated this high.

What

  • New hidden bool flag --no-template: -f is decoded as a finished spec, with no @{…} substitution.
  • --set together with --no-template is refused, because there's nothing to bind.
  • Hidden like --dry-run, for the same reason: the Action is the only caller that needs it while the interface settles.

Also: labels and resource params called port

port2Int turned every string under a key named port into a number, including inside spec.labels and resources[].params, whose keys are the user's own names. So a label or a param called port was refused with cannot unmarshal number into … params of type string. It now skips those two maps, and endpoint ports still convert as before (TestPortKeysInFreeFormMapsStayStrings). Found by the sandbox Action's re-audit.

Tests

  • TestNoTemplateReadsARenderedSpecAsItIs: a value containing @{sha} and @{embed: x} renders once, fails to render a second time without the flag, and with the flag produces byte-identical output.
  • TestNoTemplateRefusesSet
  • TestNoTemplateIsHidden

🤖 Generated with Claude Code

The template language has no escape for a literal @{, so a spec that
--dry-run rendered cannot always be rendered again: a substituted value
containing @{ (a PR title, an embedded Spring config) fails as an
unexpanded variable. --no-template decodes -f without substitution, so
what --dry-run printed can always be applied. The sandbox Action uses it
for every pass after the first render. Hidden, like --dry-run, while
the interface settles; --set with it is refused.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Approved based on a bounded hidden --no-template apply path with tests; default apply behavior is unchanged. Cursor Bugbot and Cursor Security Agent were not running after the first poll, so those signals were skipped, and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

port2Int turned every string under a key named port into a number, so a
sandbox label or a resource param called port was refused: 'cannot
unmarshal number into ... params of type string'. Labels and params are
maps of the user's own names, so do not descend into them. Endpoint
ports still convert as before. Found by the sandbox Action's audit.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@davixcky davixcky changed the title sandbox apply: hidden --no-template to apply a rendered spec as it is (into #374) sandbox apply: hidden --no-template; keep labels and params called port as strings (into #374) Sep 24, 2026
@davixcky
davixcky merged commit 9a676f8 into davido/ENG-1187/dry-run-typed-spec Sep 25, 2026
1 check passed
@davixcky
davixcky deleted the davido/ENG-1187/apply-no-template branch September 25, 2026 17:45
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.

1 participant