Repository navigation
feat: Automatic toolchain integration for custom commands and workflows - #1958
Conversation
This fixes `atmos bootstrap` failures for multiple tools after PR #1948 by aligning version prefix handling with Aqua's actual behavior. Root causes fixed: 1. buildTemplateData was unconditionally adding "v" prefix when version_prefix was empty, breaking tools like AWS CLI (expects AWSCLIV2-2.32.31 not v2.32.31) 2. buildDownloadError wasn't including ErrHTTP404 for 404 responses, breaking the version fallback mechanism 3. Spinner was suppressing debug log output when running Changes: - Remove unconditional "v" prefix default in buildTemplateData (asset.go) - Same fix in resolveVersionStrings (aqua.go) - Include ErrHTTP404 in 404 errors for fallback detection (download.go) - Disable spinner when debug logging is enabled (install_helpers.go) - Update tests to encode correct Aqua behavior - Add regression tests for AWS CLI, jq, gum, and HTTP type tools Fixes failures for: aws/[email protected], jqlang/[email protected], charmbracelet/[email protected], replicatedhq/[email protected] Co-Authored-By: Claude Haiku 4.5 <[email protected]>
Dependency Review✅ No vulnerabilities or license issues found.Scanned FilesNone |
📝 WalkthroughWalkthroughLoads project Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as Executor / CLI
participant Loader as .tool-versions Loader
participant Resolver as Workflow Resolver
participant Installer as Tool Installer
participant PATH as PATH Updater
participant Steps as Workflow Steps
CLI->>Loader: LoadToolVersionsDependencies()
Loader-->>CLI: baseDeps / error
CLI->>Resolver: ResolveWorkflowDependencies(workflowDef)
Resolver-->>CLI: workflowDeps / error
CLI->>CLI: MergeDependencies(baseDeps, workflowDeps)
CLI->>Installer: EnsureTools(mergedDeps)
Installer-->>CLI: installedTools / error
CLI->>PATH: UpdatePathForTools(installedTools)
PATH-->>CLI: toolchainPATH / error
CLI->>Steps: Execute steps with toolchainPATH prepended
Steps-->>CLI: results
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1958 +/- ##
==========================================
+ Coverage 74.44% 74.51% +0.06%
==========================================
Files 776 777 +1
Lines 70649 71003 +354
==========================================
+ Hits 52593 52905 +312
- Misses 14601 14634 +33
- Partials 3455 3464 +9
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…fic configs The resolveVersionOverrides function was creating a new Tool struct but only copying a subset of fields from the registry package definition. This caused critical fields like VersionPrefix, Replacements, Overrides, and Files to be lost when version overrides were resolved. Additionally, the versionOverride struct was missing Replacements and Overrides fields, so version-specific replacements (like jq's darwin->macos mapping for versions < 1.8.0) were not being parsed or applied. Fixes: - registryPackage struct now includes all tool fields (Asset, Format, BinaryName, VersionPrefix, Replacements, Overrides, Files) - versionOverride struct now includes Replacements and Overrides fields - resolveVersionOverrides copies all fields from registryPackage to Tool - applyVersionOverride applies replacements and overrides from version overrides Adds regression tests that verify: - Base fields are preserved when no version override matches - Version override replacements are correctly applied - Version override platform overrides are correctly applied - Real-world patterns (jq, gum, opentofu) work correctly Co-Authored-By: Claude Opus 4.5 <[email protected]>
This commit fixes two tool installation issues discovered during
bootstrap testing:
1. helm: The `files.src` field from Aqua registry contains templates
like `{{.OS}}-{{.Arch}}/helm` that weren't being expanded, causing
"file not found in archive" errors. Added `expandFileSrcTemplate`
to process these templates using the same data as asset URLs.
2. aws-cli: macOS `pkgutil --expand-full` requires the target directory
to NOT exist (it creates it). Changed to create a parent temp dir,
then use a non-existent subdirectory as the target.
Also:
- Set tool.Version before extraction so template functions have
access to version data
- Added regression tests for template expansion
- Added testdata fixture for integration testing with tools not
in Aqua registry (like replicated)
Co-Authored-By: Claude Opus 4.5 <[email protected]>
…egistry
The inline atmos registry now supports all fields needed for complete
tool definitions:
- `files`: Array of file extraction configurations with name and src
- `replacements`: Map for OS/arch name substitutions (e.g., darwin->macos)
- `version_prefix`: Prefix for version tags (e.g., "v", "jq-")
This enables defining tools like replicated (not in Aqua registry) with
full control over extraction and platform-specific patterns.
Example:
```yaml
toolchain:
registries:
- name: custom
type: atmos
priority: 100
tools:
replicatedhq/replicated:
type: github_release
asset: 'replicated_{{trimV .Version}}_{{.OS}}_{{.Arch}}.tar.gz'
format: tar.gz
files:
- name: replicated
src: replicated
```
Co-Authored-By: Claude Opus 4.5 <[email protected]>
…kflows Custom commands and workflows now automatically have access to tools defined in .tool-versions. Previously, tools were only available when explicitly declared in the dependencies section. Changes: - Add LoadToolVersionsDependencies() to resolve .tool-versions as dependencies - Update executeCustomCommand() to merge .tool-versions with command deps - Add ensureToolchainDependencies() to workflow executor - Document toolchain integration for both custom commands and workflows Tools from .tool-versions serve as project-wide defaults. Per-command or per-workflow dependencies override these defaults when specified. Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Warning This PR exceeds the recommended limit of 1,000 lines.Large PRs are difficult to review and may be rejected due to their size. Please verify that this PR does not address multiple issues. |
…flows Add working examples demonstrating how toolchain-managed tools from .tool-versions are automatically available in custom commands and workflows. Changes: - Add .tool-versions with jq and yq for demonstration - Add custom commands (toolchain-demo) using which/version commands - Add workflow file (toolchain-demo.yaml) with shell steps - Update README with comprehensive documentation - Update .gitignore to allow example .tool-versions file Examples show: - Using `which` to verify toolchain binaries are in PATH - Tool version checking - JSON/YAML processing with jq/yq - Both implicit (.tool-versions) and explicit (dependencies) usage Co-Authored-By: Claude Opus 4.5 <[email protected]>
Replace redundant examples with four distinct patterns: 1. which - Implicit dependencies from .tool-versions 2. pinned - Exact version pinning (overrides .tool-versions) 3. constrained - SemVer constraints (^1.7.0, ~> 4.40.0) 4. convert - Multi-tool pipeline (yq | jq) Each example now demonstrates a different toolchain capability instead of repeating the same which/version checks. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Add DependencyProvider interface to workflow executor for testability: - New DependencyProvider interface abstracts toolchain dependency operations - DefaultDependencyProvider implements interface using real dependencies package - Executor.WithDependencyProvider() allows injecting mock for testing - Refactored ensureToolchainDependencies() to use interface New tests for pkg/workflow/executor.go (ensureToolchainDependencies): - No dependencies case (early return) - Tool-versions only case - Workflow deps only case - Merged dependencies (workflow overrides tool-versions) - Error paths: load, resolve, merge, install, PATH update New tests for toolchain/installer/extract.go: - extractGzipOrTarGz: tar.gz and single gzip binary paths - extractByMimeType: tar MIME type handling - extractEntry: directory type, path traversal, unknown type warning - extractFile: invalid mode handling - extractPkg: non-Darwin unsupported format New tests for pkg/dependencies/resolver.go: - Directory at .tool-versions path returns error (not NotExist) Coverage improvements: - ensureToolchainDependencies: ~19% → 100% - extractGzipOrTarGz: 66.7% → 100% - extractEntry: 50% → 100% - LoadToolVersionsDependencies: 91.7% → 100% Co-Authored-By: Claude Opus 4.5 <[email protected]>
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
toolchain/install_test.go (2)
133-139: Fix.tool-versionsverification path: these assertions likely read the wrong file.In multiple tests you write
toolVersionsPath := filepath.Join(tempDir, DefaultToolVersionsFilePath)but later verify usingLoadToolVersions(DefaultToolVersionsFilePath)(relative path). Unless the testChdirs intotempDir, that reads.tool-versionsfrom the repo CWD, nottempDir—risking flaky tests and repo pollution.Proposed fix
- // Verify the tool was added to .tool-versions (it uses DefaultToolVersionsFilePath which is .tool-versions in HOME) - actualPath := DefaultToolVersionsFilePath - updatedToolVersions, err := LoadToolVersions(actualPath) + // Verify the tool was added to .tool-versions. + updatedToolVersions, err := LoadToolVersions(toolVersionsPath) require.NoError(t, err) assert.Contains(t, updatedToolVersions.Tools, "terraform") assert.Contains(t, updatedToolVersions.Tools["terraform"], "1.11.4")- // Verify the new version is first (default) in .tool-versions (uses DefaultToolVersionsFilePath) - actualPath := DefaultToolVersionsFilePath - updatedToolVersions, err := LoadToolVersions(actualPath) + // Verify the new version is first (default) in .tool-versions. + updatedToolVersions, err := LoadToolVersions(toolVersionsPath) require.NoError(t, err) assert.Contains(t, updatedToolVersions.Tools, "terraform") assert.Equal(t, "1.11.4", updatedToolVersions.Tools["terraform"][0])- actualPath := DefaultToolVersionsFilePath - updatedToolVersions, err := LoadToolVersions(actualPath) + updatedToolVersions, err := LoadToolVersions(toolVersionsPath) require.NoError(t, err)Also applies to: 167-173, 224-238
240-271:terraform@latestmakes live GitHub calls and is nondeterministic.This test will hit GitHub's API (via
NewAquaRegistry()) to resolve the "latest" version, making it flaky and slow. Unit tests should use either a fixed version like[email protected]for a simpler install path test, or mock the registry withhttptest.Server+WithGitHubBaseURL(pattern exists intoolchain/registry/aqua/aqua_test.go) to test "latest" resolution deterministically.
🤖 Fix all issues with AI agents
In `@pkg/workflow/dependency_provider_test.go`:
- Around line 51-65: The test
TestDefaultDependencyProvider_LoadToolVersionsDependencies_NoFile may read the
repo’s .tool-versions because it doesn't change working directory or assert the
returned map is empty; update the test to chdir into the tempDir before calling
NewDefaultDependencyProvider/LoadToolVersionsDependencies (use os.Chdir and
t.Cleanup to restore cwd) and replace assert.NotNil with assert.Empty on deps to
verify an empty map is returned when the file is absent.
- Around line 204-224: The test TestDefaultDependencyProvider_UpdatePathForTools
can leak environment changes because UpdatePathForTools may call
os.Setenv("PATH", ...); wrap the test by capturing and isolating PATH with
t.Setenv("PATH", os.Getenv("PATH")) before invoking provider.UpdatePathForTools,
and add assertions to verify PATH is either unchanged for empty/nil dependencies
or matches the expected value when dependencies are provided; update the test to
use t.Setenv and explicit asserts around os.Getenv("PATH") to prevent leaking
PATH to other tests.
In `@toolchain/install_test.go`:
- Around line 776-780: The test TestInstallFromToolVersions_InvalidPath
hardcodes "/nonexistent/path/..." which is not portable on Windows; change it to
use a guaranteed-missing path under t.TempDir() (e.g., temp := t.TempDir(); path
:= filepath.Join(temp, "nonexistent", ".tool-versions")) and call
installFromToolVersions(path, false, false), asserting an error; add an import
for "path/filepath" if needed and do not create the "nonexistent" path so the
file is guaranteed missing when installFromToolVersions is invoked.
- Around line 546-587: The comment inside TestShowProgress ("Create mock spinner
and progress bar") is missing a trailing period which fails godot lint; edit the
test to terminate that comment with a period (change "// Create mock spinner and
progress bar" to "// Create mock spinner and progress bar.") so TestShowProgress
and related comments around the spinner/progressBar setup comply with
golangci-lint/godot rules.
- Around line 698-759: The test ignores errors from installOrSkipTool and the
code path creates a fresh Installer via NewInstaller() inside InstallSingleTool,
causing real downloads and bypassing the mock resolver; change installOrSkipTool
and InstallSingleTool signatures to accept an *Installer parameter (use the
passed installer instead of calling NewInstaller()), update all callers to pass
the installer through, and update this test to assert the returned error
(replace result, _ := installOrSkipTool(...) with result, err :=
installOrSkipTool(installer, ...) and require.NoError/require.Error as
appropriate) so the mock resolver is honored and failures are caught.
♻️ Duplicate comments (1)
toolchain/install_test.go (1)
589-631: Good to leave the DI TODO, but RunInstallBatch coverage is still mostly “smoke”.The TODO about refactoring
installMultipleTools/RunInstallBatchfor DI matches prior review feedback; keeping it as a follow-up makes sense for a feature PR.However, the “single tool delegates…” case can still be flaky if it triggers real install/network (same issue as other RunInstall-based tests). Consider converting this test to verify delegation via an injected installer/mock instead of exercising the live path.
🧹 Nitpick comments (4)
internal/exec/workflow_utils_test.go (1)
1467-1502: Consider addingt.Chdir(tempDir)for test isolation.Unlike the other new tests, this one doesn't change to the temp directory. If run from a repo with a
.tool-versionsfile, it could merge those tools with the workflow deps, making results less deterministic.🔧 Suggested fix
func TestEnsureWorkflowToolchainDependencies_WithWorkflowDeps(t *testing.T) { tempDir := t.TempDir() t.Setenv("HOME", tempDir) + t.Chdir(tempDir) // Isolate from project .tool-versions. atmosConfig := &schema.AtmosConfiguration{cmd/cmd_utils_test.go (1)
1582-1637: Clarify/verifyATMOS_CHDIRsemantics: “unset” vs “set empty”.
These tests lock in behavior that rewrites anyATMOS_CHDIR=...toATMOS_CHDIR=and moves it to the end. That’s fine if downstream logic treats empty as “disabled”, but it’s not equivalent to unsetting the variable for child processes. Consider adding one more case for duplicateATMOS_CHDIRentries to ensure you end up with exactly one trailingATMOS_CHDIR=(and no earlier occurrences).pkg/workflow/dependency_provider_test.go (1)
67-180: Consider table-driven coverage for nil/empty cases to reduce repetition.
These tests are fine, but the nil/empty permutations are a good fit for a single table-driven test per method (matches repo testing guidelines).toolchain/install_test.go (1)
8-28: Remove/clarify the stray comment and simplify the test helper constructors.Line 16 (“Add a mock ToolResolver for tests.”) reads like a TODO but nothing follows; either delete it or point at the actual mock type.
Also, the helpers can be simplified a bit (no need for temporaries unless you prefer them).
Proposed tweak
-// Add a mock ToolResolver for tests. - // newTestSpinner creates a spinner model for testing. func newTestSpinner() *bspinner.Model { - s := bspinner.New() - return &s + m := bspinner.New() + return &m } // newTestProgressBar creates a progress bar model for testing. func newTestProgressBar() *progress.Model { - p := progress.New() - return &p + m := progress.New() + return &m }
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
cmd/cmd_utils_test.gointernal/exec/workflow_utils_test.gopkg/workflow/dependency_provider_test.gotoolchain/install_test.go
🧰 Additional context used
📓 Path-based instructions (5)
cmd/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
cmd/**/*.go: Use Cobra's recommended command structure with a root command and subcommands, implementing each command in a separate file undercmd/directory
Provide comprehensive help text for all commands and flags, include examples in command help, and follow Go's documentation conventions in Cobra command definitions
Provide meaningful feedback to users and include progress indicators for long-running operations in CLI commands
Files:
cmd/cmd_utils_test.go
**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*.go: Use Viper for managing configuration, environment variables, and flags in CLI commands
Use interfaces for external dependencies to facilitate mocking and consider using testify/mock for creating mock implementations
All code must pass golangci-lint checks
Follow Go's error handling idioms: use meaningful error messages, wrap errors with context usingfmt.Errorf("context: %w", err), and consider using custom error types for domain-specific errors
Follow standard Go coding style: usegofmtandgoimportsto format code, prefer short descriptive variable names, use kebab-case for command-line flags, and snake_case for environment variables
Document all exported functions, types, and methods following Go's documentation conventions
Document complex logic with inline comments in Go code
Support configuration via files, environment variables, and flags following the precedence order: flags > environment variables > config file > defaults
Provide clear error messages to users, include troubleshooting hints when appropriate, and log detailed errors for debugging
**/*.go: All comments must end with periods (enforced bygodotlinter) in Go code
Organize imports into three groups separated by blank lines, sorted alphabetically: Go stdlib, 3rd-party (NOT cloudposse/atmos), then Atmos packages with maintained aliases (cfg,log,u,errUtils)
All errors MUST be wrapped using static errors defined inerrors/errors.go- useerrors.Joinfor combining errors,fmt.Errorfwith%wfor context, anderrors.Is()for error checking
Never manually create mocks - usego.uber.org/mock/mockgenwith//go:generatedirectives in Go code
Keep files small and focused - under 600 lines with one cmd/impl per file, co-locate tests, never use//revive:disable:file-length-limit
Use colors frompkg/ui/theme/colors.gofor all UI theming in Go code
Code must be compatible with Linux, macOS, and Windows - use SDKs over binaries, usefilepath.Join()instead of h...
Files:
cmd/cmd_utils_test.gotoolchain/install_test.gopkg/workflow/dependency_provider_test.gointernal/exec/workflow_utils_test.go
**/*_test.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*_test.go: Every new feature must include comprehensive unit tests targeting >80% code coverage for all packages
Use table-driven tests for testing multiple scenarios in Go
Include integration tests for command flows and test CLI end-to-end when possible with test fixturesPrefer unit tests with mocks over integration tests - use interfaces and dependency injection for testability, generate mocks with
go.uber.org/mock/mockgen, use table-driven tests, target >80% coverage
Files:
cmd/cmd_utils_test.gotoolchain/install_test.gopkg/workflow/dependency_provider_test.gointernal/exec/workflow_utils_test.go
**/{pkg,internal,cmd}/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
Add
defer perf.Track(atmosConfig, "pkg.FuncName")()plus blank line to all public functions, usingnilif no atmosConfig param - exceptions: trivial getters/setters, command constructors, simple factories, functions delegating to tracked functions
Files:
cmd/cmd_utils_test.gopkg/workflow/dependency_provider_test.gointernal/exec/workflow_utils_test.go
cmd/**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Always use
cmd.NewTestKit(t)for cmd tests to auto-clean RootCmd state
Files:
cmd/cmd_utils_test.go
🧠 Learnings (31)
📓 Common learnings
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: errors/errors.go:184-203
Timestamp: 2025-12-13T06:10:13.688Z
Learning: cloudposse/atmos: For toolchain work, duplicate/unused error sentinels in errors/errors.go should be cleaned up in a separate refactor PR and not block feature PRs; canonical toolchain sentinels live under toolchain/registry with re-exports in toolchain/errors.go.
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.
Learnt from: osterman
Repo: cloudposse/atmos PR: 1466
File: website/docs/cli/commands/toolchain/usage.mdx:117-121
Timestamp: 2025-09-08T01:25:44.958Z
Learning: The atmos toolchain XDG compliance implementation is complete with GetXDGCacheDir() and GetXDGTempCacheDir() functions in toolchain/xdg_cache.go, updated installer.go and toolchain_clean.go to use these helpers, and changed cache paths from ~/.cache/tools-cache to ${XDG_CACHE_HOME}/atmos-toolchain (or ~/.cache/atmos-toolchain when XDG_CACHE_HOME is not set).
Learnt from: osterman
Repo: cloudposse/atmos PR: 1466
File: website/docs/cli/commands/toolchain/usage.mdx:117-121
Timestamp: 2025-09-08T01:25:44.958Z
Learning: XDG Base Directory Specification compliance implementation for atmos toolchain is complete: created toolchain/xdg_cache.go with GetXDGCacheDir() and GetXDGTempCacheDir() functions, updated toolchain/installer.go and cmd/toolchain_clean.go to use these XDG helpers, and changed all cache paths from hardcoded ~/.cache/tools-cache to XDG-compliant ${XDG_CACHE_HOME}/atmos-toolchain (or ~/.cache/atmos-toolchain fallback).
Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Include integration tests for command flows and test CLI end-to-end when possible with test fixtures
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gopkg/workflow/dependency_provider_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to cmd/**/*.go : Provide comprehensive help text for all commands and flags, include examples in command help, and follow Go's documentation conventions in Cobra command definitions
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-12-10T18:32:43.260Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1808
File: cmd/terraform/backend/backend_delete_test.go:9-23
Timestamp: 2025-12-10T18:32:43.260Z
Learning: In cmd subpackages, tests should avoid using NewTestKit(t) unless tests actually interact with RootCmd (e.g., execute commands via RootCmd or modify RootCmd state). For structural tests that only verify command structure/flags without touching RootCmd, TestKit cleanup is unnecessary.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to cmd/**/*_test.go : Always use `cmd.NewTestKit(t)` for cmd tests to auto-clean RootCmd state
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.go
📚 Learning: 2025-05-23T19:51:47.091Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: The atmos codebase has a custom extension to *testing.T that provides a Chdir method, allowing test functions to call t.Chdir() to change working directories during tests. This is used consistently across test files in the codebase.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to cmd/**/*.go : Use Cobra's recommended command structure with a root command and subcommands, implementing each command in a separate file under `cmd/` directory
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Every new feature must include comprehensive unit tests targeting >80% code coverage for all packages
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2024-12-07T16:16:13.038Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 825
File: internal/exec/helmfile_generate_varfile.go:28-31
Timestamp: 2024-12-07T16:16:13.038Z
Learning: In `internal/exec/helmfile_generate_varfile.go`, the `--help` command (`./atmos helmfile generate varfile --help`) works correctly without requiring stack configurations, and the only change needed was to make `ProcessCommandLineArgs` exportable by capitalizing its name.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2024-10-23T21:36:40.262Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 740
File: cmd/cmd_utils.go:340-359
Timestamp: 2024-10-23T21:36:40.262Z
Learning: In the Go codebase for Atmos, when reviewing functions like `checkAtmosConfig` in `cmd/cmd_utils.go`, avoid suggesting refactoring to return errors instead of calling `os.Exit` if such changes would significantly increase the scope due to the need to update multiple call sites.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2024-12-13T15:28:13.630Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 844
File: cmd/version.go:34-44
Timestamp: 2024-12-13T15:28:13.630Z
Learning: In `cmd/version.go`, when handling the `--check` flag in the `versionCmd`, avoid using `CheckForAtmosUpdateAndPrintMessage(cliConfig)` as it updates the cache timestamp, which may not be desired in this context.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-11-11T03:47:45.878Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: toolchain/add_test.go:67-77
Timestamp: 2025-11-11T03:47:45.878Z
Learning: In the cloudposse/atmos codebase, tests should prefer t.Setenv for environment variable setup/teardown instead of os.Setenv/Unsetenv to ensure test-scoped isolation.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2025-11-11T03:47:59.576Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: toolchain/which_test.go:166-223
Timestamp: 2025-11-11T03:47:59.576Z
Learning: In the cloudposse/atmos repo, tests that manipulate environment variables should use testing.T.Setenv for automatic setup/teardown instead of os.Setenv/Unsetenv.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2025-05-23T19:51:47.091Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: In the atmos codebase, t.Chdir() is a valid method call on *testing.T objects and works correctly for changing directories in tests. This is implemented through custom testing framework extensions and is used consistently throughout the test suite.
Applied to files:
cmd/cmd_utils_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2025-05-23T19:51:47.091Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: In the atmos codebase, t.Chdir() is a valid method call on *testing.T objects and works correctly for changing directories in tests.
Applied to files:
cmd/cmd_utils_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2025-05-23T19:51:47.091Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: In the atmos codebase, t.Chdir() is a valid method that can be called on *testing.T objects. This functionality is implemented through custom testing framework extensions and is used consistently throughout the test suite for changing working directories during tests.
Applied to files:
cmd/cmd_utils_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Use table-driven tests for testing multiple scenarios in Go
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.go
📚 Learning: 2025-01-09T22:27:25.538Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 914
File: cmd/validate_stacks.go:20-23
Timestamp: 2025-01-09T22:27:25.538Z
Learning: The validate commands in Atmos can have different help handling implementations. Specifically, validate_component.go and validate_stacks.go are designed to handle help requests differently, with validate_stacks.go including positional argument checks while validate_component.go does not.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-11-10T23:23:39.771Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: toolchain/registry/aqua/aqua_test.go:417-442
Timestamp: 2025-11-10T23:23:39.771Z
Learning: In Atmos toolchain AquaRegistry, tests should not hit real GitHub. Use the options pattern via WithGitHubBaseURL to inject an httptest server URL and make GetLatestVersion/GetAvailableVersions deterministic.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gopkg/workflow/dependency_provider_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2025-12-13T04:37:40.435Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: cmd/toolchain/get.go:23-40
Timestamp: 2025-12-13T04:37:40.435Z
Learning: In Go CLI command files using Cobra, constrain the subcommand to accept at most one positional argument (MaximumNArgs(1)) so it supports both listing all items (zero args) and fetching a specific item (one arg). Define and parse flags with a standard parser (e.g., flags.NewStandardParser()) and avoid binding flags to Viper (no viper.BindEnv/BindPFlag). This promotes explicit argument handling and predictable flag behavior across command files.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-12-21T04:10:29.030Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1891
File: internal/exec/describe_affected.go:468-468
Timestamp: 2025-12-21T04:10:29.030Z
Learning: In Go, package-level declarations (constants, variables, types, and functions) are visible to all files in the same package without imports. During reviews in cloudposse/atmos (and similar Go codebases), before suggesting to declare a new identifier, first check if it already exists in another file of the same package. If it exists, you can avoid adding a new declaration; if not, proceed with a proper package-level declaration.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gopkg/workflow/dependency_provider_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to **/*_test.go : Prefer unit tests with mocks over integration tests - use interfaces and dependency injection for testability, generate mocks with `go.uber.org/mock/mockgen`, use table-driven tests, target >80% coverage
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-09-08T01:25:44.958Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1466
File: website/docs/cli/commands/toolchain/usage.mdx:117-121
Timestamp: 2025-09-08T01:25:44.958Z
Learning: The atmos toolchain XDG compliance implementation is complete with GetXDGCacheDir() and GetXDGTempCacheDir() functions in toolchain/xdg_cache.go, updated installer.go and toolchain_clean.go to use these helpers, and changed cache paths from ~/.cache/tools-cache to ${XDG_CACHE_HOME}/atmos-toolchain (or ~/.cache/atmos-toolchain when XDG_CACHE_HOME is not set).
Applied to files:
toolchain/install_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to {go.mod,go.sum} : Manage dependencies with Go modules and keep dependencies up to date while minimizing external dependencies
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*.go : Use interfaces for external dependencies to facilitate mocking and consider using testify/mock for creating mock implementations
Applied to files:
toolchain/install_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Define interfaces for all major functionality and use dependency injection for testability in Go code
Applied to files:
toolchain/install_test.gopkg/workflow/dependency_provider_test.go
📚 Learning: 2024-11-18T13:59:10.824Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 768
File: internal/exec/vendor_model_component.go:3-20
Timestamp: 2024-11-18T13:59:10.824Z
Learning: When replacing significant dependencies like `go-getter` that require extensive changes, prefer to address them in separate PRs.
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-12-13T06:10:25.156Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: internal/exec/workflow_utils.go:0-0
Timestamp: 2025-12-13T06:10:25.156Z
Learning: Atmos workflows: In internal/exec/workflow_utils.go ExecuteWorkflow, non-identity steps intentionally use baseWorkflowEnv, which is constructed from the parent environment with PATH modifications for the toolchain. Avoid appending os.Environ() again; prefer documenting this behavior and testing that standard environment variables are preserved.
Applied to files:
pkg/workflow/dependency_provider_test.gointernal/exec/workflow_utils_test.go
📚 Learning: 2025-09-08T01:25:44.958Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1466
File: website/docs/cli/commands/toolchain/usage.mdx:117-121
Timestamp: 2025-09-08T01:25:44.958Z
Learning: Final XDG Base Directory Specification implementation for atmos toolchain is complete and verified: toolchain/xdg_cache.go provides GetXDGCacheDir() and GetXDGTempCacheDir() functions, all hardcoded ~/.cache/tools-cache paths have been replaced with XDG-compliant paths using ${XDG_CACHE_HOME}/atmos-toolchain (or ~/.cache/atmos-toolchain fallback), and tests have been updated to expect the new path structure.
Applied to files:
internal/exec/workflow_utils_test.go
📚 Learning: 2025-09-08T01:25:44.958Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1466
File: website/docs/cli/commands/toolchain/usage.mdx:117-121
Timestamp: 2025-09-08T01:25:44.958Z
Learning: XDG Base Directory Specification compliance implementation for atmos toolchain is complete: created toolchain/xdg_cache.go with GetXDGCacheDir() and GetXDGTempCacheDir() functions, updated toolchain/installer.go and cmd/toolchain_clean.go to use these XDG helpers, and changed all cache paths from hardcoded ~/.cache/tools-cache to XDG-compliant ${XDG_CACHE_HOME}/atmos-toolchain (or ~/.cache/atmos-toolchain fallback).
Applied to files:
internal/exec/workflow_utils_test.go
📚 Learning: 2024-11-02T15:35:09.958Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 759
File: internal/exec/terraform.go:366-368
Timestamp: 2024-11-02T15:35:09.958Z
Learning: In `internal/exec/terraform.go`, the workspace cleaning code under both the general execution path and within the `case "init":` block is intentionally duplicated because the code execution paths are different. The `.terraform/environment` file should be deleted before executing `terraform init` in both scenarios to ensure a clean state.
Applied to files:
internal/exec/workflow_utils_test.go
🧬 Code graph analysis (3)
cmd/cmd_utils_test.go (1)
cmd/cmd_utils.go (2)
ValidateConfig(54-57)WithStackValidation(61-65)
pkg/workflow/dependency_provider_test.go (5)
pkg/schema/schema.go (2)
AtmosConfiguration(54-102)Toolchain(264-274)pkg/workflow/dependency_provider.go (1)
NewDefaultDependencyProvider(15-21)pkg/dependencies/resolver.go (1)
LoadToolVersionsDependencies(167-188)pkg/schema/workflow.go (1)
WorkflowDefinition(17-24)pkg/dependencies/installer.go (1)
UpdatePathForTools(249-263)
internal/exec/workflow_utils_test.go (2)
pkg/schema/schema.go (2)
AtmosConfiguration(54-102)Toolchain(264-274)pkg/schema/workflow.go (2)
WorkflowDefinition(17-24)WorkflowStep(7-15)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Acceptance Tests (windows)
- GitHub Check: Acceptance Tests (macos)
- GitHub Check: Acceptance Tests (linux)
- GitHub Check: Summary
🔇 Additional comments (7)
internal/exec/workflow_utils_test.go (4)
1437-1465: Solid test setup.Good isolation using
t.TempDir(),t.Setenv(), andt.Chdir()to avoid interference from project-level config.
1504-1521: Nice edge case coverage.Testing nil workflow definition is a good defensive check.
1523-1542: Good complementary test.Covers the empty struct scenario alongside the nil case.
1544-1581: Past feedback addressed.The
t.Chdir(tempDir)call at line 1548 ensures the test reads from its own.tool-versionsfile rather than the project's.cmd/cmd_utils_test.go (3)
1550-1581: Non-top-level alias test is clear and appropriately defensive.
The direct scan ofparentCmd.Commands()avoids Cobra’sFind()gotcha and makes the intent obvious.
1639-1735: Good coverage of Cobra hierarchy; double-check whetherversionitself should be “management”.
The matrix is solid (nil, standalone, non-atmos root, install/uninstall vs list). Only potential ambiguity:versionreturningtruewhileversion listreturnsfalse—worth confirming the intended policy, since this predicate likely gates special behavior.
1737-1764: Options-pattern test is minimal and effective.
This cleanly verifiesWithStackValidationmutatesValidateConfig.CheckStackas intended.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@toolchain/uninstall_test.go`:
- Around line 327-341: The "empty tool argument" table-driven test case is dead:
RunUninstall("") triggers uninstallFromToolVersions and the test returns early
without asserting the expected error; remove the empty toolSpec entry from the
tests slice or extract it into a new dedicated test function (e.g.,
TestRunUninstall_NoArgs) that calls RunUninstall("") and asserts the correct
no-args behavior (mocking or checking uninstallFromToolVersions side-effects or
successful no-op). Ensure references to RunUninstall and
uninstallFromToolVersions are used to locate and update the test accordingly.
♻️ Duplicate comments (3)
toolchain/install_test.go (3)
587-629: Documented limitation, reasonable coverage.The TODO (lines 588-591) acknowledges the testability issue. The current tests cover safe edge cases. Good enough for this PR.
696-766: Past issue addressed.Error is now captured and handled appropriately. The conditional logic (lines 756-763) correctly distinguishes between skip cases (must not error) and install cases (network errors tolerated in CI).
783-787: Past issue resolved.Now uses
t.TempDir()withfilepath.Join()for cross-platform compatibility.
🧹 Nitpick comments (1)
toolchain/install_test.go (1)
107-137: Consider usingt.Cleanup()for consistency.This test uses
deferfor config restoration while earlier tests uset.Cleanup(). The latter is preferred for test-scoped cleanup since it runs even if the test panics.♻️ Suggested change
// Set Atmos config originalToolVersionsFile := GetToolVersionsFilePath() SetAtmosConfig(&schema.AtmosConfiguration{Toolchain: schema.Toolchain{VersionsFile: toolVersionsPath}}) - defer func() { - SetAtmosConfig(&schema.AtmosConfiguration{Toolchain: schema.Toolchain{VersionsFile: originalToolVersionsFile}}) - }() + t.Cleanup(func() { + SetAtmosConfig(&schema.AtmosConfiguration{Toolchain: schema.Toolchain{VersionsFile: originalToolVersionsFile}}) + })Same pattern applies to the other
TestRunInstall_*tests in this file.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
cmd/cmd_utils_test.gointernal/exec/workflow_utils_test.gopkg/workflow/dependency_provider_test.gotoolchain/install_test.gotoolchain/uninstall_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
- internal/exec/workflow_utils_test.go
- pkg/workflow/dependency_provider_test.go
🧰 Additional context used
📓 Path-based instructions (5)
cmd/**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
cmd/**/*.go: Use Cobra's recommended command structure with a root command and subcommands, implementing each command in a separate file undercmd/directory
Provide comprehensive help text for all commands and flags, include examples in command help, and follow Go's documentation conventions in Cobra command definitions
Provide meaningful feedback to users and include progress indicators for long-running operations in CLI commands
Files:
cmd/cmd_utils_test.go
**/*.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*.go: Use Viper for managing configuration, environment variables, and flags in CLI commands
Use interfaces for external dependencies to facilitate mocking and consider using testify/mock for creating mock implementations
All code must pass golangci-lint checks
Follow Go's error handling idioms: use meaningful error messages, wrap errors with context usingfmt.Errorf("context: %w", err), and consider using custom error types for domain-specific errors
Follow standard Go coding style: usegofmtandgoimportsto format code, prefer short descriptive variable names, use kebab-case for command-line flags, and snake_case for environment variables
Document all exported functions, types, and methods following Go's documentation conventions
Document complex logic with inline comments in Go code
Support configuration via files, environment variables, and flags following the precedence order: flags > environment variables > config file > defaults
Provide clear error messages to users, include troubleshooting hints when appropriate, and log detailed errors for debugging
**/*.go: All comments must end with periods (enforced bygodotlinter) in Go code
Organize imports into three groups separated by blank lines, sorted alphabetically: Go stdlib, 3rd-party (NOT cloudposse/atmos), then Atmos packages with maintained aliases (cfg,log,u,errUtils)
All errors MUST be wrapped using static errors defined inerrors/errors.go- useerrors.Joinfor combining errors,fmt.Errorfwith%wfor context, anderrors.Is()for error checking
Never manually create mocks - usego.uber.org/mock/mockgenwith//go:generatedirectives in Go code
Keep files small and focused - under 600 lines with one cmd/impl per file, co-locate tests, never use//revive:disable:file-length-limit
Use colors frompkg/ui/theme/colors.gofor all UI theming in Go code
Code must be compatible with Linux, macOS, and Windows - use SDKs over binaries, usefilepath.Join()instead of h...
Files:
cmd/cmd_utils_test.gotoolchain/install_test.gotoolchain/uninstall_test.go
**/*_test.go
📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)
**/*_test.go: Every new feature must include comprehensive unit tests targeting >80% code coverage for all packages
Use table-driven tests for testing multiple scenarios in Go
Include integration tests for command flows and test CLI end-to-end when possible with test fixturesPrefer unit tests with mocks over integration tests - use interfaces and dependency injection for testability, generate mocks with
go.uber.org/mock/mockgen, use table-driven tests, target >80% coverage
Files:
cmd/cmd_utils_test.gotoolchain/install_test.gotoolchain/uninstall_test.go
**/{pkg,internal,cmd}/**/*.go
📄 CodeRabbit inference engine (CLAUDE.md)
Add
defer perf.Track(atmosConfig, "pkg.FuncName")()plus blank line to all public functions, usingnilif no atmosConfig param - exceptions: trivial getters/setters, command constructors, simple factories, functions delegating to tracked functions
Files:
cmd/cmd_utils_test.go
cmd/**/*_test.go
📄 CodeRabbit inference engine (CLAUDE.md)
Always use
cmd.NewTestKit(t)for cmd tests to auto-clean RootCmd state
Files:
cmd/cmd_utils_test.go
🧠 Learnings (40)
📓 Common learnings
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: errors/errors.go:184-203
Timestamp: 2025-12-13T06:10:13.688Z
Learning: cloudposse/atmos: For toolchain work, duplicate/unused error sentinels in errors/errors.go should be cleaned up in a separate refactor PR and not block feature PRs; canonical toolchain sentinels live under toolchain/registry with re-exports in toolchain/errors.go.
Learnt from: osterman
Repo: cloudposse/atmos PR: 1466
File: website/docs/cli/commands/toolchain/usage.mdx:117-121
Timestamp: 2025-09-08T01:25:44.958Z
Learning: The atmos toolchain XDG compliance implementation is complete with GetXDGCacheDir() and GetXDGTempCacheDir() functions in toolchain/xdg_cache.go, updated installer.go and toolchain_clean.go to use these helpers, and changed cache paths from ~/.cache/tools-cache to ${XDG_CACHE_HOME}/atmos-toolchain (or ~/.cache/atmos-toolchain when XDG_CACHE_HOME is not set).
Learnt from: osterman
Repo: cloudposse/atmos PR: 1466
File: website/docs/cli/commands/toolchain/usage.mdx:117-121
Timestamp: 2025-09-08T01:25:44.958Z
Learning: XDG Base Directory Specification compliance implementation for atmos toolchain is complete: created toolchain/xdg_cache.go with GetXDGCacheDir() and GetXDGTempCacheDir() functions, updated toolchain/installer.go and cmd/toolchain_clean.go to use these XDG helpers, and changed all cache paths from hardcoded ~/.cache/tools-cache to XDG-compliant ${XDG_CACHE_HOME}/atmos-toolchain (or ~/.cache/atmos-toolchain fallback).
Learnt from: aknysh
Repo: cloudposse/atmos PR: 944
File: go.mod:206-206
Timestamp: 2025-01-17T00:18:57.769Z
Learning: For indirect dependencies with license compliance issues in the cloudposse/atmos repository, the team prefers to handle them in follow-up PRs rather than blocking the current changes, as these issues often require deeper investigation of the dependency tree.
Learnt from: osterman
Repo: cloudposse/atmos PR: 1466
File: website/docs/cli/commands/toolchain/usage.mdx:117-121
Timestamp: 2025-09-08T01:25:44.958Z
Learning: The atmos toolchain has been updated to follow XDG Base Directory Specification with helper functions GetXDGCacheDir() and GetXDGTempCacheDir() in toolchain/xdg_cache.go, using XDG_CACHE_HOME when set and falling back to ~/.cache/atmos-toolchain, making it consistent with atmos core's XDG compliance.
Learnt from: Listener430
Repo: cloudposse/atmos PR: 934
File: tests/fixtures/scenarios/docs-generate/README.md.gotmpl:99-118
Timestamp: 2025-01-25T03:51:57.689Z
Learning: For the cloudposse/atmos repository, changes to template contents should be handled in dedicated PRs and are typically considered out of scope for PRs focused on other objectives.
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Include integration tests for command flows and test CLI end-to-end when possible with test fixtures
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gotoolchain/uninstall_test.go
📚 Learning: 2025-12-10T18:32:43.260Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1808
File: cmd/terraform/backend/backend_delete_test.go:9-23
Timestamp: 2025-12-10T18:32:43.260Z
Learning: In cmd subpackages, tests should avoid using NewTestKit(t) unless tests actually interact with RootCmd (e.g., execute commands via RootCmd or modify RootCmd state). For structural tests that only verify command structure/flags without touching RootCmd, TestKit cleanup is unnecessary.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to cmd/**/*_test.go : Always use `cmd.NewTestKit(t)` for cmd tests to auto-clean RootCmd state
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gotoolchain/uninstall_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to cmd/**/*.go : Provide comprehensive help text for all commands and flags, include examples in command help, and follow Go's documentation conventions in Cobra command definitions
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Use table-driven tests for testing multiple scenarios in Go
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gotoolchain/uninstall_test.go
📚 Learning: 2025-05-23T19:51:47.091Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: The atmos codebase has a custom extension to *testing.T that provides a Chdir method, allowing test functions to call t.Chdir() to change working directories during tests. This is used consistently across test files in the codebase.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to cmd/**/*.go : Use Cobra's recommended command structure with a root command and subcommands, implementing each command in a separate file under `cmd/` directory
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*_test.go : Every new feature must include comprehensive unit tests targeting >80% code coverage for all packages
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gotoolchain/uninstall_test.go
📚 Learning: 2024-12-13T15:28:13.630Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 844
File: cmd/version.go:34-44
Timestamp: 2024-12-13T15:28:13.630Z
Learning: In `cmd/version.go`, when handling the `--check` flag in the `versionCmd`, avoid using `CheckForAtmosUpdateAndPrintMessage(cliConfig)` as it updates the cache timestamp, which may not be desired in this context.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2024-12-07T16:16:13.038Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 825
File: internal/exec/helmfile_generate_varfile.go:28-31
Timestamp: 2024-12-07T16:16:13.038Z
Learning: In `internal/exec/helmfile_generate_varfile.go`, the `--help` command (`./atmos helmfile generate varfile --help`) works correctly without requiring stack configurations, and the only change needed was to make `ProcessCommandLineArgs` exportable by capitalizing its name.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-11-11T03:47:45.878Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: toolchain/add_test.go:67-77
Timestamp: 2025-11-11T03:47:45.878Z
Learning: In the cloudposse/atmos codebase, tests should prefer t.Setenv for environment variable setup/teardown instead of os.Setenv/Unsetenv to ensure test-scoped isolation.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.go
📚 Learning: 2025-11-11T03:47:59.576Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: toolchain/which_test.go:166-223
Timestamp: 2025-11-11T03:47:59.576Z
Learning: In the cloudposse/atmos repo, tests that manipulate environment variables should use testing.T.Setenv for automatic setup/teardown instead of os.Setenv/Unsetenv.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.go
📚 Learning: 2025-05-23T19:51:47.091Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: In the atmos codebase, t.Chdir() is a valid method call on *testing.T objects and works correctly for changing directories in tests. This is implemented through custom testing framework extensions and is used consistently throughout the test suite.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.go
📚 Learning: 2025-05-23T19:51:47.091Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: In the atmos codebase, t.Chdir() is a valid method call on *testing.T objects and works correctly for changing directories in tests.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.go
📚 Learning: 2025-05-23T19:51:47.091Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1255
File: cmd/describe_affected_test.go:15-15
Timestamp: 2025-05-23T19:51:47.091Z
Learning: In the atmos codebase, t.Chdir() is a valid method that can be called on *testing.T objects. This functionality is implemented through custom testing framework extensions and is used consistently throughout the test suite for changing working directories during tests.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-11-10T23:23:39.771Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: toolchain/registry/aqua/aqua_test.go:417-442
Timestamp: 2025-11-10T23:23:39.771Z
Learning: In Atmos toolchain AquaRegistry, tests should not hit real GitHub. Use the options pattern via WithGitHubBaseURL to inject an httptest server URL and make GetLatestVersion/GetAvailableVersions deterministic.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gotoolchain/uninstall_test.go
📚 Learning: 2025-01-09T22:27:25.538Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 914
File: cmd/validate_stacks.go:20-23
Timestamp: 2025-01-09T22:27:25.538Z
Learning: The validate commands in Atmos can have different help handling implementations. Specifically, validate_component.go and validate_stacks.go are designed to handle help requests differently, with validate_stacks.go including positional argument checks while validate_component.go does not.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-12-13T04:37:40.435Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: cmd/toolchain/get.go:23-40
Timestamp: 2025-12-13T04:37:40.435Z
Learning: In Go CLI command files using Cobra, constrain the subcommand to accept at most one positional argument (MaximumNArgs(1)) so it supports both listing all items (zero args) and fetching a specific item (one arg). Define and parse flags with a standard parser (e.g., flags.NewStandardParser()) and avoid binding flags to Viper (no viper.BindEnv/BindPFlag). This promotes explicit argument handling and predictable flag behavior across command files.
Applied to files:
cmd/cmd_utils_test.go
📚 Learning: 2025-12-21T04:10:29.030Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1891
File: internal/exec/describe_affected.go:468-468
Timestamp: 2025-12-21T04:10:29.030Z
Learning: In Go, package-level declarations (constants, variables, types, and functions) are visible to all files in the same package without imports. During reviews in cloudposse/atmos (and similar Go codebases), before suggesting to declare a new identifier, first check if it already exists in another file of the same package. If it exists, you can avoid adding a new declaration; if not, proceed with a proper package-level declaration.
Applied to files:
cmd/cmd_utils_test.gotoolchain/install_test.gotoolchain/uninstall_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to **/*_test.go : Prefer unit tests with mocks over integration tests - use interfaces and dependency injection for testability, generate mocks with `go.uber.org/mock/mockgen`, use table-driven tests, target >80% coverage
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-09-08T01:25:44.958Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1466
File: website/docs/cli/commands/toolchain/usage.mdx:117-121
Timestamp: 2025-09-08T01:25:44.958Z
Learning: The atmos toolchain XDG compliance implementation is complete with GetXDGCacheDir() and GetXDGTempCacheDir() functions in toolchain/xdg_cache.go, updated installer.go and toolchain_clean.go to use these helpers, and changed cache paths from ~/.cache/tools-cache to ${XDG_CACHE_HOME}/atmos-toolchain (or ~/.cache/atmos-toolchain when XDG_CACHE_HOME is not set).
Applied to files:
toolchain/install_test.gotoolchain/uninstall_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to {go.mod,go.sum} : Manage dependencies with Go modules and keep dependencies up to date while minimizing external dependencies
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Ensure all tests pass, verify code coverage meets targets, run golangci-lint and fix any issues, and update documentation before submitting pull requests
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to **/*.go : Use interfaces for external dependencies to facilitate mocking and consider using testify/mock for creating mock implementations
Applied to files:
toolchain/install_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Define interfaces for all major functionality and use dependency injection for testability in Go code
Applied to files:
toolchain/install_test.go
📚 Learning: 2024-11-18T13:59:10.824Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 768
File: internal/exec/vendor_model_component.go:3-20
Timestamp: 2024-11-18T13:59:10.824Z
Learning: When replacing significant dependencies like `go-getter` that require extensive changes, prefer to address them in separate PRs.
Applied to files:
toolchain/install_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to **/*.go : All comments must end with periods (enforced by `godot` linter) in Go code
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-11-24T17:35:37.209Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: .cursor/rules/atmos-rules.mdc:0-0
Timestamp: 2025-11-24T17:35:37.209Z
Learning: Applies to cmd/**/*.go : Provide meaningful feedback to users and include progress indicators for long-running operations in CLI commands
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-12-13T06:10:13.688Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: errors/errors.go:184-203
Timestamp: 2025-12-13T06:10:13.688Z
Learning: cloudposse/atmos: For toolchain work, duplicate/unused error sentinels in errors/errors.go should be cleaned up in a separate refactor PR and not block feature PRs; canonical toolchain sentinels live under toolchain/registry with re-exports in toolchain/errors.go.
Applied to files:
toolchain/install_test.go
📚 Learning: 2024-10-23T21:36:40.262Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 740
File: cmd/cmd_utils.go:340-359
Timestamp: 2024-10-23T21:36:40.262Z
Learning: In the Go codebase for Atmos, when reviewing functions like `checkAtmosConfig` in `cmd/cmd_utils.go`, avoid suggesting refactoring to return errors instead of calling `os.Exit` if such changes would significantly increase the scope due to the need to update multiple call sites.
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-03-25T12:23:42.649Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 1149
File: internal/exec/go_getter_utils.go:104-104
Timestamp: 2025-03-25T12:23:42.649Z
Learning: Listener430 plans to add a test for verifying that token injection is skipped for unsupported hosts in a future review or refactoring iteration. This relates to the CustomGitDetector.Detect method in internal/exec/go_getter_utils.go.
Applied to files:
toolchain/install_test.go
📚 Learning: 2024-12-02T21:26:32.337Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 808
File: pkg/config/config.go:478-483
Timestamp: 2024-12-02T21:26:32.337Z
Learning: In the 'atmos' project, when reviewing Go code like `pkg/config/config.go`, avoid suggesting file size checks after downloading remote configs if such checks aren't implemented elsewhere in the codebase.
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-08-15T14:43:41.030Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1352
File: pkg/store/artifactory_store_test.go:108-113
Timestamp: 2025-08-15T14:43:41.030Z
Learning: In test files for the atmos project, it's acceptable to ignore errors from os.Setenv/Unsetenv operations during test environment setup and teardown, as these are controlled test scenarios.
Applied to files:
toolchain/install_test.go
📚 Learning: 2024-12-25T20:28:47.526Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 887
File: internal/exec/stack_processor_utils.go:380-380
Timestamp: 2024-12-25T20:28:47.526Z
Learning: Windows path handling often requires `filepath.Join` to ensure correct separators and comparisons. Insufficient tests can break cross-platform compatibility, so migrating from `path.Join` to `filepath.Join` needs thorough testing on Windows before merging.
Applied to files:
toolchain/install_test.go
📚 Learning: 2026-01-04T00:55:21.720Z
Learnt from: CR
Repo: cloudposse/atmos PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-04T00:55:21.720Z
Learning: Applies to **/*.go : Code must be compatible with Linux, macOS, and Windows - use SDKs over binaries, use `filepath.Join()` instead of hardcoded path separators
Applied to files:
toolchain/install_test.go
📚 Learning: 2024-12-25T20:28:19.618Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 887
File: internal/exec/workflow_utils.go:167-169
Timestamp: 2024-12-25T20:28:19.618Z
Learning: The user plans to revert the change from `path.Join` to `filepath.Join` in this PR due to testing gaps and will open a new PR to safely handle the migration without breaking `main`.
Applied to files:
toolchain/install_test.go
📚 Learning: 2024-10-28T01:51:30.811Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 727
File: internal/exec/terraform_clean.go:329-332
Timestamp: 2024-10-28T01:51:30.811Z
Learning: In the Atmos Go code, when deleting directories or handling file paths (e.g., in `terraform_clean.go`), always resolve the absolute path using `filepath.Abs` and use the logger `u.LogWarning` for logging messages instead of using `fmt.Printf`.
Applied to files:
toolchain/install_test.go
📚 Learning: 2024-10-23T20:13:23.054Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 731
File: pkg/utils/file_utils.go:198-202
Timestamp: 2024-10-23T20:13:23.054Z
Learning: In `pkg/utils/file_utils.go`, the current implementation of the `IsURL` function is considered sufficient; avoid suggesting more complex URL validation in future reviews.
Applied to files:
toolchain/install_test.go
📚 Learning: 2025-10-10T23:51:36.597Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1599
File: internal/exec/terraform.go:394-402
Timestamp: 2025-10-10T23:51:36.597Z
Learning: In Atmos (internal/exec/terraform.go), when adding OpenTofu-specific flags like `--var-file` for `init`, do not gate them based on command name (e.g., checking if `info.Command == "tofu"` or `info.Command == "opentofu"`) because command names don't reliably indicate the actual binary being executed (symlinks, aliases). Instead, document the OpenTofu requirement in code comments and documentation, trusting users who enable the feature (e.g., `PassVars`) to ensure their terraform command points to an OpenTofu binary.
Applied to files:
toolchain/install_test.go
🧬 Code graph analysis (2)
toolchain/install_test.go (4)
toolchain/installer/installer.go (2)
New(192-226)NewInstallerWithResolver(230-237)toolchain/install.go (3)
RunInstall(105-164)RunInstallBatch(363-377)InstallOptions(29-35)toolchain/types.go (1)
NewInstallerWithResolver(91-99)cmd/cmd_utils.go (1)
Contains(1454-1461)
toolchain/uninstall_test.go (7)
toolchain/installer/mock_resolver_test.go (1)
SetAtmosConfig(23-25)toolchain/setup.go (1)
SetAtmosConfig(29-33)toolchain/uninstall.go (1)
RunUninstall(66-91)toolchain/installer/errors.go (1)
ErrInvalidToolSpec(22-22)toolchain/registry/registry.go (1)
ErrInvalidToolSpec(20-20)cmd/cmd_utils.go (1)
Contains(1454-1461)toolchain/types.go (1)
NewInstallerWithBinDir(148-152)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Acceptance Tests (linux)
- GitHub Check: Acceptance Tests (macos)
- GitHub Check: Acceptance Tests (windows)
- GitHub Check: Summary
🔇 Additional comments (12)
cmd/cmd_utils_test.go (3)
1582-1642: Solid table-driven test coverage.Good edge case handling—particularly the "similar but not matching" and "duplicate ATMOS_CHDIR entries" cases. These are easy to miss. The test structure follows guidelines well and doesn't require NewTestKit since it doesn't touch RootCmd.
1644-1740: Well-structured command hierarchy tests.The setup function pattern for creating different command trees keeps things readable. Good coverage including nil safety, boundary cases like "version list" not being a management command, and the parent-name check with "non-atmos parent."
1742-1769: Clean option function test.Starting with the opposite value before applying the option is a nice touch—confirms the function actually changes state rather than just verifying a default.
toolchain/uninstall_test.go (1)
349-387: Solid table-driven test coverage.Good use of the table-driven pattern with clear test cases covering the main invalid format scenarios. The assertions properly validate both error type and message content.
toolchain/install_test.go (8)
16-26: Solid test helpers.Clean factory functions for creating UI test doubles. Comments are properly terminated.
28-79: Well-structured test with proper cleanup.Uses
t.Cleanup()for config restoration,t.Setenv()for env vars, and proper mock injection. Good pattern.
81-105: Correctly updated for new API.Test properly uses the 5-argument
RunInstallsignature with appropriate flag values.
298-367: Good table-driven tests for UI resilience.Verifying no-panic behavior across edge cases is appropriate for output functions. Good coverage of boundary conditions.
465-542: Comprehensive test with good edge case coverage.The "invalid tool is skipped" case properly validates that unresolvable tools don't break the build list.
544-585: Past issue resolved.Comment now has trailing period. Test properly exercises the three result states.
641-688: Thorough model testing.Good coverage of the Bubble Tea model lifecycle - init, view states, and update with various message types.
789-804: Simple struct validation.Basic but harmless. Ensures the struct fields are accessible.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
|
These changes were released in v1.204.0-rc.5. |
what
New Feature: Automatic Toolchain Integration
.tool-versionsfile.tool-versionsBug Fixes (Toolchain Bootstrap)
atmos bootstrapfailures for AWS CLI, jq, gum, and replicated by removing unconditional version prefixversion_prefixdefaults to empty string, not "v"ErrHTTP404in 404 errors to enable version fallback mechanismfiles.srcfor tools like Helm that use{{.OS}}-{{.Arch}}pathsresolveVersionOverridesfor version-specific configsdarwin_allpattern support for universal macOS binariesBug Fixes (Workflows)
--stackflag is not provided. Previously, runningatmos workflow <name>would fail with "stack base path must be provided" even for simple shell workflows that don't use stacks. Now stacks are only validated when--stackis explicitly passed.Bug Fixes (Batch Install UX)
SkipToolVersionsUpdateoption to prevent duplicate entries when bothInstallSingleToolandupdateToolVersionsFileare calledShowInstallDetailsoption to show only simple "Installed X" messages in batch mode, while single-tool mode retains verbose output (path, size, registered)showProgressBarparameter -RunInstallnow acceptsshowProgressBarto control spinner visibility for custom command installsBug Fixes (Error Handling)
b.erris nil by using cause directly as the stored errorGetAllHints()atmos.yamltoolchain installdirectlyDocumentation & Examples
examples/toolchain/with working examples showing:.tool-versionsfile with tool dependenciesopentofu: "^1.10.0"constraint^1.7.0,~> 4.40.0)Test Coverage
DependencyProviderinterface for testabilityensureToolchainDependencies()covering all code paths.tool-versionsdirectory error pathTestWorkflowWithoutStacksConfig- workflows succeed without stacks configTestWorkflowWithStackFlagRequiresStacksConfig- workflows fail when--stackpassed but stacks not configuredTestWorkflowWithStackFlagAndStacksConfigured- workflows succeed when both are presentwhy
Toolchain Integration
Users managing infrastructure often need specific tool versions (terraform, kubectl, helm). The
.tool-versionsfile is a standard way to declare these dependencies (used by asdf, mise). This PR enables Atmos to:.tool-versionsand automatically install required toolsBootstrap Fixes
After PR #1948, multiple tools failed to install during bootstrap because version prefix handling didn't match Aqua's behavior. The code was unconditionally adding a "v" prefix when
version_prefixwas empty, breaking HTTP URLs (AWS CLI expectsAWSCLIV2-2.32.31notAWSCLIV2-v2.32.31).Workflow Conditional Stack Processing
The workflow command was always requiring stacks configuration even when running simple shell workflows that don't reference any stacks. This was because
InitCliConfig(info, true)unconditionally validated stacks. Now the second parameter is set based on whether--stackflag was provided, allowing workflows to run without any stacks configured.Batch Install UX Improvements
The batch installer had several UX issues:
handleInstallSuccessandupdateToolVersionsFilewere writing to.tool-versionswith different keys (e.g., "gum" vs "charmbracelet/gum")Error Handling Robustness
ErrorBuilder.WithCausecould panic if called with nil base error - now handles gracefullyExample Usage
.tool-versions:
Workflow with override:
Component with tool dependency:
references
website/docs/core-concepts/custom-commands/commands.mdxwebsite/docs/core-concepts/workflows/workflows.mdxexamples/toolchain/Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.