Repository navigation
feat: add JSON output to destroy command (#386) - #387
Merged
Merged
Conversation
- Add JsonView and TextView rendering strategies in presentation layer - Add DestroyDetailsData DTO with From<&Environment<Destroyed>> conversion - Update DestroyCommandController::execute to accept OutputFormat - Route --output-format flag from CLI context to destroy controller - Update docs/user-guide/commands/destroy.md with Output Formats section
Add .github/skills/usage/operations/check-system-dependencies/skill.md with instructions for using the dependency-installer package to verify system requirements (OpenTofu, Ansible, LXD, cargo-machete). Register the new skill in the AGENTS.md skills table.
Add .github/skills/usage/operations/install-system-dependencies/skill.md with instructions for installing required system dependencies (OpenTofu, Ansible, LXD, cargo-machete) using the built-in dependency-installer package. Register the new skill in the AGENTS.md skills table.
Member
Author
|
ACK 904e36f |
josecelano
added a commit
that referenced
this pull request
Feb 26, 2026
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.
Closes #386
Summary
Adds
--output-format jsonsupport to thedestroycommand, consistent with the JSON output already available inconfigure,release, andtestcommands (part of EPIC #348).Changes
Feature
DestroyDetailsDataDTO — presentation-layer data transfer object withFrom<&Environment<Destroyed>>conversion;instance_ipisOption<IpAddr>to handle environments destroyed before provisioningJsonView— rendersDestroyDetailsDataas pretty-printed JSON viaserde_jsonTextView— rendersDestroyDetailsDataas the existing human-readable format, with purge hint gated behind text-only outputDestroyCommandController::executenow acceptsOutputFormatand dispatches to the appropriate view using the Strategy Patterncontext.output_format()to the destroy controllerJSON output shape
{ "environment_name": "my-environment", "instance_name": "torrust-tracker-vm-my-environment", "provider": "lxd", "state": "Destroyed", "instance_ip": "10.140.190.39", "created_at": "2026-02-26T17:25:19.775061743Z" }instance_ipisnullwhen the environment was destroyed before being provisioned.Documentation
docs/user-guide/commands/destroy.mdwith an Output Formats section (text + JSON examples, JSON fields reference table)docs/issues/386-add-json-output-to-destroy-command.mdimplementation checklistSkills (bonus)
Two new agent skills added to
.github/skills/usage/operations/:check-system-dependencies— how to usedependency-installer checkto verify all required tools are presentinstall-system-dependencies— how to usedependency-installer installto set up a machine for the first timeBoth skills are registered in
AGENTS.md.Testing
cargo test)cargo run --bin linter all){ "environment_name": "lxd-local-example", "instance_name": "torrust-tracker-vm-lxd-local-example", "provider": "lxd", "state": "Destroyed", "instance_ip": null, "created_at": "2026-02-26T17:25:19.775061743Z" }