Repository navigation
feat!: cloudfall-engine runs on treaty - #4
Merged
Merged
Conversation
The engine's four commands move from argparse to treaty 1.0.0rc4, the first Cloudfall CLI to do so. Every command answers one JSON envelope on stdout, errors included, and `cloudfall-engine manifest` describes each command, flag, and exit code. Engine failures exit with their own codes: 79 PROJECT_INVALID, 80 CONFIG_INVALID, 81 ARTIFACT_BUILD_FAILED, 82 PLAYBOOK_FAILED, with the old snake_case code in error.context.code. A missing playbook, inventory, or role directory, a malformed git ref, and a malformed component id exit 2 before anything runs. Relative paths still land in the project, now joined onto the resolved directory rather than through chdir. Ansible's play log streams to stderr, so stdout holds only the envelope; it still runs through subprocess, because ctx.run can neither stream nor run Ansible under its C locale (romamo/treaty#61, #62). Breaking: `playbook run --check` is `--dry-run`, since treaty recognizes a dry run only by that name (romamo/treaty#63), and `inventory render` puts the inventory under data.inventory; the --output file is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
_cli_lifecycle returned dict[str, object], so every payload["data"][...] in its callers failed mypy with "object is not indexable". Parsed JSON is Any-shaped; typing it so makes CI's type-check pass again, which has failed on main since these tests were written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
Moves
cloudfall-engine's four commands (inventory render,artifact build,playbook list,playbook run) from argparse to treaty 1.0.0rc4, the first Cloudfall CLI to switch. ThecloudfallCLI is untouched.Every command answers one JSON envelope on stdout, errors included (they used to go to stderr in their own shape)
cloudfall-engine manifestdescribes every command, flag, and exit codeEngine failures exit with their own codes, the old snake_case code kept in
error.context.code:PROJECT_INVALIDCONFIG_INVALIDARTIFACT_BUILD_FAILEDPLAYBOOK_FAILEDA missing playbook, inventory, or role directory, a malformed git ref, and a malformed component id exit 2 before anything runs
Ansible's play log streams live to stderr; stdout holds only the envelope
artifact buildandplaybook runreport their effect (created,updated,would_update,noop)Relative paths (
--output tmp/…,--output-dir) still land in the project, now by joining onto the resolved directory instead ofchdirBreaking
playbook run --checkis now--dry-run: treaty recognizes a dry run only by that name (Let a wrapped tool's own flag (--check, --noop) be the command's dry run romamo/treaty#63). atlas-fleet's Taskfile uses--checkin 4 places and needs updating when it bumps its pininventory renderputs the inventory underdata.inventory; the--outputfile is unchanged, so Ansible is unaffectedKnown gaps
treaty auditpasses 54 of 58 rules.gitandansible-playbookstill run throughsubprocessrather thanctx.run, becausectx.runcan't stream a child's output live (romamo/treaty#61) and itsLC_ALL=Cstops Ansible from starting (romamo/treaty#62). Other treaty findings from the port are filed as romamo/treaty#64 to #70.Test plan
uv run pytest: 442 passeduv run ruff check .: cleanuv run mypy: only the 8 existingsdk/tests/test_lifecycle.pyerrors frommain--syntax-checkloop, unchangedplaybook runagainst localhost in dry-run and live mode, and a failing run against unreachable hosts (exit 82)CANCELLEDenvelope, exit 143, and the Ansible process and its remote task stop🤖 Generated with Claude Code