Repository navigation
Show the release command in the deploy and rollback plans (#120) - #136
Conversation
deploy without --yes now shows the component's release command as
releaseCommand: its command, the working directory resolved under the new
release directory, the timeout (300 by default) and the release server, or
null when the component declares none, and its wouldRun says the command
runs once on that server before any switch. A rollback never runs the
command; its plan says so and adds releaseCommandSkipped: true.
releaseCommand is declared in the output contract with its named
properties, so treaty writes a missing one as null rather than as {}. This
is S-005's last build issue, so the spec is now built, with its
Verification filled in.
Fixes #120
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@romamo Decided without waiting: the deploy plan prints Why: S-005-8 asks the plan to show where the command runs, and the absolute path is the one the engine uses. Snake_case is how every existing output key is written ( Reply with a comment starting with |
|
@romamo Decided without waiting: Why: S-005-8 and S-005-9 ask for exactly these keys, and every existing key and caller behaves as before. Reply with a comment starting with |
Summary
Shows S-005's release command in the plans (
docs/specs/005-release-command.md), criteria S-005-8 and S-005-9. It was the spec's last build issue, so the spec is nowstatus: built, with its Verification filled in.deploywithout--yesaddsreleaseCommandto its plan (release_commandon the wire, like every snake_cased data key):command,workingDirectoryresolved to the absolute path on the server (<installRoot>/releases/<release>, or the declaredworkingDirectoryunder it, the pathrelease_command.ymlpasses to--working-directory),timeoutSeconds(300 when not declared) andserver(the release server,deployment.servers[0]). For a component withoutreleaseit isnull.wouldRunadds that the command runs once on that server before any server switchesrollbackwithout--yes, for a component that declaresrelease, addsreleaseCommandSkipped: trueand itswouldRunsays the release command is not run. For a component without one the key isnull, since treaty writes every schema key on every answerrollback.ymlincludes the role'stasks/rollback.yml, which includes onlyhealth_gate.yml.release_command.ymlis included fromtasks/main.ymlalone. No fix was neededcommands.pydeclaresreleaseCommand(deploy plan) andreleaseCommandSkipped?(rollback plan).releaseCommandgets named properties through a newKEY_PROPERTIEStable, so treaty treats it as a closed object and writes a missing one asnullinstead of the{}thatnone_as_emptywrites for an open object. The--schemaoutput and the MCP tools that come from these commands pick it up from the same place. The change only adds keyslifecycle.ReleaseCommandPlan, plus two defaulted fields onLifecyclePreview(release_command,release_command_skipped)Fixes #120
Part of #88
Test plan
sdk/tests/test_release_command_plan.py:deployplan showsrelease_commandwith the resolved working directory, the default and the declared timeout, and serverh2fordeployment.servers: [h2, h1]; it showsnullfor a component withoutreleaseansible-playbookin plan mode": the CLI points at a stand-in engine whosedeploy.yml/rollback.ymlonly write a marker file on the controller. After the plan runs there is no marker and no rendered inventory. A control run with--yeson the same engine does leave the markerrollbackplan showsrelease_command_skipped: true, ornullwithoutrelease. A check of the tasks finds no release command task inrollback.ymlor anything it includesdeploy/rollback--schemaoutput schemas declare the new keys (release_commandas a nullable closed object)preview_deploy/preview_rollback)uv run ruff check .,uv run mypy,uv run cloudfall config validate --project config/examples,specs.py check, andspecs.py coverage --spec 005(every S-005 criterion lists a test), plus tests of the touched files and their neighbours:test_release_command_plan.py,test_lifecycle.py,test_app.py,test_commands.py,test_agent_server.py,test_operator.py,test_domains_converge.py,test_inventory.pyandengine/tests/test_release_command.py, all passing. No Ansible files changed, so ansible-lint was not run. The full suite is left to CIPlan
specs.py coverage --spec 005now lists a test for S-005-1 to S-005-11)🤖 Generated with Claude Code