Add auth console command for web console access @osterman (#1684)
## what - Add `atmos auth console` command to open cloud provider web consoles using authenticated credentials - Implement AWS console access via federation endpoint (similar to aws-vault login) - Add 100+ AWS service destination aliases for convenient access - Create dedicated `pkg/http` package for HTTP client utilities - Add pretty formatted output using lipgloss with Atmos theme colors - Consolidate browser opening functionality to existing `OpenUrl` helperwhy
- Provides convenient browser access to cloud consoles without manually copying credentials
- Eliminates context switching between terminal and browser for console access
- Uses provider-native federation endpoints for secure temporary access
- Extensible interface pattern supports future Azure/GCP implementations
features
- Service Aliases: Use shorthand like
s3
,ec2
,lambda
instead of full console URLs - Autocomplete: Shell completion for destination and identity flags
- Session Control: Configurable duration (up to 12 hours for AWS) with expiration display
- Clean Output: URL only shown on error or with
--no-open
flag - Scriptable:
--print-only
flag for piping URLs to other tools - Provider-Agnostic: Interface design ready for multi-cloud support
implementation
- Created
ConsoleAccessProvider
interface inpkg/auth/types/interfaces.go
- Implemented
ConsoleURLGenerator
for AWS using federation endpoint - Added
ResolveDestination()
with case-insensitive alias lookup - Moved HTTP utilities from
pkg/utils
to dedicatedpkg/http
package - Used existing
OpenUrl()
function for cross-platform browser opening - Added comprehensive tests achieving 85.9% coverage
testing
- Unit tests for console URL generation (15 test cases)
- Unit tests for destination alias resolution (100+ aliases tested)
- Mock HTTP client for testing without network calls
- Table-driven tests with edge case coverage
documentation
- CLI reference:
website/docs/cli/commands/auth/console.mdx
- Blog post:
website/blog/2025-10-20-auth-console-web-access.md
- Proposal document:
docs/proposals/auth-web-console.md
- Embedded markdown usage examples
references
- Similar to aws-vault's console login feature
- AWS Federation Endpoint: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html
Summary by CodeRabbit
-
New Features
- Added atmos auth console: opens cloud provider web consoles via temporary sign-in URLs (AWS supported now; Azure/GCP planned).
- Supports service aliases (s3, ec2, etc.), full destination URLs, session duration (AWS up to 12h), issuer, --print-only, --no-open and identity selection/completion.
-
Documentation
- New CLI docs, usage guide, PRD and blog post with examples and troubleshooting.
-
Tests
- Expanded tests and CI snapshots for the new command and destination resolution.
fix: Only log verbose test output on failure @osterman (#1704)
## what - Replace unconditional `t.Log()` calls with `t.Cleanup()` handlers that only output verbose YAML/data when tests fail - Eliminate noisy stderr output during successful test runs while preserving debug information when tests fail - Add fallback to raw data output (`%+v`) when YAML conversion produces empty stringswhy
- CI test runs were showing verbose YAML dumps to stderr even when tests passed
- This cluttered test output and made it difficult to identify actual issues
- Debug information is still valuable when tests fail, but shouldn't appear during successful runs
- Go's
t.Log()
always outputs to stderr, regardless of test success/failure
demo
Finally clean output!
go mod download
Running tests with subprocess coverage collection
ok github.com/cloudposse/atmos 7.020s coverage: 14.8% of statements in ./...
ok github.com/cloudposse/atmos/cmd 7.581s coverage: 20.7% of statements in ./...
ok github.com/cloudposse/atmos/cmd/about 0.134s coverage: 0.1% of statements in ./...
ok github.com/cloudposse/atmos/cmd/internal 0.099s coverage: 0.1% of statements in ./...
? github.com/cloudposse/atmos/cmd/markdown [no test files]
ok github.com/cloudposse/atmos/cmd/version 1.802s coverage: 1.4% of statements in ./...
ok github.com/cloudposse/atmos/errors 0.213s coverage: 0.4% of statements in ./...
ok github.com/cloudposse/atmos/internal/aws_utils 0.120s coverage: 0.1% of statements in ./...
ok github.com/cloudposse/atmos/internal/exec 84.175s coverage: 32.9% of statements in ./...
ok github.com/cloudposse/atmos/internal/terraform_backend 32.223s coverage: 0.9% of statements in ./...
github.com/cloudposse/atmos/internal/tui/atmos coverage: 0.0% of statements
github.com/cloudposse/atmos/internal/tui/components/code_view coverage: 0.0% of statements
ok github.com/cloudposse/atmos/internal/tui/templates 0.125s coverage: 0.5% of statements in ./...
github.com/cloudposse/atmos/internal/tui/templates/term coverage: 0.0% of statements
ok github.com/cloudposse/atmos/internal/tui/utils 0.218s coverage: 0.2% of statements in ./...
github.com/cloudposse/atmos/internal/tui/workflow coverage: 0.0% of statements
ok github.com/cloudposse/atmos/pkg/atlantis 1.434s coverage: 10.3% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth 0.141s coverage: 2.1% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/cloud/aws 0.113s coverage: 0.8% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/credentials 0.316s coverage: 0.9% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/factory 0.141s coverage: 0.2% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/identities/aws 0.139s coverage: 1.7% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/list 0.138s coverage: 1.5% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/providers/aws 0.098s coverage: 1.6% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/providers/github 0.072s coverage: 0.3% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/providers/mock 0.133s coverage: 0.1% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/types 0.075s coverage: 0.2% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/utils 0.099s coverage: 0.0% of statements in ./...
ok github.com/cloudposse/atmos/pkg/auth/validation 0.150s coverage: 0.7% of statements in ./...
ok github.com/cloudposse/atmos/pkg/aws 0.199s coverage: 2.4% of statements in ./...
ok github.com/cloudposse/atmos/pkg/component 0.898s coverage: 10.1% of statements in ./...
ok github.com/cloudposse/atmos/pkg/component/mock 0.178s coverage: 0.4% of statements in ./...
ok github.com/cloudposse/atmos/pkg/config 3.247s coverage: 5.7% of statements in ./...
ok github.com/cloudposse/atmos/pkg/config/homedir 0.073s coverage: 0.2% of statements in ./...
ok github.com/cloudposse/atmos/pkg/convert 0.048s coverage: 0.0% of statements in ./...
ok github.com/cloudposse/atmos/pkg/datafetcher 0.228s coverage: 0.2% of statements in ./...
ok github.com/cloudposse/atmos/pkg/describe 29.214s coverage: 13.2% of statements in ./...
ok github.com/cloudposse/atmos/pkg/downloader 1.115s coverage: 1.6% of statements in ./...
ok github.com/cloudposse/atmos/pkg/filematch 0.135s coverage: 0.3% of statements in ./...
github.com/cloudposse/atmos/pkg/filesystem coverage: 0.0% of statements
ok github.com/cloudposse/atmos/pkg/filetype 0.078s coverage: 0.4% of statements in ./...
ok github.com/cloudposse/atmos/pkg/generate 0.685s coverage: 7.7% of statements in ./...
ok github.com/cloudposse/atmos/pkg/git 0.164s coverage: 0.3% of statements in ./...
ok github.com/cloudposse/atmos/pkg/github 2.462s coverage: 0.4% of statements in ./...
ok github.com/cloudposse/atmos/pkg/hooks 0.264s coverage: 7.5% of statements in ./...
ok github.com/cloudposse/atmos/pkg/list 2.193s coverage: 12.0% of statements in ./...
ok github.com/cloudposse/atmos/pkg/list/errors 0.073s coverage: 0.1% of statements in ./...
ok github.com/cloudposse/atmos/pkg/list/flags 0.072s coverage: 0.1% of statements in ./...
ok github.com/cloudposse/atmos/pkg/list/format 0.119s coverage: 0.6% of statements in ./...
ok github.com/cloudposse/atmos/pkg/list/utils 0.187s coverage: 0.2% of statements in ./...
ok github.com/cloudposse/atmos/pkg/logger 0.161s coverage: 0.3% of statements in ./...
ok github.com/cloudposse/atmos/pkg/merge 0.227s coverage: 1.7% of statements in ./...
ok github.com/cloudposse/atmos/pkg/pager 0.076s coverage: 0.9% of statements in ./...
ok github.com/cloudposse/atmos/pkg/perf 1.238s coverage: 0.5% of statements in ./...
ok github.com/cloudposse/atmos/pkg/pro 0.177s coverage: 0.8% of statements in ./...
ok github.com/cloudposse/atmos/pkg/pro/dtos 0.051s coverage: 0.0% of statements in ./...
ok github.com/cloudposse/atmos/pkg/profiler 1.861s coverage: 0.4% of statements in ./...
ok github.com/cloudposse/atmos/pkg/provenance 0.130s coverage: 1.8% of statements in ./...
ok github.com/cloudposse/atmos/pkg/retry 0.176s coverage: 0.2% of statements in ./...
ok github.com/cloudposse/atmos/pkg/schema 0.070s coverage: 0.3% of statements in ./...
ok github.com/cloudposse/atmos/pkg/spacelift 0.787s coverage: 8.4% of statements in ./...
ok github.com/cloudposse/atmos/pkg/stack 0.346s coverage: 4.3% of statements in ./...
ok github.com/cloudposse/atmos/pkg/store 0.139s coverage: 1.7% of statements in ./...
ok github.com/cloudposse/atmos/pkg/telemetry 0.518s coverage: 2.7% of statements in ./...
github.com/cloudposse/atmos/pkg/telemetry/mock coverage: 0.0% of statements
ok github.com/cloudposse/atmos/pkg/ui/heatmap 0.129s coverage: 0.9% of statements in ./...
ok github.com/cloudposse/atmos/pkg/ui/markdown 0.138s coverage: 0.4% of statements in ./...
? github.com/cloudposse/atmos/pkg/ui/theme [no test files]
ok github.com/cloudposse/atmos/pkg/utils 0.743s coverage: 4.8% of statements in ./...
ok github.com/cloudposse/atmos/pkg/validate 1.354s coverage: 14.5% of statements in ./...
ok github.com/cloudposse/atmos/pkg/validator 0.116s coverage: 0.2% of statements in ./...
ok github.com/cloudposse/atmos/pkg/vender 3.308s coverage: 3.9% of statements in ./...
ok github.com/cloudposse/atmos/pkg/version 0.069s coverage: 0.0% of statements in ./...
ok github.com/cloudposse/atmos/pkg/xdg 0.046s coverage: 0.1% of statements in ./...
ok github.com/cloudposse/atmos/tests 174.022s coverage: 14.3% of statements in ./...
ok github.com/cloudposse/atmos/tests/testhelpers 90.419s coverage: 1.1% of statements in ./...
Coverage report generated: coverage.out
references
- Affects 9 test files with 29 cleanup handlers added
- Modified files:
pkg/component/component_processor_test.go
pkg/describe/describe_affected_test.go
pkg/describe/describe_component_test.go
pkg/describe/describe_dependents_test.go
pkg/describe/describe_stacks_test.go
pkg/list/list_components_test.go
pkg/merge/merge_test.go
pkg/spacelift/spacelift_stack_processor_test.go
pkg/stack/stack_processor_test.go
π€ Generated with Claude Code
Add linter rule for missing defer perf.Track() calls @osterman (#1698)
## what - Added new `perf-track` linter rule to catch missing `defer perf.Track()` calls - Enabled by default with explicit package and type exclusions - Integrated with existing lintroller custom linter frameworkwhy
- Enforces coding guidelines requiring performance tracking on all public functions
- Catches violations early in development before code review
- Prevents missing perf tracking that would be tedious to find manually
- Uses explicit exclusions for infrastructure code (logger, profiler, perf, store, ui, tui)
references
- Follows coding guidelines in
CLAUDE.md
for mandatorydefer perf.Track()
usage - Addresses hundreds of potential violations by catching them at lint time
- Exclusions prevent infinite recursion and avoid tracking overhead in low-level code
π€ Generated with Claude Code
Summary by CodeRabbit
-
New Features
- Added a lint rule that enforces a defer-based performance-tracking call at the start of exported functions/methods; enabled by default with a config toggle to disable.
-
Tests
- Added unit tests and example cases demonstrating compliant and non-compliant exported functions/methods for the new rule.
-
Documentation
- Updated lint configuration docs to mention the new performance-tracking check and its settings.
Add condition to skip Docker build for prerelease @goruha (#1700)
## what * Add condition to skip Docker build for prereleasewhy
- Exclude prerelease versions from Homebrew workflows
Summary by CodeRabbit
- Chores
- Build workflow updated so Docker image build/push steps are skipped for prerelease releases.
- Dependency review job runner specification changed to a composite runner configuration with additional runner attributes.
feat: Add `atmos auth shell` command @osterman (#1640)
## what - Add `atmos auth shell` command to launch an interactive shell with authentication environment variables pre-configured - Implement shell detection that respects `$SHELL` environment variable with fallbacks to bash/sh - Add `--shell` flag with viper binding to `ATMOS_SHELL` and `SHELL` environment variables - Support `--` separator for passing custom shell arguments to the launched shell - Track shell nesting level with `ATMOS_SHLVL` environment variable - Propagate shell exit codes back to Atmos process - Set `ATMOS_IDENTITY` environment variable in the shell sessionwhy
- Users need an easy way to work interactively with cloud credentials without manually managing environment variables
- Similar to
atmos terraform shell
, this provides a consistent experience for authenticated sessions - Allows running multiple commands in a single authenticated session without re-authenticating
- Supports custom shell configurations and arguments for flexibility
references
- Similar to existing
atmos terraform shell
command implementation - Follows authentication patterns from
atmos auth exec
andatmos auth env
testing
- Comprehensive unit tests with 80-100% coverage on testable functions
- 25 passing tests covering:
- Shell detection and fallback logic (100% coverage)
- Environment variable management (100% coverage)
- Shell nesting level tracking (83-100% coverage)
- Exit code propagation (tested with codes 0, 1, 42)
- Flag parsing and viper integration
- Cross-platform support (Unix and Windows)
- All linting checks passing (0 issues)
- Pre-commit hooks passing
documentation
- Added
website/docs/cli/commands/auth/auth-shell.mdx
with full command documentation - Created
cmd/markdown/atmos_auth_shell_usage.md
with usage examples - Includes purpose note, usage patterns, examples, and environment variable reference
Summary by CodeRabbit
-
New Features
- Interactive authenticated shell with shell selection, argument passthrough, nested-shell tracking, and identity selection.
- Pluggable credential storage: system, file (path/password) and memory backends selectable via config/env.
- Deterministic mock auth provider for testing.
-
Documentation
- New auth-shell docs, usage examples, blog posts, keyring-backends guide, XDG docs, and PRD.
-
Tests
- Expanded unit/integration coverage for shell flows, keyring backends, XDG, and credential stores.
-
Chores
- Added keyring-related dependencies, CI/workflow and tooling adjustments.
Improve auth login with identity selection @osterman (#1655)
## what- Modified the
auth login
command to automatically prompt for an identity when no--identity
flag is provided. - This leverages the existing
authManager.GetDefaultIdentity()
which handles interactive selection and fallback logic. - Updated documentation to reflect this new behavior.
why
- Users were prompted to manually select an identity in interactive sessions when no default was set.
- This change simplifies the login process by automatically invoking the interactive selector or using the default identity when available, improving user experience and reducing manual input.
references
- No specific issue linked - this is a user experience enhancement.
Replace deny-licenses with allow-licenses and remove redundant workflow @osterman (#1692)
## what - Delete redundant `.github/workflows/dependabot.yml` workflow file - Update `dependency-review.yml` to use `allow-licenses` instead of deprecated `deny-licenses` parameter - Maintain PR commenting functionality with `comment-summary-in-pr: always` - Allow only permissive licenses: MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, MPL-2.0, 0BSD, Unlicense, CC0-1.0why
- GitHub deprecated the
deny-licenses
parameter in favor ofallow-licenses
for better security posture - The
dependabot.yml
workflow was redundant - we already havedependency-review.yml
that provides more comprehensive dependency review - Using an allow-list approach is more secure than a deny-list approach
- Consolidating to a single dependency review workflow reduces maintenance overhead
references
Summary by CodeRabbit
- Chores
- Implemented a 2-week minimum age requirement for automated dependency updates
- Updated dependency review workflow to enforce permissive open-source licenses only
- Consolidated dependency management configurations
Compress CLAUDE.md and add size limit enforcement @osterman (#1693)
## what - Compressed CLAUDE.md from 40.3k chars to 6.3k chars (84% reduction) - Added GitHub action to enforce 40k character limit on CLAUDE.md - Refactored into reusable composite action patternwhy
- Large CLAUDE.md files impact performance and token usage
- Need automated enforcement to prevent file bloat
- Reusable action pattern improves maintainability
Compression Details
Metrics:
- Size: 40,300 chars β 6,301 chars (84.4% reduction)
- Lines: 1,183 β 165 (86.0% reduction)
- Current usage: 15% of 40k limit
Techniques Applied:
- Removed verbose explanations, kept terse requirements
- Consolidated redundant examples
- Merged related sections
- Preserved all MANDATORY rules
What's Preserved:
β
All MANDATORY requirements
β
Code patterns and conventions
β
Error handling strategies
β
Testing requirements
β
CLI command structure
β
Development workflows
β
Cross-platform compatibility rules
β
Git and PR guidelines
GitHub Action Structure
.github/
βββ actions/
β βββ check-claude-md-size/
β βββ action.yml # Composite action with all logic
β βββ README.md # Action documentation
βββ workflows/
βββ claude.yml # Simple 16-line workflow
Action Features:
- Validates file size on PR changes
- Posts/updates intelligent PR comments
- Fails CI if limit exceeded
- Configurable file path and size limit
- Provides outputs: size, exceeds-limit, usage-percent
Triggers:
- Pull requests modifying CLAUDE.md
- Changes to workflow or action files
references
- Follows composite action best practices
- Pattern similar to existing actions in the ecosystem
- Maintains consistency with project's CI/CD approach
Summary by CodeRabbit
-
New Features
- Automated CLAUDE.md size validation with configurable limits; posts and updates PR comments when limits are exceeded or resolved.
-
Documentation
- Reworked CLAUDE.md to emphasize architecture and mandatory design patterns instead of granular step-by-step procedures.
- Added user-facing documentation for the CLAUDE.md size-check action and its usage.
Add auth logout command @osterman (#1656)
## whatThis pull request introduces the atmos auth logout
command, enabling users to securely remove locally cached credentials. The command supports:
- Identity-specific logout: Removes credentials for a given identity and its entire authentication chain.
- Provider-specific logout: Removes all credentials associated with a particular provider.
- Interactive mode: Prompts the user to select what to logout when no arguments are provided.
- Dry-run mode: Previews what would be removed without making changes.
- Comprehensive cleanup: Deletes credentials from the system keyring and provider-specific files (e.g., AWS credentials).
- Best-effort error handling: Continues cleanup even if individual steps fail, reporting all encountered errors.
why
This feature addresses several key pain points:
- Security: Allows users to securely remove stale credentials, reducing the risk of unauthorized access.
- Developer Experience: Simplifies switching between different identities or environments by providing a clean way to remove existing credentials.
- Compliance: Enables auditing of credential removal and ensures adherence to security policies.
- Troubleshooting: Provides a straightforward method to clear authentication caches when debugging.
The implementation uses native Go operations for file system cleanup and integrates with go-keyring
for cross-platform credential store access. It leverages Charmbracelet libraries for a polished interactive user experience and styled output.
references
closes #735
Summary by CodeRabbit
Release Notes
-
New Features
- Added
atmos auth logout
CLI command to remove stored credentials - Supports logout by identity, by provider, or all identities at once
- Interactive mode to select which credentials to remove
- Dry-run mode to preview credential removals without executing
- Browser session warning displayed after successful logout
- Added
-
Documentation
- Added guides and reference documentation for logout workflows and usage
Replace custom license-check with GitHub dependency-review-action @osterman (#1690)
## what- Replaced custom license-check action (308 lines) with GitHub's native
dependency-review-action
- Simplified workflow from 44 lines to 18 lines with better functionality
- Added automated NOTICE file generation and validation to CI
- Workflow now:
- Validates licenses using GitHub's dependency graph
- Blocks PRs with forbidden licenses (GPL, AGPL, etc.)
- Generates NOTICE file using
go-licenses
- Fails CI if NOTICE file is out of date
why
- Reduce maintenance burden: GitHub's native action requires zero maintenance vs custom bash fighting
go-licenses
bugs - Better reliability: Native GitHub solution works across all ecosystems, not just Go
- Automated NOTICE updates: Ensures NOTICE file stays in sync with dependencies automatically
- Clearer error messages: Developers get actionable feedback when NOTICE file needs updating
- Industry standard: Uses same tooling as thousands of other repositories
references
- GitHub dependency-review-action
- google/go-licenses - Still used for NOTICE generation
- Replaces
.github/actions/license-check/
(264 lines) and custom workflow (44 lines)
Troubleshooting Notes
autofix.ci Artifact Upload Errors (RESOLVED)
Error encountered:
Attempt 4 of 5 failed with error: Unexpected token 'O', "Original A"... is not valid JSON
Error: Failed to CreateArtifact: Failed to make request after 5 attempts
Root Cause:
When using RunsOn self-hosted runners with extras=s3-cache
, the runs-on/action@v2
step is required for artifact uploads to work. Without it, the artifact API receives HTML error pages instead of JSON responses.
Fix Applied:
- Added
runs-on/action@v2
as first step in autofix.yml (required for S3 cache compatibility) - Added
permissions: { contents: read, actions: write }
(was empty{}
which grants NO permissions) - Upgraded autofix-ci/action from v1.3.1 to v1.3.2
Reference:
- RunsOn S3 Cache Documentation
- Key quote: "If you have enabled the
s3-cache
extra and are using theactions/upload-artifact@v4
action in your workflows, you must ensure that you have also included theruns-on/action@v2
action in your jobs."
Time saved for future developers: ~2 hours of debugging π―
Summary by CodeRabbit
-
New Features
- Added automatic dependency license review to flag restricted licenses (GPL, LGPL, AGPL) on pull requests.
- Added vulnerability severity checks to the dependency review process.
- Introduced comprehensive NOTICE file documenting all third-party dependencies and their licenses.
-
Documentation
- Added documentation for license generation utilities and scripts.
Add Component Registry Pattern and Mock Component @osterman (#1648)
## whatThis Pull Request introduces the Component Registry Pattern to Atmos, enabling extensible support for various component types. It lays the foundation for adding new infrastructure tools as plugins in the future.
Key changes include:
- ComponentProvider Interface: A new interface defining the contract for all component providers.
- Component Registry: A thread-safe global registry to manage component providers.
- Mock Component Provider: A proof-of-concept implementation for testing the registry and component lifecycle without external dependencies. It demonstrates inheritance, merging, and cross-component dependencies.
- Hybrid Configuration Schema:
pkg/schema/schema.go
is updated to support both statically defined built-in component types (Terraform, Helmfile, Packer) and dynamically registered plugin types via thePlugins
map. - Sentinel Errors: New sentinel errors related to component providers and configurations are added to
errors/errors.go
. - JSON Schema Updates: Schemas in
pkg/datafetcher/schema/
are modified to allow additional properties for component types, accommodating the hybrid configuration. - Developer Guide: A new markdown file
docs/developing-component-plugins.md
is added, detailing how to create new component plugins.
why
The existing hardcoded approach for component types (Terraform, Helmfile, Packer) limits extensibility and maintainability. This PR introduces a more robust and flexible pattern:
- Extensibility: Allows easy addition of new component types (e.g., Pulumi, CDK, CloudFormation) without modifying core Atmos code.
- Plugin Support: Paves the way for external component plugins in future phases.
- Testability: The mock component enables thorough testing of the registry pattern, configuration inheritance, and dependency resolution without requiring external tools or cloud provider access.
- Consistency: Adopts a pattern similar to the existing command registry, promoting a unified architectural approach.
- Maintainability: Centralizes component logic within providers, reducing code duplication and improving clarity.
- Backward Compatibility: Existing configurations and functionality remain unaffected. The hybrid schema ensures existing component types continue to work seamlessly while introducing the new pattern.
- Enhanced Testing: Introduces specific test coverage requirements (90%+) for the registry and mock component, including thread-safety and edge-case testing.
references
closes #589
closes #600
closes #601
Summary by CodeRabbit
-
New Features
- Adds a component registry, plugin-style component support, and a mock provider for testing; components can now be discovered at runtime and report available commands.
- Component configuration now accepts dynamic plugin entries (new Plugins field) for greater flexibility.
-
Documentation
- New developer guide for building component plugins, a registry migration pattern, and expanded development requirements and best practices.
-
Tests
- Comprehensive registry and mock-provider test suites and updated CLI snapshot to show Plugins field.
Fix blog post ordering and add explicit dates @osterman (#1689)
## what - Add explicit `date:` field to all blog post frontmatter for consistent ordering - Fix welcome post date to 2025-10-12 so it appears first in the changelog - Fix chdir post filename and date to 2025-10-19 (actual PR merge date) - Add `` markers to chdir and pager posts for proper summaries - Remove duplicate `index.md` that was causing routing conflictswhy
- Blog posts were displaying in incorrect chronological order
- Some posts were missing truncate markers, causing warnings during build
- Welcome post should appear first as it introduces the changelog
- Duplicate index.md was causing Docusaurus routing conflicts
references
- Fixes blog post ordering issues identified by user
Summary by CodeRabbit
- Documentation
- Added new blog posts covering Atmos authentication, provenance tracking, command registry patterns, AWS SSO verification, version list commands, and authentication tutorials.
- Updated blog post on pager default behavior with migration guidance and configuration instructions.
- Enhanced blog content metadata and organization.
Add license check workflow @osterman (#1680)
## what- Added a GitHub Actions workflow (
.github/workflows/license-check.yml
) to automatically audit Go project dependencies for license compliance. - This workflow triggers on pull request events (opened, synchronize, reopened) that affect
go.mod
,go.sum
, or the workflow file itself. - It also includes scheduled runs (weekly on Mondays) and manual dispatch for flexibility.
- A new script (
scripts/check-licenses.sh
) was introduced to perform the actual license check usinggo-licenses
. - The script checks for "forbidden" license types and generates a summary report.
- The generated CSV report from
go-licenses report
is now uploaded as a GitHub Actions artifact.
why
- To proactively identify and prevent the introduction of dependencies with problematic licenses (e.g., GPL, AGPL) into the project.
- Automates the license auditing process, reducing manual effort and the risk of oversight.
- Ensures compliance with licensing requirements, especially important for open-source and commercial projects.
- The CI integration provides immediate feedback on PRs affecting dependencies.
- Uploading the report as an artifact allows for easy review of detailed license information.
references
Summary by CodeRabbit
- Chores
- Added automated license compliance checks that run on pull requests, weekly, and on demand, producing a downloadable CSV license report retained for 30 days.
- Added a license-audit workflow and scanning script that installs/checks the scanner as needed, handles known edge cases, summarizes license distribution, and emits clear pass/fail results.
Add atmos auth list command with multiple output formats @osterman (#1645)
## what - Add new `atmos auth list` command to list all configured authentication providers and identities - Support multiple output formats: table (default), tree, JSON, YAML, Graphviz, Mermaid, and Markdown - Implement filtering by providers or identities with optional name filtering - Add comprehensive documentation and usage exampleswhy
- Users need visibility into their authentication configuration to understand providers, identities, and their relationships
- Multiple output formats enable different use cases: interactive CLI (table/tree), automation (JSON/YAML), and documentation (Graphviz/Mermaid)
- Visual formats help understand complex authentication chains where identities assume roles through providers or other identities
references
- Implements feature request for authentication configuration visibility
- Follows existing Atmos patterns for command structure and output formatting
Summary by CodeRabbit
-
New Features
- Added an auth list command to view providers and identities with flexible filtering and multiple output formats (table, tree, JSON, YAML, Graphviz, Mermaid, Markdown)
- Added chain visualization outputs (graph/mermaid/markdown) for easier relationship tracing
-
Bug Fixes
- Support expanded tilde (~) paths for the CLI chdir flag
-
Documentation
- Comprehensive CLI docs, usage guide, and blog post added
-
Tests
- Extensive unit tests and format/diagram validation added
Update mockgen to go.uber.org/mock @osterman (#1681)
## what- Replaced the usage of the archived
github.com/golang/mock
withgo.uber.org/mock
. - Updated all import paths from
github.com/golang/mock/gomock
togo.uber.org/mock/gomock
. - Updated all
//go:generate mockgen
directives to usego run go.uber.org/mock/mockgen@v0.6.0
(pinned version for reproducible builds). - Regenerated all mock files with the pinned version.
- Added a lint rule in
.golangci.yml
to disallow usage ofgithub.com/golang/mock
. - Configured
.golangci.yml
to exclude generated mock files (mock_*.go
) from godot linter checks.
why
github.com/golang/mock
is an archived repository and should no longer be used.go.uber.org/mock
is the maintained successor.- Pinning to
@v0.6.0
ensures reproducible builds across different environments. - This change ensures the project uses actively maintained dependencies and prevents accidental use of the deprecated library through a new lint rule.
references
- closes #123
Fix go install compatibility by removing replace directive @osterman (#1685)
## what - Remove `replace` directive from `go.mod` that breaks `go install github.com/cloudposse/atmos@latest` - Update Atmos internal code to import from `pkg/config/homedir` directly instead of via replaced module path - Remove `go.mod` from `pkg/config/homedir` (no longer needed as separate module) - Add regression test `TestGoModNoReplaceDirectives` to prevent future breakage of `go install` compatibilitywhy
- The
replace
directive introduced in v1.195.0 (PR #1631) breaks a documented installation method go install cmd@version
intentionally does not support modules withreplace
orexclude
directives- This is a fundamental design decision in Go (golang/go#44840, #69762, #50698) that won't be changed
- Users attempting
go install github.com/cloudposse/atmos@latest
get errors and cannot install - Breaking this installation path creates user friction and support burden
tradeoffs
What we're giving up
The replace
directive was added to ensure all transient dependencies (16+ packages) use Atmos's improved fork of the deprecated mitchellh/go-homedir
package instead of the archived original.
Unfortunately, we must accept that transient dependencies will use the deprecated package because:
- There's no way to force transient dependencies to use our fork without
replace
- We can't publish our fork as
github.com/mitchellh/go-homedir
(we don't own that domain) - Requiring all 16+ transient dependencies to update their imports is not feasible
What we're keeping
- Atmos's own code still uses the improved
pkg/config/homedir
implementation with better error handling, refactoring, and security annotations - The deprecated
mitchellh/go-homedir
package has no known security vulnerabilities (verified via Snyk) - The package is stable (last commit 2019, archived July 2024 as feature-complete, not broken)
The decision
Restoring go install
compatibility is more important than forcing transient dependencies to use our improved fork. The deprecated package works fine, and Atmos's direct usage still benefits from our improvements.
testing
- Added
TestGoModNoReplaceDirectives
to catch future regressions - Verified
go build
succeeds - Verified all existing tests pass
- Verified binary runs correctly with
./atmos version
references
- Original PR that introduced the
replace
directive: #1631 - User report: Slack thread from Jonathan Rose
- Go issues on
replace
directive limitation: golang/go#44840, golang/go#69762, golang/go#50698
Replace mitchellh/mapstructure with go-viper/mapstructure @osterman (#1678)
## what- Replaced direct usage of the archived
github.com/mitchellh/mapstructure
withgithub.com/go-viper/mapstructure/v2
. - Added a
replace
directive ingo.mod
to force all transitive dependencies that usegithub.com/mitchellh/mapstructure
to instead use the maintainedgithub.com/go-viper/mapstructure
fork (v1.6.0).
why
- The
mitchellh/mapstructure
library has been archived, meaning it will no longer receive updates or security patches. github.com/go-viper/mapstructure/v2
is the actively maintained and recommended fork, ensuring continued support and bug fixes.- Using the
replace
directive ensures that even indirect dependencies use the supported fork, eliminating reliance on the archived library.
references
- closes #123
Summary by CodeRabbit
- Chores
- Updated internal dependency management to use go-viper/mapstructure v2 instead of the previous mapstructure implementation across the codebase for improved compatibility and maintenance.
Add spinner and TTY dialog for AWS SSO auth @osterman (#1653)
## what- Enhances the AWS SSO authentication flow by introducing a visually appealing, interactive terminal dialog using the
charmbracelet
library. - Displays a colored, bordered dialog box in TTY environments showing the AWS SSO verification code and instructions.
- Integrates an animated spinner to indicate when the system is waiting for authentication.
- Gracefully degrades to plain text output in non-TTY environments (e.g., CI pipelines) to ensure compatibility.
why
- Improved User Experience: The charmbracelet dialog provides a more engaging and informative user experience during the AWS SSO authentication process, making it easier to understand and follow.
- Clearer Verification: The prominent display of the verification code with styling helps users visually confirm the code against what is shown in their browser.
- Real-time Feedback: The spinner provides immediate visual feedback that the system is actively waiting for authentication, reducing user uncertainty.
- Universal Compatibility: The graceful degradation ensures that the authentication flow remains functional and usable across all environments, including those without TTY capabilities.
- Enhanced Readability: Color-coded elements and clear messaging improve the readability of important information, especially the verification code and URLs.
references
- closes #123 (Assuming this is the issue being addressed)
- Further context on AWS SSO device authorization flow: AWS SSO Documentation
Summary by CodeRabbit
-
New Features
- Styled verification dialog with automated browser opening, animated spinner during SSO device authorization, and Ctrl+C cancellation.
- Unified display for authentication results with human-friendly expiration durations and visual expiring indicators.
-
Documentation
- Added detailed AWS IAM Identity Center / device-authorization flow docs and clarified device codes vs. MFA tokens.
-
Improvements
- Graceful degradation for non-TTY/CI environments and consistent UX across auth commands.
Fix segfault in TestGetAffectedComponents when error pointer is corrupted @osterman (#1677)
## what - Fix segmentation violation in TestGetAffectedComponents at line 247 - Safely convert error to string before passing to `t.Skipf()`why
- On macOS ARM64, when gomonkey patches fail, the real function gets called with invalid test data
- This can result in a corrupted error pointer being returned (observed address:
0x646e657065646b73
) fmt.Sprintf
with%v
tries to dereference the corrupt pointer, causing a segfault- Converting error to string first using
err.Error()
avoids dereferencing the corrupt pointer
references
- Fixes GitHub Actions failure: https://github.com/cloudposse/atmos/actions/runs/18656461566/job/53187085704
- Stack trace showed fault at
terraform_affected_test.go:247
testing
- Verified test now passes without segfault on macOS ARM64
- Test gracefully skips when gomonkey mocking fails
Fix os.Args in tests with SetArgs @osterman (#1675)
## whatThis PR refactors various test files to replace direct manipulation of os.Args
with Cobra's recommended RootCmd.SetArgs()
method. This change standardizes how command-line arguments are tested across the codebase and improves test reliability by preventing global state pollution.
Specific changes include:
-
cmd/
package:- Replaced
os.Args
assignments withRootCmd.SetArgs()
incmd/root_test.go
,cmd/auth_login_test.go
. - Removed unnecessary manual save/restore of
os.Args
incmd/root_test.go
. - Documented legitimate usage of
os.Args
incmd/cmd_utils_test.go
where the function under test directly readsos.Args
.
- Replaced
-
pkg/config/
package:- Refactored
pkg/config/config.go
to exposeparseFlagsFromArgs(args []string)
for direct testing of flag parsing logic. - Updated
pkg/config/config_test.go
to useparseFlagsFromArgs()
where possible, reducingos.Args
manipulation. - Documented the necessity of
os.Args
manipulation for integration tests withinpkg/config/config_test.go
that call functions likesetLogConfig()
.
- Refactored
-
tests/
package:- Replaced
os.Args
assignments withcmd.RootCmd.SetArgs()
intests/cli_describe_component_test.go
,tests/describe_test.go
, andtests/validate_schema_test.go
.
- Replaced
why
Directly manipulating os.Args
in tests is an anti-pattern because:
- Global State Pollution:
os.Args
is global and can cause test leakage, leading to unpredictable failures, especially in parallel test runs. - Not the Cobra Way: Cobra provides
SetArgs()
as the idiomatic and safe way to test command execution, managing its own state. - Manual Cleanup Required: Each
os.Args
manipulation requires manualdefer
statements for restoration, adding boilerplate and potential for error.
By adopting RootCmd.SetArgs()
:
- Tests become more reliable and predictable.
- Boilerplate for argument setup and cleanup is removed.
- The codebase adheres to Cobra's best practices for testing.
- For legitimate uses of
os.Args
(e.g., testing subprocesses that callos.Exit()
or integration tests of themain()
function), comments have been added to clarify why this approach is necessary.
references
closes #XYZ (if applicable)
Add step to get dependencies in Go setup workflow @goruha (#1679)
## what * Add step to get dependencies in Go setup workflowwhy
- To cache actual dependencies
Summary by CodeRabbit
- Chores
- CI workflow updated to run dependency fetching during build setup, ensuring dependencies are retrieved earlier and improving build preparation reliability.
Use run-os for setup-go @goruha (#1667)
## what * Use run-os for setup-gowhy
- Reduce cache
references
Summary by CodeRabbit
-
Chores
- CI runner selection switched to dynamic, configuration-driven runner entries across workflows; build/test job names now include target/flavor context and include conditional Linux-specific steps.
- Pre-commit, lint, autofix and other CI workflows updated to use the new runner configuration.
-
New Features
- Added a scheduled/manual workflow to warm up Go cache and prepare Go tooling.
- Added a workflow to clear PR-related caches on closed pull requests.
-
Tests
- CI exercises OS/target combinations using the new dynamic runner configuration; Acceptance Tests now depend on the build job.
Add Changelog link and remove old file @osterman (#1676)
## what- Added a "Changelog" link to the top navigation bar in
website/docusaurus.config.js
. This link points to the/blog
route, making the blog more accessible to users. - Removed the old, unmaintained
CHANGELOG.md
file from the root of the repository. This file contained outdated release notes and is no longer necessary as changelogs are now managed as blog posts.
why
- The "Changelog" link was added to the navigation bar as per user request to improve discoverability of blog content, which serves as the current changelog.
- The
CHANGELOG.md
file was removed because it was obsolete and unmaintained, with changelogs now being published as blog posts. This cleans up the repository and avoids confusion.
references
- closes #123 (This is a placeholder, assuming the user implicitly wants to close an issue related to navigation and cleanup.)
- Link to blog: https://atmos.tools/blog/
Summary by CodeRabbit
-
Documentation
- Removed historical version entries from the changelog.
-
Chores
- Added "Changelog" navigation link to the website header for easier access to release information.
`auth` Leapp Migration Guide @Benbentwo (#1633)
This pull request adds documentation to help users migrate from Leapp to Atmos Auth for AWS IAM Identity Center authentication. The main changes introduce a new migration guide and organize authentication documentation under a dedicated category.Documentation improvements:
- Added a comprehensive migration guide (
migrating-from-leapp.mdx
) that explains how to convert Leapp sessions and providers to Atmos Auth YAML configuration, including field mappings, step-by-step instructions, troubleshooting tips, and a comparison table.
Documentation structure:
- Created a new
_category_.json
file to group authentication documentation under "Authentication (atmos auth)" in the sidebar for improved discoverability.
Summary by CodeRabbit
- Documentation
- Removed the legacy Atmos Auth User Guide.
- Added a "Migrating from Leapp" tutorial with migration steps, field mappings, and verification commands.
- Added a Geodesic configuration tutorial for Atmos Auth integration.
- Introduced an Auth βTutorialsβ category and two new blog posts introducing Atmos Auth and tutorials.
- Reorganized Auth CLI docs: updated ordering, labels, slugs, subcommand links, and sidebar positions.
- Expanded the Auth usage guide with AWS Permission Set account specification guidance and examples.
Update homedir README with fork details @osterman (#1673)
## what- Appended a detailed section to
pkg/config/homedir/README.md
describing the "Atmos Fork Enhancements". - This new section explains the fork's prioritization of environment variables for test compatibility with
t.Setenv()
. - It also details cache management strategies, including disabling caching (
homedir.DisableCache = true
) and resetting the cache (homedir.Reset()
). - Provides code examples for using these features in Go tests.
why
- To clearly document the specific enhancements made in Atmos's vendored fork of the
mitchellh/go-homedir
package. - To provide users, particularly those writing Go tests, with clear instructions on how to leverage the improved environment variable support and cache management for better testability.
- The original
mitchellh/go-homedir
package is deprecated, and this fork is maintained to support these specific testing requirements.
references
closes #279
π Enhancements
Fix `atmos describe affected --include-dependents --stack ` command to correctly process the dependents only from the provided stack @aknysh (#1703)
## ProblemWhen executing atmos describe affected --include-dependents --stack <stack>
, the command was incorrectly processing dependent components from ALL stacks instead of only from the specified stack. This caused:
- Performance issues: YAML functions (
!terraform.output
,!terraform.state
,!env
) were executed for components in all stacks, not just the filtered stack - Incorrect behavior: Dependents from other stacks were being included in the output
- Test gaps: Tests didn't catch this issue because fixtures lacked YAML functions that would fail when processed incorrectly
Root Cause
In internal/exec/describe_dependents.go
, the ExecuteDescribeDependents
function was calling ExecuteDescribeStacks
with an empty string for the stack filter instead of passing the onlyInStack
parameter. This caused all stacks to be loaded and processed.
Solution
1. Fixed Stack Filtering
- Added
OnlyInStack
parameter toDescribeDependentsArgs
struct - Updated
ExecuteDescribeDependents
to pass the stack filter through toExecuteDescribeStacks
- Ensured dependents are correctly filtered to only the specified stack
2. Refactored to Options Pattern
- Created
DescribeDependentsArgs
struct to replace 8 individual parameters - Improved code readability and maintainability
- Follows the Options Pattern from CLAUDE.md
3. Enhanced Test Coverage
- Added YAML functions (
!env
) to test fixtures to detect the bug - Created new test
TestDescribeAffectedWithDependentsStackFilterYamlFunctions
to verify:- YAML functions are only executed for components in the specified stack
- Dependents are correctly filtered by stack
- Environment variables are not accessed for components in other stacks
4. Lintroller Improvements
Added comprehensive exclusions to the custom linter:
- 29 packages excluded from perf.Track() checks (one-time operations)
- 7 utility files excluded (not in hot paths)
- 15 hot-path functions instrumented with perf.Track()
- os.Args linter exclusions for legitimate test patterns
Testing
Manual Testing
# Test that dependents are filtered by stack
atmos describe affected --include-dependents --stack ue1-network
# Verify YAML functions only execute for the specified stack
ATMOS_TEST_VPC_UE1=test atmos describe affected --include-dependents --stack ue1-network
Automated Testing
go test ./internal/exec -v -run TestDescribeAffectedWithDependentsStackFilterYamlFunctions
go test ./pkg/describe -v
Changes
Core Functionality
internal/exec/describe_dependents.go
: AddedDescribeDependentsArgs
struct, fixed stack filteringinternal/exec/describe_affected_utils_2.go
: Updated to use new struct patterninternal/exec/atmos.go
: Updated TUI integrationpkg/describe/describe_dependents_test.go
: Updated integration tests
Test Fixtures
- Added
!env
YAML functions to test fixtures in 4 files:tests/fixtures/scenarios/atmos-describe-affected-with-dependents-and-locked/stacks/deploy/network/us-east-1.yaml
tests/fixtures/scenarios/atmos-describe-affected-with-dependents-and-locked/stacks/deploy/network/us-west-2.yaml
- And their
stacks-affected
versions
Tests
internal/exec/describe_affected_test.go
: AddedTestDescribeAffectedWithDependentsStackFilterYamlFunctions
- Updated all mock functions to use new struct signature
Performance Tracking
Added perf.Track() to hot-path functions:
- Stack processing:
ProcessYAMLConfigFiles
,ProcessYAMLConfigFile
,ProcessStackConfig
- Component processing:
ProcessComponentInStack
,ProcessComponentFromContext
- Describe operations:
ExecuteDescribeStacks
,ExecuteDescribeComponent
- Core execution:
FilterEmptySections
,IsComponentAbstract
,FilterComputedFields
- Template functions:
AtmosFuncs.Component
,AtmosFuncs.GomplateDatasource
Lintroller
tools/lintroller/rule_perf_track.go
: Added exclusions for non-hot-path packages and filestools/lintroller/rule_os_args.go
: Added exclusions for legitimate os.Args usage in tests
Impact
β
Performance: YAML functions no longer execute for components outside the filtered stack
β
Correctness: Dependents are now correctly limited to the specified stack
β
Test Coverage: New tests prevent regression
β
Code Quality: Improved readability with Options Pattern
β
Linter: All custom linter checks pass
Summary by CodeRabbit
-
New Features
- Stack-specific filtering for dependent discovery (OnlyInStack).
- New template helpers under the "atmos" namespace: component, datasource, store.
-
Bug Fixes
- YAML function execution now respects stack filtering in describe-affected with dependents.
-
Performance
- Added runtime performance tracking across various describe and processing commands.
-
Chores
- Updated Atmos version and PostHog dependency; docs updated.
-
Tests
- Added/updated tests and fixtures for stack-filtering and Terraform-state YAML scenarios.