Skip to content

fix: align deploy actions with the real deploy-config-schema 0.16.0 CLI#33

Merged
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
fix/deploy-actions-cli-drift
Jul 8, 2026
Merged

fix: align deploy actions with the real deploy-config-schema 0.16.0 CLI#33
jorisjonkers-dev-agents[bot] merged 2 commits into
mainfrom
fix/deploy-actions-cli-drift

Conversation

@jorisjonkers-dev-agents

Copy link
Copy Markdown
Contributor

First real use of deploy-preview (agents-ui pilot) failed: both deploy actions were written against a CLI interface that does not exist in the published package, and preview failures were swallowed.

  • Render invocations used a nonexistent --context-ref flag and passed the deployment file where the CLI takes the deploy dir; corrected to the real interface (render <fragment> <deploy-dir> --env … --images … --context <ref@digest> --context-path <file>), with per-env looping. artifact emit-contract gains the required --deployment/--context arguments and drops the unsupported --schema-version.
  • The actions now pull the context artifact themselves (services never vendor it): a shared find_cluster_context helper locates cluster-context-public.yml in the pulled layout (prefers context/public/, clear E_CONTEXT_FILE_MISSING with a tree listing otherwise). deploy-artifact had the same defect via a hardcoded pull-root path.
  • Preview render/emit failures now fail the check with diagnostics in the scorecard instead of || true; context-pull failure is E_CONTEXT_PULL_FAILED, hard fail.
  • $(… | grep -c '.' || echo 0) produced two-line values that broke [[ arithmetic (grep -c already prints 0); replaced with || true everywhere.
  • Regression tests: a recorded-interface test pins the exact CLI argument shapes both scripts use against a checked-in 0.16.0 spec, and the scripts are sourceable so find_cluster_context is behaviorally tested. 120 tests green.

…0.16.0 interface

Correct all CLI argument drift in actions/deploy-artifact/run.sh and
actions/deploy-preview/run.sh against the real 0.16.0 interface verified
from deploy-config-schema/src/deployment/commands.ts and src/cli.ts.

Changes in deploy-artifact/run.sh:
- render: pass <deploy-dir> as second positional (not deployment.yml path);
  use --context <digest-ref> --context-path <pulled-file> (not --context-dir)
- artifact emit-contract: remove non-existent --schema-version flag; add
  missing required --deployment and --context flags; add --output-root out

Changes in deploy-preview/run.sh:
- render: pass <deploy-dir> as second positional; per-env loop; use
  --context + --context-path instead of non-existent inline context-dir
- artifact emit-contract: same flag fixes as deploy-artifact
- Remove silent `|| true` on render and emit-contract; capture exit status
  and surface failures in scorecard/comment; exit nonzero via
  E_EMIT_CONTRACT_FAILED when rendering is impossible
- Fix `grep -c '.' || echo 0` two-line value bug throughout: capture
  command output separately then use `grep -c || true`

Add regression tests:
- tests/fixtures/deploy-artifact/cli-interface-0.16.0.json: checked-in
  interface spec (positionals, required flags, absent flags per subcommand)
- tests/test_deploy_actions_cli_drift.py: T-CLI1 recorded-interface tests;
  T-CLI2 count-parsing helper (bash-level + static); T-CLI3/T-CLI4 positional
  arg tests; T-CLI5 silent-failure removal tests (22 tests total, all green)

Full suite: 108 tests OK (python -m unittest discover)
…over pulled layout

Service repos never hold the cluster context — the action fetches it by
digest, and the CLI never pulls (--context records the ref, --context-path
reads a local file). The previous preview design wrongly required
cluster-context-public.yml vendored into deploy-dir.

deploy-preview:
- action.yml: install oras and yq before run.sh, reusing the pinned
  deploy-artifact installer (new --only selector)
- run.sh: oras pull "$CONTEXT_REF" into RUNNER_TEMP once; fail loud with
  E_CONTEXT_PULL_FAILED (gate-summary fail) when the pull fails; locate
  cluster-context-public.yml via find_cluster_context; render and
  emit-contract now receive --context "$CONTEXT_REF" --context-path
  <discovered-file> so the recorded ref stays digest-pinned

deploy-artifact:
- run.sh: replace the hardcoded context-pkg/cluster-context-public.yml with
  the same find_cluster_context discovery (validate, render, emit-contract);
  fail loud with E_CONTEXT_FILE_MISSING listing the pulled tree

Shared:
- find_cluster_context prefers a context/public/ match (published layout),
  falls back to any match, returns nonzero on miss
- run.sh files gained a BASH_SOURCE guard so tests can source the helpers
- install-tooling.sh accepts --only <tool,...> (default unchanged: all)

Tests (T-CLI6): oras-pull + fail-loud assertions, no-hardcoded-path
assertions, action tooling step check, and behavioral tests for
find_cluster_context (context/public preference, fallback, miss) executed
against both sourced run.sh files. Preview render interface test now
requires --context + --context-path and forbids --context-dir.

Full suite: 120 tests OK (python -m unittest discover)
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot added the type: bug Something is broken or behaving incorrectly. label Jul 8, 2026
@jorisjonkers-dev-agents jorisjonkers-dev-agents Bot merged commit c77dd90 into main Jul 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something is broken or behaving incorrectly.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant