github cloudposse/atmos v1.192.0

latest releases: v1.193.0-test.2, v1.193.0-test.1, v1.193.0-test.0...
12 hours ago
feat: add trace log level support for enhanced debugging @osterman (#1525) ## what - Implement a custom logger package that gives us full control over logging behavior and output - Add a new trace log level (TRCE) that provides more detailed logging than debug level - The trace level is implemented as `log.DebugLevel - 1` for maintainability (not hardcoded) - Add `Trace()` and `Tracef()` helper functions for natural API usage - Support trace level in CLI flags, environment variables, and config files - Make logger concurrency-safe using sync/atomic for global instance management

why

  • Full control over logging: By implementing our own logger, we have complete control over formatting, filtering, and output behavior without being constrained by third-party library limitations
  • Foundation for log filtering: This implementation opens the door for future enhancements like secret filtering and redaction in logs, which is critical for safely handling sensitive data in Atmos
  • Enhanced debugging capabilities: The trace level enables extremely verbose debugging output when needed without modifying existing debug statements
  • Consistent behavior: Ensures uniform logging behavior across all Atmos components and provides a stable API for internal use
  • Performance optimization: Direct control allows us to optimize for Atmos-specific use cases and minimize overhead
  • Follows established logging hierarchy: Trace < Debug < Info < Warning < Error

Implementation Details

  • Created dedicated pkg/logger/ package with custom logger implementation
  • Logger is concurrency-safe using sync/atomic for global instance management
  • Added levels.go with TraceLevel constant and helper functions
  • Updated setupLogger in cmd/root.go to use the new logger package
  • Added comprehensive test coverage (94.6%) for logger functionality
  • Trace level works with all existing logging configuration methods:
    • CLI flag: --logs-level=Trace
    • Environment variable: ATMOS_LOGS_LEVEL=Trace
    • Config file: logs.level: Trace

Future Possibilities

With this custom logger implementation, we can now add:

  • Secret filtering and redaction in log output
  • Custom log formatters for different output targets
  • Log routing based on level or content
  • Performance metrics and instrumentation
  • Integration with external logging systems

Testing

  • Comprehensive unit tests in pkg/logger/ with 94.6% coverage
  • Integration tests in cmd/root_test.go
  • Tests verify level hierarchy, visibility filtering, formatted messages, and concurrent safety
  • All tests pass and linting requirements met

references

  • Implements custom log level for Charm Bracelet Log package
  • Follows Go best practices for log level implementation and concurrent safety

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Unified internal logging with true Trace level, persistent log-file support, automatic cleanup on exit/signals, and environment-configurable log destination/level.
  • Bug Fixes

    • Improved Trace/no-color behavior, more reliable log destination handling, cache locking robustness, and Windows atomic-write permission fix.
  • Documentation

    • Rewritten logging and structured-logging guides with level guidance, examples, and semantic keys.
  • Tests

    • Expanded logger unit and integration tests, including cleanup and concurrency coverage.
feat: implement XDG Base Directory specification for cache management @osterman (#1524) ## what
  • Implement XDG Base Directory specification for cache storage to ensure platform-appropriate cache locations
  • Add file locking mechanism to prevent race conditions during concurrent cache access
  • Provide atomic cache updates with UpdateCache() function for safe concurrent modifications
  • Support telemetry disclosure tracking and update checking timestamps in cache

why

  • The previous implementation stored cache files in a non-standard location (.atmos/cache.yaml), which doesn't follow platform conventions for cache data
  • XDG Base Directory specification is the standard for storing application data on Linux, and similar conventions exist for macOS and Windows
  • File locking and atomic updates are necessary to prevent data corruption when multiple Atmos processes access the cache simultaneously
  • Proper cache management improves reliability and follows best practices for cross-platform CLI tools
  • Users have reported issues with .atmos directories being created in unexpected locations when XDG_CACHE_HOME is not set (see #1495)

references

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added an API to atomically update persisted cache and a public, testable "should check for updates" helper.
  • Bug Fixes

    • Respect OS XDG cache location and ensure cache dirs/files are created.
    • Improved concurrency and robustness: platform-aware locking, non-blocking reads under contention, and atomic write/recovery semantics.
    • Better handling and clearer messages for missing or corrupted cache and frequency parsing.
  • Tests

    • Extensive tests for cache persistence, locking/deadlock/timeouts, atomic writes, frequency parsing, and CLI isolation.
  • Chores

    • Added XDG and atomic-rename dependencies; broadened .out ignore rule.
feat: add subprocess coverage collection for tests @osterman (#1526) ## what - Add subprocess coverage collection for tests using Go 1.20+ GOCOVERDIR support - Enable coverage data collection from Atmos binary when executed as subprocess during testing - Replace legacy binary management with smart AtmosRunner helper - Update Makefile with cleaner coverage targets using native `go tool covdata`

why

  • Tests that execute Atmos as a subprocess (most CLI tests) were not contributing to coverage reports
  • The existing binary staleness checking was complex and fragile
  • Go 1.20+ provides native support for subprocess coverage collection via GOCOVERDIR
  • This change provides more accurate coverage metrics by including all code executed during tests

references

Implementation Details

AtmosRunner Helper

Created tests/testhelpers/atmos_runner.go that:

  • Automatically builds Atmos with -cover flag when GOCOVERDIR is set
  • Falls back to using existing binary when coverage isn't needed
  • Manages temporary binary lifecycle
  • Passes GOCOVERDIR to subprocesses transparently

Makefile Changes

  • Updated testacc-cover target to use Go 1.20+ subprocess coverage
  • Uses go tool covdata textfmt to convert binary coverage to text format
  • Automatically merges unit test and subprocess coverage
  • Added helper targets for coverage viewing

Test Infrastructure Refactoring

  • Updated TestMain to use AtmosRunner
  • Replaced all exec.Command calls with atmosRunner.Command
  • Fixed environment variable handling to preserve GOCOVERDIR
  • Removed ~100 lines of binary checking/management code

Benefits

✅ Complete coverage visibility including subprocess execution
✅ No manual binary building required for tests
✅ Cleaner, more maintainable code
✅ CI/CD compatible without changes
✅ Native Go tooling instead of complex bash scripts

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

fix: update GitHub Actions to use explicit tokens and latest versions @osterman (#1527) ## Summary - Update actions/github-script from v7 to v8 (latest version) - Add explicit github-token parameter to prevent API rate limiting - Applies to both pr-sizer and remove-dependabot-semver-labels actions

Why

The PR size labeler and Dependabot label remover actions were using an older version of github-script (v7) and weren't explicitly configuring the GitHub token. This could lead to:

  • API rate limiting issues (60 requests/hour for unauthenticated vs 5,000/hour for authenticated)
  • Missing out on security updates and bug fixes in v8
  • Implicit token usage that isn't clear from reading the action configuration

Changes

  1. Updated actions/github-script@v7 to actions/github-script@v8 in:

    • .github/actions/pr-sizer/action.yml
    • .github/actions/remove-dependabot-semver-labels/action.yml
  2. Added explicit github-token: ${{ github.token }} parameter to both actions to ensure proper authentication

Test Plan

The changes will be tested when this PR is opened, as both actions run on pull request events:

  • The PR size labeler will run and apply appropriate size labels
  • The remove-dependabot-semver-labels action will run (though it won't do anything since this isn't a Dependabot PR)

🤖 Generated with Claude Code

fix: normalize path separators in terraform clean output @osterman (#1523) ## what - Normalize path separators to forward slashes in terraform clean command output - Add static error for symbolic link deletion to satisfy linting requirements

why

  • Windows tests were failing due to path separator mismatches in output
  • The clean command was displaying paths with backslashes on Windows (e.g., basic/components\terraform\mock\.terraform/)
  • Test assertions expected forward slashes, causing failures on Windows CI
  • Using filepath.ToSlash() ensures consistent output across all platforms

references

  • Fixes Windows test failures in CI
  • Addresses path display inconsistency in terraform clean command

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Shows a clear, user-facing error when attempting to delete a symbolic link, preventing unintended deletion.
  • Bug Fixes
    • Standardizes path formatting to forward slashes in delete operations for consistent output across platforms.
    • All success and error messages in delete operations now display normalized paths for clarity.
fix: prevent YAML function concatenation in lists @osterman (#1506) ## what - Fix an issue where YAML functions (like `!terraform.state` and `!terraform.output`) in lists could potentially cause concatenation errors - Clear custom YAML tags after processing to prevent double handling by the YAML decoder - Add comprehensive tests for YAML functions in lists with different return types

why

Users reported an error when using YAML functions in lists:

invalid number of arguments in the Atmos YAML function !terraform.state image1-ecr global repository_arn !terraform.state image2-ecr global repository_arn

The issue occurred because custom YAML tags were being incorporated into node values but the tags themselves weren't being cleared. This could lead to unexpected behavior during YAML decoding, especially when functions appeared in lists.

The fix ensures:

  • Each list item with a YAML function remains separate and independent
  • Functions can return any type (string, map, list, etc.) without type conflicts
  • No concatenation of multiple functions occurs
  • Mixed lists with functions and static values work correctly

references

  • Related to user-reported issue with ECR repository ARNs in lists
  • Fixes YAML function processing to be more robust

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Prevented re-processing of custom YAML tags to avoid unintended concatenation and ensure correct value types.
    • Ensured YAML function values in lists, maps, and nested structures preserve boundaries (no concatenation).
  • Tests

    • Added comprehensive tests covering YAML function return types, list behavior, and execution safety.
    • Added Terraform-based fixtures and stack scenarios to simulate outputs/states.
    • Improved test URL/path handling for cross-platform reliability.
test: fix test isolation issues and improve sandbox testing @osterman (#1512) ## what - Add proper cleanup of Terraform artifacts before and after tests in terraform_test.go to prevent conflicts between test runs - Implement comprehensive sandbox testing framework with component isolation for better test reliability - Move sandbox functionality to testhelpers package to avoid import cycles - Add sandbox option to CLI test configuration for isolated test environments - Clean up terraform state files, lock files, and backend configs between tests - Add test coverage for sandbox creation, cleanup, environment variables, and artifact exclusion - Fix all linting issues and reduce cyclomatic complexity - Remove obsolete demo_enhanced_errors.md file - **Refactor component path computation to be centralized and consistent** - Previously, component paths were computed in multiple places with slightly different logic, leading to potential inconsistencies and test failures when running in sandbox mode

why

  • Tests were failing intermittently due to leftover Terraform artifacts from previous runs
  • Tests would sometimes conflict when running in parallel or repeatedly
  • Import cycles were preventing proper code organization
  • Needed a way to isolate test environments to prevent cross-test interference
  • The demo_enhanced_errors.md file was obsolete and no longer needed
  • Component path computation was duplicated across multiple packages (internal/exec, pkg/component, tests) with subtle differences that could lead to bugs and made the code harder to maintain. Centralizing this logic ensures consistency and makes the codebase more maintainable.

references

  • Fixes test isolation issues discovered during local development
  • Improves test reliability and developer experience when running tests locally
  • Centralizes component path resolution logic for better maintainability

🤖 Generated with Claude Code

refactor: move Atmos functions from Learn to Reference section @osterman (#1503) ## what - Moved all Atmos functions (YAML and Template) from the "Learn Atmos" section to a new top-level "Functions" directory that appears in the "Resources" section of the sidebar - Created a comprehensive functions index page with overview of both function types - Updated all internal documentation links (30+ references) to point to the new locations - Fixed frontmatter IDs for proper Docusaurus integration

why

  • The Atmos functions are reference material, not learning content. They were confusing to find buried deep in the "Learn Atmos" section
  • Users looking for function documentation need quick access to technical specifications, not tutorials
  • This provides clearer separation between conceptual learning materials and technical reference documentation
  • The new structure uses simpler, more intuitive URLs (/functions/yaml/env vs /core-concepts/stacks/yaml-functions/env)

references

  • Addresses the issue discussed about reorganizing documentation to separate learning paths from reference materials
  • Documentation builds successfully with no broken links

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Added a consolidated "Functions" area with a top-level index, separate "YAML Functions" and "Template Functions" sections, and several new function pages (including template and YAML entries).
    • Migrated many internal links to a unified /functions namespace and added extensive redirects to preserve old paths.
    • Updated sidebar structure, ordering, and front-matter metadata (sidebar classes/positions) to improve navigation and presentation.
docs: define the _defaults.yaml design pattern @osterman (#1514) ## what - Add comprehensive documentation for the `_defaults.yaml` naming convention - Create new design pattern document explaining the convention and its benefits - Update existing documentation to clarify that it's a convention, not an Atmos feature - Document import path resolution (base-relative vs file-relative paths)

why

  • Users need to understand why we use this specific naming pattern
  • The underscore prefix provides lexicographic sorting benefits (files appear at top of directory listings)
  • Clarifies that files must be explicitly imported (not automatic)
  • Addresses confusion about what Atmos does vs. what's a human convention

Key Points Documented

The Convention Explained

  • _defaults.yaml is a naming convention, NOT an Atmos feature
  • Atmos has no special knowledge or handling of these files
  • The underscore ensures lexicographic sorting (appears at top of listings)
  • Files are only excluded from stack discovery via excluded_paths configuration

Import Behavior

  • Files must be EXPLICITLY imported - nothing is automatic
  • Two types of import paths:
    • Base-relative: orgs/acme/_defaults (relative to stacks.base_path)
    • File-relative: ./_defaults (relative to current file)

Documentation Added

  1. New Design Pattern: /website/docs/design-patterns/defaults-pattern.mdx

    • Comprehensive explanation of the convention
    • Why it exists (lexicographic sorting, visual distinction)
    • Common misunderstandings clarified
    • Best practices and anti-patterns
    • Real-world examples with import chains
  2. Updated Existing Docs:

    • /website/docs/core-concepts/stacks/imports.mdx - Added import path resolution section
    • /website/docs/cli/configuration/stacks.mdx - Clarified it's a convention
    • /website/docs/design-patterns/organizational-structure-configuration.mdx - Added section on role of _defaults.yaml

references

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Clarified that “_defaults.yaml” is a naming convention (not a product feature), excluded from stack discovery, and requires explicit imports.
    • Added guidance on import path resolution, covering base-relative and file-relative paths with examples.
    • Introduced a comprehensive “_defaults.yaml Design Pattern” guide with best practices, examples, diagrams, and troubleshooting.
    • Expanded organizational structure docs to explain the role of defaults files across hierarchy levels and added cross-links for easier navigation.
fix: resolve Docker Hub rate limit issues in GitHub Actions @osterman (#1511) ## what - Replace Docker-based PR Size Labeler with custom GitHub Script action - Update LocalStack to use AWS ECR Public registry instead of Docker Hub - Add retry logic with exponential backoff for k3s image pulls - Configure Docker daemon to use mirror.gcr.io as a registry mirror for k3s tests

why

  • GitHub Actions jobs were failing due to Docker Hub rate limits when pulling images
  • The PR Size Labeler action was using a Docker-based action that required pulling from Docker Hub
  • LocalStack and k3s images were being pulled directly from Docker Hub without any fallback mechanism
  • These failures were blocking CI/CD pipelines and preventing PRs from being properly tested

Solution Details

Custom PR Size Labeler

  • Created .github/actions/pr-sizer/ - a custom GitHub Action using GitHub Script API
  • Eliminates Docker Hub dependency completely
  • Maintains all original functionality (size labels, file ignoring, configurable thresholds)

LocalStack Updates

  • Updated docker-compose.yml to use public.ecr.aws/localstack/localstack:1.4.0
  • Modified GitHub workflow to pull directly from ECR Public
  • AWS ECR Public has no rate limits for anonymous pulls

K3s Resilience

  • Added Docker daemon configuration to use mirror.gcr.io as a registry mirror
  • Implemented retry logic with exponential backoff (30s, 60s, 90s) for image pulls
  • Pre-pulls images before Docker Compose starts to ensure availability

Test Plan

  • PR Size Labeler action correctly labels this PR based on size
  • LocalStack test job successfully pulls image from ECR Public
  • K3s test job successfully pulls images (with retry if needed)
  • All CI checks pass without Docker Hub rate limit errors

references

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a configurable PR Size Labeler that auto-labels PRs by size (XS–XL), supports custom thresholds and ignore rules, and can optionally fail on XL.
  • Chores

    • CI workflows updated to use the local PR size labeling action and preserved ignore patterns.
    • Switched LocalStack images to the AWS Public ECR registry in CI and demo.
    • Minor YAML formatting cleanups.
feat: add YAML/JSON validation to smoke tests @osterman (#1497) ## what - Added structured output validation to smoke tests to ensure stdout contains properly formatted YAML or JSON - Implemented `valid` field in test expectations that can specify `["yaml"]` or `["json"]` format validation - Added validation to existing test cases that output structured data

why

  • Historically had problems where informational output pollutes standard output, leading to corrupt structured data
  • Current tests only check for keywords or golden snapshots, which can miss injected strings that break parsing
  • Need proper deserialization validation to ensure outputs remain machine-parseable for automation and tooling

Changes

  • Test Structure Updates (tests/cli_test.go):

    • Added Valid []string field to Expectation struct
    • Implemented verifyYAMLFormat() and verifyJSONFormat() validation functions
    • Integrated validation into test runner after existing pattern matching
  • Schema Update (tests/test-cases/schema.json):

    • Added valid property with enum values ["yaml", "json"]
  • Test Case Updates - Added validation to:

    • demo-stacks.yaml: describe config commands (JSON/YAML)
    • atmos-cli-imports.yaml: configuration import tests (YAML)
    • indentation.yaml: indentation test (YAML)
    • relative-paths.yaml: describe stacks command (YAML)

Testing

All modified test cases pass successfully:

go test -v ./tests -run "TestCLICommands/atmos_describe_config"
go test -v ./tests -run "TestCLICommands/atmos_stacks_with_relative_paths"
go test -v ./tests -run "TestCLICommands/indentation"

references

  • Implements structured output validation as requested
  • Backward compatible - existing tests without valid field continue working unchanged
  • Provides clear error messages with context when validation fails

🤖 Generated with Claude Code

fix: prevent duplicate file deletions in atmos terraform clean @osterman (#1510) ## what - Fixed duplicate file deletion attempts in `atmos terraform clean` command that occur when multiple stacks reference the same component - Added deduplication logic to prevent the same component path from being processed multiple times - Added unit test to verify the fix

why

Users were experiencing intermittent errors where atmos terraform clean would attempt to delete the same files twice:

✓ Deleted project-name/components/terraform/vnet-elements/.terraform/
✓ Deleted project-name/components/terraform/vnet-elements/vnet-elements-eastus-prd-vnet-elements.terraform.tfvars.json
✓ Deleted project-name/components/terraform/vnet-elements/vnet-elements-eastus-prd-vnet-elements.planfile
✓ Deleted project-name/components/terraform/vnet-elements/.terraform.lock.hcl
✓ Deleted project-name/components/terraform/vnet-elements/backend.tf.json
x Cannot delete project-name/components/terraform/vnet-elements/.terraform/: path does not exist
x Cannot delete project-name/components/terraform/vnet-elements/vnet-elements-eastus-prd-vnet-elements.terraform.tfvars.json: path does not exist
x Cannot delete project-name/components/terraform/vnet-elements/vnet-elements-eastus-prd-vnet-elements.planfile: path does not exist
x Cannot delete project-name/components/terraform/vnet-elements/.terraform.lock.hcl: path does not exist
x Cannot delete project-name/components/terraform/vnet-elements/backend.tf.json: path does not exist

This happened because when multiple stacks (e.g., dev, staging, prod) reference the same component (e.g., vnet-elements), the getAllStacksComponentsPaths function would collect duplicate component paths. The clean command would then try to delete the same files multiple times - succeeding on the first attempt and failing on subsequent attempts.

The fix ensures each unique component path is only processed once, regardless of how many stacks reference it.

references

  • Fixes user-reported issue with duplicate deletion attempts in atmos terraform clean

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Deduplicates component paths aggregated across multiple stacks to avoid repeated processing, reduce redundant logs, and improve stability during cleanup.
  • Tests

    • Added unit, integration, and end-to-end tests verifying deduplication when multiple stacks reference the same components.
    • Expanded deletion tests to cover file/directory removals, handling of missing files, refusal of symlink deletions, and ensuring no duplicate deletions occur.
    • Included a skipped placeholder for a future filesystem-dependent integration test.
docs: convert CLI command documentation from tables to definition lists @osterman (#1505) ## what - Convert 21 CLI command documentation files from markdown tables to HTML definition lists - Update all flags and arguments sections to use semantic `
`, `
`, `
` tags - Maintain full consistency with project documentation standards

why

  • Tables are not the recommended format for documenting flags and arguments in our documentation
  • Definition lists provide better semantic HTML structure
  • This change aligns with the documentation guidelines specified in CLAUDE.md
  • Improves consistency across all CLI command documentation

Changes Made

Files Updated (21 total)

  • atlantis/atlantis-generate-repo-config.mdx
  • aws/aws-eks-update-kubeconfig.mdx
  • completion.mdx
  • describe/describe-component.mdx
  • describe/describe-config.mdx
  • describe/describe-stacks.mdx
  • describe/describe-workflows.mdx
  • helmfile/helmfile-generate-varfile.mdx
  • helmfile/usage.mdx
  • list/list-components.mdx
  • list/list-stacks.mdx
  • pro/pro-lock.mdx
  • pro/pro-unlock.mdx
  • terraform/terraform-plan-diff.mdx
  • validate/validate-component.mdx
  • validate/validate-editorconfig.mdx
  • validate/validate-schema.mdx
  • validate/validate-stacks.mdx
  • vendor/vendor-pull.mdx
  • version.mdx
  • workflow.mdx

Conversion Details

  • 26 tables converted: 17 flags tables, 8 arguments tables, 1 exit codes table
  • Format preserved: All descriptions, links, code blocks, and HTML formatting maintained
  • No content lost: Every description preserved in full without abbreviation
  • Consistent structure: All flags/arguments now use the same definition list format

Example Conversion

Before (table format):

| Flag          | Description                              | Alias | Required |
|:--------------|:-----------------------------------------|:------|:---------|
| `--component` | Atmos component to lock                 | `-c`  | yes      |
| `--stack`     | Atmos stack to lock                     | `-s`  | yes      |

After (definition list format):

<dl>
  <dt>`--component` <em>(alias `-c`)</em> <em>(required)</em></dt>
  <dd>Atmos component to lock.</dd>

  <dt>`--stack` <em>(alias `-s`)</em> <em>(required)</em></dt>
  <dd>Atmos stack to lock.</dd>
</dl>

references

  • Follows documentation requirements specified in CLAUDE.md
  • Implements consistent definition list format across all CLI documentation
  • No functional changes, documentation-only update

Summary by CodeRabbit

  • Documentation
    • Standardized CLI docs by replacing table-based Arguments and Flags with definition lists, adding explicit (required)/(optional) labels, inline aliases, and refined wording/punctuation for many commands.
    • Improved consistency across Atlantis, AWS EKS, Completion, Describe, Helmfile, List, Pro, Terraform plan-diff, Validate, Vendor, Version, and Workflow.
    • Added a new --everything vendor option and an extra "component" item in describe-stacks; added an installation tip on the version page.
    • No functional or behavioral changes.
fix: add missing Dependabot labels @osterman (#1508) ## what - Add missing `dependencies` and `go` labels to `.github/settings.yml` - These labels are required by Dependabot configuration but were not defined in the repository

why

  • Dependabot was failing to create pull requests because it couldn't find the required labels
  • The error message indicated: "The following labels could not be found: dependencies, go"
  • Adding these labels will allow Dependabot to properly label its pull requests for dependency updates

references

  • Fixes Dependabot label creation errors shown in PR comments

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Added new repository labels for PRs: “dependencies” and “go” to improve categorization.
    • Updated coverage settings: added project-level status with auto target from base branch, allowed up to 1% coverage drop, and set success if base coverage is unavailable; patch coverage target remains at 80%.
feat: Atmos List Instances, Pro Upload @milldr (#1254) ## what

New command for atmos list instances

Includes option for --upload

  • If --upload, send the result to Atmos Pro

New arg for atmos terraform plan, --upload-status

  • Upload the result of a Terraform plan to Atmos Pro

Other changes:

This pull request introduces new functionality for uploading Terraform plan results and Atmos instances to the Pro API, improves error handling throughout the codebase, and refactors several areas for clarity and maintainability. The most notable changes are the addition of status upload logic for Terraform plans, new error definitions for Pro API interactions, and the creation of a new command for listing Atmos instances. Below are the key changes grouped by theme.

Pro API Integration and Terraform Plan Status Upload:

  • Added logic to upload Terraform plan results to the Pro API, including a new uploadStatus function and a flag (upload-status) for the plan command in cmd/terraform_commands.go and internal/exec/pro.go. This enables reporting of plan status and drift detection to the Pro API. [1] [2]
  • Implemented the shouldUploadStatus function to determine when status should be uploaded, based on command type and component settings.

Error Handling Improvements:

  • Added comprehensive new error definitions for Pro API client, exec, and list package errors in errors/errors.go, and refactored error wrapping to provide more context throughout the exec logic. [1] [2] [3] [4] [5] [6]

Atmos Instances Listing Command:

  • Introduced a new list instances command in cmd/list_instances.go to list Atmos instances and optionally upload them to the Pro API. This includes flag handling and integration with the existing list command structure.

API Client Construction Refactoring:

  • Refactored API client construction to remove the logger dependency, simplifying calls to NewAtmosProAPIClientFromEnv and related usage in internal/exec/describe_affected.go and internal/exec/pro.go. [1] [2] [3] [4]

Minor Codebase Cleanups:

  • Removed unused imports and improved import ordering in multiple files, such as cmd/cmd_utils.go, cmd/terraform_commands.go, and internal/exec/describe_affected.go. [1] [2] [3]

These changes collectively improve the reliability, maintainability, and feature set of the Atmos CLI, especially around integration with the Pro API and error visibility.

why

We want to build drift detection into Atmos Pro. In order to do this, we need to upload an object similar to the describe affected object. This object needs specific component instances for specific stacks

With atmos list instances --upload, we can find all component and stacks with drift detection and upload to Atmos Pro

With atmos terraform plan --upload-status, we can return the result of whether or not there is drift to AP

references

screenshots

Summary by CodeRabbit

  • New Features

    • New "list instances" command (TTY table + CSV) with optional upload of Pro-enabled instances and per-instance status uploads; plan command adds an upload-status flag.
  • Improvements

    • Pro uploads include run ID and Git SHA, use consistent HTTP timeouts, and yield clearer error/log messages.
    • Expanded schema/config support for Pro workflows, Atlantis, commands, markdown and vendor components; new Atmos‑Pro fixtures and templates.
  • Bug Fixes

    • List output now prefers nested vars when generating columns.
  • Tests

    • Many new unit/integration tests and updated golden snapshots for list and Pro flows.
fix: disable pager mouse interactions and add global --pager flag @osterman (#1430) ## Summary - Fix mouse text selection in pager by removing mouse motion tracking - Change pager to be disabled by default (was enabled) - Add global `--pager` flag with smart parsing (true/false/command) - Add new color configuration field and environment variable support - Comprehensive documentation and testing

Breaking Changes

⚠️ Pager is now disabled by default

  • Previous behavior: Pager enabled by default
  • New behavior: Pager disabled by default
  • Migration: Add pager: true to atmos.yaml or use --pager flag

Test Plan

  • Run atmos describe stacks --pager to verify pager enables
  • Run atmos describe stacks to verify pager is disabled by default
  • Test mouse text selection works in pager
  • Test ATMOS_PAGER=true atmos describe stacks enables pager
  • Test --pager=false explicitly disables pager
  • Run test suite: go test ./pkg/pager/... ./pkg/schema/... ./pkg/config/...

Changes

  • Fixed mouse interaction issue in pager (pkg/pager/pager.go)
  • Added global --pager flag to all commands (cmd/root.go)
  • Changed default pager behavior to disabled
  • Added color field to terminal settings (pkg/schema/schema.go)
  • Added support for ATMOS_COLOR and COLOR environment variables
  • Created comprehensive global flags documentation (website/docs/cli/global-flags.mdx)
  • Added extensive unit tests for all changes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added global --pager flag to enable/disable or specify a pager; paging is disabled by default.
    • Introduced terminal color setting (color: true by default); --no-color and NO_COLOR/ATMOS_NO_COLOR still supported. no_color in config is deprecated.
    • Default log level changed to Warning for less noisy output.
  • Bug Fixes
    • Improved Windows reliability by increasing file retry/backoff delays.
  • Documentation
    • Updated terminal/configuration docs and added a Global Flags page; help now documents --pager.
feat: convert Purpose admonitions to Intro components in documentation @osterman (#1501) ## what - Replace all `:::note Purpose` blocks with `` tags across documentation files - Add import statements for the Intro component where needed - Update 30 MDX files in the cli/commands directory

why

  • Standardize the documentation format by using the dedicated <Intro> component for purpose descriptions
  • Provide better semantic markup and consistency across the documentation
  • The <Intro> component is specifically designed for introductory content, making it more appropriate than generic note admonitions
  • Improve maintainability by using purpose-built components rather than generic admonitions

references

  • All links and formatting within the converted content have been preserved
  • No functional changes to the documentation content, only the markup format

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation
    • Standardized command pages by replacing note blocks with a unified Intro component across CLI docs for AWS, Terraform, Helmfile, Validate, Vendor, Pro, Describe, List, Workflow, Version, and Docs sections.
    • Improved readability and visual consistency of introductions without altering content meaning.
    • Expanded a description to explicitly mention “component and stack” for added clarity.
    • No changes to CLI behavior or public interfaces.

Don't miss a new atmos release

NewReleases is sending notifications on new releases.