Skip to content

Conversation

@InfiniteTabs
Copy link
Member

@InfiniteTabs InfiniteTabs commented Oct 6, 2025

This pull request introduces significant enhancements to the CLI, primarily by adding a new gitops command group for manifest diffing, improving the flexibility of claim operation commands (plan, apply, destroy) with new flags for following execution and storing output files, and refactoring the execution-following logic for broader use. The changes improve automation support (e.g., for CI/CD and GitHub Actions), user experience, and code maintainability.

Major new features and improvements:

GitOps support and manifest diffing:

  • Added a new gitops command group with a diff subcommand, enabling detection and structured reporting of manifest changes between two git references. This supports both local workflows and CI/CD (e.g., GitHub Actions) by outputting JSON describing the required actions (plan, apply, destroy, rename) for each manifest. (cli/src/commands/gitops.rs, cli/src/main.rs, cli/Cargo.toml)

Enhanced claim command flexibility:

  • Updated plan, apply, and destroy commands to support new flags: --store-files (to save output files), --follow (to follow operation progress), and --destroy (for planning destroy operations). These flags improve automation and user feedback. (cli/src/main.rs, cli/src/commands/claim.rs)

Execution following refactor and improvements:

  • Refactored the plan-following logic into a generalized follow_execution function, now supporting plan, apply, and destroy operations, and providing output suitable for file storage. (cli/src/plan.rs, cli/src/lib.rs, cli/src/commands/claim.rs)

Improved branch detection for automation:

  • Added robust logic to detect the current and default git branches, supporting both local and CI/CD environments by checking environment variables and falling back to git commands. This ensures correct behavior of the gitops diff command in automated pipelines. (cli/src/commands/gitops.rs, cli/src/main.rs)

User experience and error handling:

  • Improved error and warning messages for incorrect flag usage (e.g., requiring --follow when storing files), and clarified command usage for end users. (cli/src/commands/claim.rs)

@InfiniteTabs InfiniteTabs added the enhancement New feature or request label Oct 6, 2025
@InfiniteTabs InfiniteTabs force-pushed the fix/add-cli-gitops-command branch 6 times, most recently from 5cdef02 to ec8f17a Compare October 23, 2025 20:30
@InfiniteTabs InfiniteTabs force-pushed the fix/add-cli-gitops-command branch from ec8f17a to b8c6e1d Compare October 25, 2025 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants