github cloudposse/atmos v1.201.0-rc.3

latest releases: v1.201.0, v1.201.0-test.4, v1...
pre-releaseone day ago
feat: Add default value support for custom command flags @osterman (#1848) ## what
  • Add default field to CommandFlag schema to support default values for both boolean and string flags
  • Boolean flags can now default to true (previously always defaulted to false)
  • Update flag registration in Cobra to use configured defaults
  • Add comprehensive documentation with usage patterns for boolean flags in bash and Go templates

why

Enable custom commands to have special behavior triggers without requiring unnecessary flag values. Users can define type: bool flags with default: true to handle cold start edge cases more cleanly.

references

Closes #1847

Summary by CodeRabbit

  • New Features
    • Custom commands now support configurable default values for boolean and string flags, allowing defaults to be preserved during flag registration
    • Boolean flags can be set to default true or false; string flags can have explicit default values
    • Added comprehensive documentation, blog posts, and usage examples for boolean flag patterns in templates and conditional execution

✏️ Tip: You can customize this high-level summary in your review settings.

🚀 Enhancements

Fix and redesign Atmos workflows @aknysh (#1849) ## what
  • Fixed quoted argument parsing bug: Workflow commands with quoted arguments (e.g., --query '.metadata.component == "gcp/compute/v0.2.0"') are now parsed correctly using shell.Fields() instead of strings.Fields(), which was incorrectly splitting on spaces within quotes
  • Redesigned workflow execution architecture: Introduced interface-based dependency injection for testability and maintainability:
    • Created new pkg/workflow/ package with clean separation of concerns
    • Added CommandRunner, AuthProvider, UIProvider interfaces for dependency injection
    • Created Executor struct that orchestrates workflow execution with injected dependencies
    • Added adapter layer in internal/exec/workflow_adapters.go to bridge interfaces with existing code
    • Reduced Execute function from 6 parameters to 1 (*WorkflowParams struct) to comply with argument-limit linter rules

why

  • Quoted argument bug: Users reported that workflow commands with complex query expressions containing spaces and quotes were being parsed incorrectly, causing command failures. The fix uses proper shell parsing that respects quote boundaries.
  • Architecture redesign: The previous workflow execution code was difficult to test without spawning real processes. The new interface-based design enables:
    • Unit testing with mocks (generated via go.uber.org/mock/mockgen)
    • Clear separation between workflow orchestration logic and execution details
    • Better maintainability through smaller, focused components
    • Compliance with golangci-lint rules (argument-limit, hugeParam, etc.)

references

  • Uses mvdan.cc/sh/v3/shell for proper shell argument parsing
  • Follows Atmos architectural patterns: interface-driven design, dependency injection, mock generation

Summary by CodeRabbit

  • New Features

    • Modular workflow executor with resume support and --from-step to restart from a specific step
    • Improved command parsing to preserve quoted arguments
  • Improvements

    • Clearer failure messages with contextual hints and resume commands
    • Better authentication and environment handling during workflow runs
  • Chores

    • Bumped multiple dependencies
  • Tests

    • Expanded test coverage for workflows, parsing, auth, and resume behaviors

✏️ Tip: You can customize this high-level summary in your review settings.

Don't miss a new atmos release

NewReleases is sending notifications on new releases.