fix: align deploy actions with the real deploy-config-schema 0.16.0 CLI#33
Merged
Merged
Conversation
…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)
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.
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.
--context-refflag 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-contractgains the required--deployment/--contextarguments and drops the unsupported--schema-version.find_cluster_contexthelper locatescluster-context-public.ymlin the pulled layout (preferscontext/public/, clearE_CONTEXT_FILE_MISSINGwith a tree listing otherwise). deploy-artifact had the same defect via a hardcoded pull-root path.|| true; context-pull failure isE_CONTEXT_PULL_FAILED, hard fail.$(… | grep -c '.' || echo 0)produced two-line values that broke[[arithmetic (grep -calready prints 0); replaced with|| trueeverywhere.find_cluster_contextis behaviorally tested. 120 tests green.