Skip to content

feat: Add multi-package support and fix toolchain add help text#1979

Merged
aknysh merged 26 commits intomainfrom
osterman/toolchain-help-fix
Jan 21, 2026
Merged

feat: Add multi-package support and fix toolchain add help text#1979
aknysh merged 26 commits intomainfrom
osterman/toolchain-help-fix

Conversation

@osterman
Copy link
Copy Markdown
Member

@osterman osterman commented Jan 16, 2026

what

  • Support multiple tools in a single atmos toolchain add command
  • Default version to latest when omitted (e.g., atmos toolchain add terraform)
  • Fixed help examples to use @ syntax (tool@version) instead of incorrect space-separated syntax
  • Updated CLI documentation and removed phantom --file flag references
  • Added comprehensive tests for multi-package and latest-version-default behavior

why

The help text was showing incorrect space-separated syntax (<tool-name> <version>) which didn't match the actual command behavior that uses @ syntax (tool@version). Users also couldn't add multiple tools efficiently. This fix aligns the UX with other similar CLIs and improves productivity for users managing toolchains.

references

Related to improving the toolchain command usability and fixing the discrepancy between documented and actual command syntax.

Summary by CodeRabbit

  • New Features

    • Add accepts multiple tool[@Version] args (version defaults to latest); new --tool-versions flag. Env supports a new github format and --output/-o (auto-uses GITHUB_PATH); path acts as an env alias for PATH emission.
  • Bug Fixes

    • Clearer, actionable errors and hints for missing tools and unknown commands.
    • More resilient release fetching with retries and backoff.
    • Improved ANSI-aware formatting/whitespace handling for CLI output.
  • Documentation

    • CLI docs and blog updated with GitHub Actions PATH examples and usage.
  • Tests

    • Expanded unit tests across toolchain commands, env/path emitters, formatting, and ANSI trimming.

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

- Support multiple tools in single command: `atmos toolchain add terraform@1.5.0 kubectl@1.28.0`
- Default to 'latest' version when version omitted: `atmos toolchain add terraform`
- Fix help examples to use @ syntax instead of space-separated (e.g. `tool@version`)
- Remove phantom --file flag, document global --tool-versions flag
- Add comprehensive cmd-level tests for multi-package and latest default behavior
- Update CLI documentation with correct syntax and examples

Fixes incorrect help text that showed space-separated syntax which didn't match
actual command behavior. Improves UX by supporting multiple tools in one command
and defaulting to latest version like other similar CLIs.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@osterman osterman requested a review from a team as a code owner January 16, 2026 19:10
@github-actions github-actions bot added the size/m Medium size PR label Jan 16, 2026
@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 16, 2026

Dependency Review

✅ No vulnerabilities or license issues found.

Scanned Files

None

@osterman osterman added the minor New features that do not break anything label Jan 16, 2026
@github-actions
Copy link
Copy Markdown

Warning

Release Documentation Required

This PR is labeled minor or major and requires documentation updates:

  • Changelog entry - Add a blog post in website/blog/YYYY-MM-DD-feature-name.mdx
  • Roadmap update - Update website/src/data/roadmap.js with the new milestone

Alternatively: If this change doesn't require release documentation, remove the minor or major label.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

Adds variadic multi-tool support to atmos toolchain add (accepts tool[@Version]..., defaults omitted versions to latest); extends toolchain env/path emission with a --output/-o file-append option and new github format that writes to $GITHUB_PATH when available; introduces InstallLocator and refactors path helpers, emitters, and ANSI trimming utilities.

Changes

Cohort / File(s) Summary
Add Command
cmd/toolchain/add.go
Make add variadic tool[@Version]>..., require >=1 arg, parse each token, default empty versions to latest, iterate AddToolVersion and wrap per-arg errors.
Add Command Tests
cmd/toolchain/add_test.go
New tests for usage, MinimumNArgs(1), per-arg parsing, default-to-latest behavior, multi-arg flows and error wrapping.
Command Provider Tests
cmd/toolchain/command_provider_test.go
New test scaffolding and table-driven checks validating command providers and structures.
Env CLI wiring & Path alias
cmd/toolchain/env.go, cmd/toolchain/path.go
Add --output/-o (ATMOS_TOOLCHAIN_ENV_OUTPUT), include github in formats; path now maps flags to a format and delegates to EmitEnv(format, relative, outputPath).
EmitEnv & Format Helpers
toolchain/env.go, toolchain/path_helpers.go, toolchain/path_helpers_test.go
EmitEnv signature → (format, relativeFlag, outputPath); add github emitter, append-to-file support, formatter helpers, structured errors, ToolPath type, buildPathEntries returns []ToolPath; extensive path helper tests added.
Removed Old Path Module
toolchain/path.go (deleted)
Old EmitPath, ToolPath (old copy), and JSON emit helpers removed; functionality migrated into EmitEnv + path helpers.
Env Output & Formatting Tests
toolchain/env_output_test.go, toolchain/env_test.go
New tests for appendToFile, per-format content generation, Github/GITHUB_PATH behavior, escaping rules, and updated error/hint assertions.
Install Locator Interface & Mock
toolchain/install_locator.go, toolchain/mock_install_locator_test.go
New exported InstallLocator interface (ParseToolSpec, FindBinaryPath) with gomock-generated mock.
CLI Command Tests (get/which/path)
cmd/toolchain/get_test.go, cmd/toolchain/which_test.go, cmd/toolchain/path_test.go
Added/updated tests for flags, args, examples and help strings.
Docs & Help
cmd/markdown/atmos_toolchain_add.md, website/docs/.../toolchain-add.mdx, website/docs/.../toolchain-env.mdx, tests/snapshots/...help.stdout.golden
Update add syntax to tool[@Version]..., rename --file--tool-versions, document --output and github format and GITHUB_PATH behavior; help snapshot updated.
Website & Plugin
website/blog/2026-01-17-github-actions-toolchain-path.mdx, website/src/data/roadmap.js, website/plugins/fetch-latest-release/index.js
New blog post for GitHub Actions PATH integration; roadmap updated; fetchLatestRelease adds retry/backoff/timeouts.
CLI Executor & Root
cmd/internal/executor.go, cmd/internal/executor_test.go, cmd/root.go
Introduce executor wrapper to convert Cobra errors to sentinel errors; root uses internal.Execute and errors.Is-based handling for Unknown Command.
Arg Validation Registry
cmd/internal/registry.go, multiple cmd/*
Registry now sets cobra.NoArgs by default for commands without a PositionalArgsBuilder; several commands adjusted (clean, list, version, about, env, workflow).
ANSI & Trimming
pkg/ansi/*, pkg/ui/*
New pkg/ansi utilities (Strip/Length/Trim*), heavy test additions; pkg/ui delegates trimming to pkg/ansi, style tweaks (DocumentIndent/H1 spacing) and formatter updates.
Misc Tests Removed/Updated
pkg/ui/formatter_test.go, toolchain/path_test.go (deleted)
Removed/updated legacy trimming and EmitPath tests in favor of new unit tests and refactors.

Sequence Diagram(s)

sequenceDiagram
    participant CLI as atmos toolchain env/path
    participant Emit as EmitEnv(format, relativeFlag, outputPath)
    participant PathHelpers as buildPathEntries()
    participant Formatter as Formatter/formatContentForFile
    participant FileSys as File System / stdout

    CLI->>Emit: call(format, relativeFlag, outputPath)
    Emit->>PathHelpers: buildPathEntries(relativeFlag)
    PathHelpers-->>Emit: []ToolPath, finalPath
    Emit->>Formatter: select formatter by format
    Formatter-->>Emit: formatted content
    alt outputPath provided
        Emit->>FileSys: append content to outputPath (appendToFile)
    else github format & GITHUB_PATH set
        Emit->>FileSys: append content to $GITHUB_PATH
    else
        Emit->>FileSys: write content to stdout
    end
    FileSys-->>Emit: success / error
    Emit-->>CLI: return nil / error
Loading
sequenceDiagram
    participant User as User
    participant CLIAdd as atmos toolchain add
    participant Validator as Args Validator
    participant Parser as Token Parser
    participant Installer as AddToolVersion

    User->>CLIAdd: add tool1 tool2@1.0 tool3
    CLIAdd->>Validator: ensure >= 1 arg
    Validator-->>CLIAdd: ok
    loop per argument
        CLIAdd->>Parser: parse "tool[`@version`]"
        alt version present
            Parser-->>CLIAdd: tool, version
        else
            Parser-->>CLIAdd: tool, "" (default to "latest")
        end
        CLIAdd->>Installer: AddToolVersion(tool, versionOrLatest)
        Installer-->>CLIAdd: success / error
        alt error
            CLIAdd-->>User: return wrapped error immediately
        end
    end
    CLIAdd-->>User: success
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 51.52% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: multi-tool support for the toolchain add command and correction of help text syntax.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch osterman/toolchain-help-fix

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

The atmos toolchain add command is updated to support adding multiple tools in a single invocation using a condensed <tool[@Version]> syntax with versions defaulting to "latest" when omitted. Documentation, code, and tests are aligned accordingly.

Changes

Cohort / File(s) Summary
Command Logic
cmd/toolchain/add.go
Modified argument validation from ExactArgs(1) to MinimumArgs(1). RunE logic now iterates over all provided arguments, parsing each tool[@Version] pair individually and defaulting missing versions to "latest" before invoking AddToolVersion per tool.
Test Coverage
cmd/toolchain/add_test.go
New test file with 119 lines covering argument handling (zero, single, and multiple args), command structure verification (Use, Short, Long, RunE presence), variadic argument support, and documentation of latest version defaults.
Documentation
cmd/markdown/atmos_toolchain_add.md, website/docs/cli/commands/toolchain/toolchain-add.mdx
Updated usage syntax from <tool-name> <version> to <tool[@Version]>.... Examples and argument descriptions now reflect optional version notation, multiple tool support in one call, and --tool-versions flag replacing --file.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • osterman
  • aknysh
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: adding multi-package support to the toolchain add command and fixing its help text to use correct syntax.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch osterman/toolchain-help-fix

🧹 Recent nitpick comments
cmd/toolchain/add_test.go (1)

1-119: Consider adding RunE behavior tests.

Current tests verify structure and argument validation, but don't test the actual RunE logic (parsing, defaulting to "latest", calling AddToolVersion). You'd need to mock toolchain.AddToolVersion to unit test that path.

Want me to sketch out an approach using dependency injection to make RunE testable?


📜 Recent 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.

📥 Commits

Reviewing files that changed from the base of the PR and between bda1aab and af9c19a.

📒 Files selected for processing (4)
  • cmd/markdown/atmos_toolchain_add.md
  • cmd/toolchain/add.go
  • cmd/toolchain/add_test.go
  • website/docs/cli/commands/toolchain/toolchain-add.mdx
🧰 Additional context used
📓 Path-based instructions (7)
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 under cmd/ 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/toolchain/add_test.go
  • cmd/toolchain/add.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 using fmt.Errorf("context: %w", err), and consider using custom error types for domain-specific errors
Follow standard Go coding style: use gofmt and goimports to 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 by godot linter) 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 in errors/errors.go - use errors.Join for combining errors, fmt.Errorf with %w for context, and errors.Is() for error checking
Never manually create mocks - use go.uber.org/mock/mockgen with //go:generate directives 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 from pkg/ui/theme/colors.go for all UI theming in Go code
Code must be compatible with Linux, macOS, and Windows - use SDKs over binaries, use filepath.Join() instead of h...

Files:

  • cmd/toolchain/add_test.go
  • cmd/toolchain/add.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 fixtures

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

Files:

  • cmd/toolchain/add_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, using nil if no atmosConfig param - exceptions: trivial getters/setters, command constructors, simple factories, functions delegating to tracked functions

Files:

  • cmd/toolchain/add_test.go
  • cmd/toolchain/add.go
cmd/**/*_test.go

📄 CodeRabbit inference engine (CLAUDE.md)

Always use cmd.NewTestKit(t) for cmd tests to auto-clean RootCmd state

Files:

  • cmd/toolchain/add_test.go
website/**

📄 CodeRabbit inference engine (.cursor/rules/atmos-rules.mdc)

website/**: Update website documentation in the website/ directory when adding new features, ensure consistency between CLI help text and website documentation, and follow the website's documentation structure and style
Keep website code in the website/ directory, follow the existing website architecture and style, and test website changes locally before committing
Keep CLI documentation and website documentation in sync and document new features on the website with examples and use cases

Files:

  • website/docs/cli/commands/toolchain/toolchain-add.mdx
website/docs/cli/commands/**/*.mdx

📄 CodeRabbit inference engine (CLAUDE.md)

All CLI command documentation MUST include: frontmatter, Intro component, Screengrab, Usage section, Arguments/Flags in <dl> format, and Examples section

Files:

  • website/docs/cli/commands/toolchain/toolchain-add.mdx
🧠 Learnings (25)
📓 Common learnings
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: 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: 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.
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: docs/prd/tool-dependencies-integration.md:58-64
Timestamp: 2025-12-13T06:07:37.766Z
Learning: cloudposse/atmos: For PRD docs (docs/prd/*.md), markdownlint issues like MD040/MD010/MD034 can be handled in a separate documentation cleanup commit and should not block the current PR.
Learnt from: osterman
Repo: cloudposse/atmos PR: 1533
File: pkg/config/load.go:585-637
Timestamp: 2025-09-27T20:50:20.564Z
Learning: In the cloudposse/atmos repository, command merging prioritizes precedence over display ordering. Help commands are displayed lexicographically regardless of internal array order, so the mergeCommandArrays function focuses on ensuring the correct precedence chain (top-level file wins) rather than maintaining specific display order.
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: 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: osterman
Repo: cloudposse/atmos PR: 729
File: internal/exec/help.go:48-51
Timestamp: 2024-10-27T16:59:26.187Z
Learning: In the Atmos CLI help messages, when providing examples that include the version number, use the actual version variable (e.g., `version.Version`) instead of placeholders like `<version>`.
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 should follow XDG Base Directory Specification like the rest of atmos core, using XDG_CACHE_HOME environment variable when available and falling back to ~/.cache when not set, instead of hardcoding ~/.cache/tools-cache paths.
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: cmd/markdown/atmos_toolchain_aliases.md:2-4
Timestamp: 2025-09-13T16:39:20.007Z
Learning: In the cloudposse/atmos repository, CLI documentation files in cmd/markdown/ follow a specific format that uses " $ atmos command" (with leading space and dollar sign prompt) in code blocks. This is the established project convention and should not be changed to comply with standard markdownlint rules MD040 and MD014.
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: 775
File: examples/quick-start-advanced/Dockerfile:9-9
Timestamp: 2024-11-12T03:15:15.627Z
Learning: It is acceptable to set `ARG ATMOS_VERSION` to a future version like `1.105.0` in `examples/quick-start-advanced/Dockerfile` if that will be the next release.
Learnt from: RoseSecurity
Repo: cloudposse/atmos PR: 1448
File: cmd/ansible.go:26-28
Timestamp: 2025-09-05T14:57:37.360Z
Learning: The Atmos codebase uses a consistent pattern for commands that delegate to external tools: `PersistentFlags().Bool("", false, doubleDashHint)` where doubleDashHint provides help text about using double dashes to separate Atmos options from native command arguments. This pattern is used across terraform, packer, helmfile, atlantis, aws, and ansible commands.
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 955
File: tests/snapshots/TestCLICommands_atmos_validate_editorconfig_--help.stdout.golden:0-0
Timestamp: 2025-01-19T15:49:15.593Z
Learning: In future commits, the help text for Atmos CLI commands should be limited to only show component and stack parameters for commands that actually use them. This applies to the example usage section in command help text.
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: cmd/root.go:0-0
Timestamp: 2025-12-13T04:37:25.223Z
Learning: In Atmos cmd/root.go Execute(), after cfg.InitCliConfig, we must call both toolchainCmd.SetAtmosConfig(&atmosConfig) and toolchain.SetAtmosConfig(&atmosConfig) so the CLI wrapper and the toolchain package receive configuration; missing either can cause nil-pointer panics in toolchain path resolution.
📚 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/toolchain/add_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/toolchain/add_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/toolchain/add_test.go
  • cmd/toolchain/add.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/toolchain/add_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/toolchain/add_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/toolchain/add_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:

  • cmd/toolchain/add_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/toolchain/add_test.go
  • cmd/toolchain/add.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:

  • cmd/toolchain/add_test.go
📚 Learning: 2025-01-09T22:37:01.004Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 914
File: cmd/terraform_commands.go:260-265
Timestamp: 2025-01-09T22:37:01.004Z
Learning: In the terraform commands implementation (cmd/terraform_commands.go), the direct use of `os.Args[2:]` for argument handling is intentionally preserved to avoid extensive refactoring. While it could be improved to use cobra's argument parsing, such changes should be handled in a dedicated PR to maintain focus and minimize risk.

Applied to files:

  • cmd/toolchain/add_test.go
  • cmd/toolchain/add.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/toolchain/add_test.go
  • cmd/toolchain/add.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:

  • cmd/toolchain/add_test.go
📚 Learning: 2025-09-05T14:57:37.360Z
Learnt from: RoseSecurity
Repo: cloudposse/atmos PR: 1448
File: cmd/ansible.go:26-28
Timestamp: 2025-09-05T14:57:37.360Z
Learning: The Atmos codebase uses a consistent pattern for commands that delegate to external tools: `PersistentFlags().Bool("", false, doubleDashHint)` where doubleDashHint provides help text about using double dashes to separate Atmos options from native command arguments. This pattern is used across terraform, packer, helmfile, atlantis, aws, and ansible commands.

Applied to files:

  • cmd/toolchain/add_test.go
  • cmd/markdown/atmos_toolchain_add.md
📚 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/toolchain/add_test.go
  • cmd/toolchain/add.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 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.

Applied to files:

  • cmd/markdown/atmos_toolchain_add.md
📚 Learning: 2025-09-13T16:39:20.007Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: cmd/markdown/atmos_toolchain_aliases.md:2-4
Timestamp: 2025-09-13T16:39:20.007Z
Learning: In the cloudposse/atmos repository, CLI documentation files in cmd/markdown/ follow a specific format that uses " $ atmos command" (with leading space and dollar sign prompt) in code blocks. This is the established project convention and should not be changed to comply with standard markdownlint rules MD040 and MD014.

Applied to files:

  • cmd/markdown/atmos_toolchain_add.md
📚 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:

  • cmd/markdown/atmos_toolchain_add.md
📚 Learning: 2024-10-27T16:59:26.187Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 729
File: internal/exec/help.go:48-51
Timestamp: 2024-10-27T16:59:26.187Z
Learning: In the Atmos CLI help messages, when providing examples that include the version number, use the actual version variable (e.g., `version.Version`) instead of placeholders like `<version>`.

Applied to files:

  • cmd/markdown/atmos_toolchain_add.md
📚 Learning: 2025-01-19T15:49:15.593Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 955
File: tests/snapshots/TestCLICommands_atmos_validate_editorconfig_--help.stdout.golden:0-0
Timestamp: 2025-01-19T15:49:15.593Z
Learning: In future commits, the help text for Atmos CLI commands should be limited to only show component and stack parameters for commands that actually use them. This applies to the example usage section in command help text.

Applied to files:

  • cmd/markdown/atmos_toolchain_add.md
📚 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:

  • cmd/markdown/atmos_toolchain_add.md
📚 Learning: 2025-02-18T13:13:11.497Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1068
File: tests/snapshots/TestCLICommands_atmos_terraform_help.stdout.golden:59-64
Timestamp: 2025-02-18T13:13:11.497Z
Learning: For Atmos CLI help text, angle brackets in command examples and flag descriptions should be escaped using HTML entities (e.g., `&lt;component&gt;`) rather than converted to backticks or other markdown formatting.

Applied to files:

  • cmd/markdown/atmos_toolchain_add.md
📚 Learning: 2025-12-13T04:37:25.223Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1686
File: cmd/root.go:0-0
Timestamp: 2025-12-13T04:37:25.223Z
Learning: In Atmos cmd/root.go Execute(), after cfg.InitCliConfig, we must call both toolchainCmd.SetAtmosConfig(&atmosConfig) and toolchain.SetAtmosConfig(&atmosConfig) so the CLI wrapper and the toolchain package receive configuration; missing either can cause nil-pointer panics in toolchain path resolution.

Applied to files:

  • cmd/markdown/atmos_toolchain_add.md
📚 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:

  • cmd/markdown/atmos_toolchain_add.md
📚 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 README.md : Update README.md with new commands and features

Applied to files:

  • website/docs/cli/commands/toolchain/toolchain-add.mdx
🧬 Code graph analysis (2)
cmd/toolchain/add_test.go (1)
cmd/toolchain/add.go (1)
  • AddCommandProvider (36-36)
cmd/toolchain/add.go (2)
toolchain/tool_versions.go (1)
  • ParseToolVersionArg (312-335)
toolchain/add.go (1)
  • AddToolVersion (11-33)
🪛 markdownlint-cli2 (0.18.1)
cmd/markdown/atmos_toolchain_add.md

3-3: Dollar signs used before commands without showing output

(MD014, commands-show-output)


7-7: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


8-8: Dollar signs used before commands without showing output

(MD014, commands-show-output)


12-12: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


13-13: Dollar signs used before commands without showing output

(MD014, commands-show-output)


17-17: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


18-18: Dollar signs used before commands without showing output

(MD014, commands-show-output)

⏰ 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). (1)
  • GitHub Check: Summary
🔇 Additional comments (8)
cmd/toolchain/add.go (2)

11-32: Solid multi-tool implementation.

The loop-based approach handles variadic arguments cleanly. Fail-fast on first error is reasonable for CLI commands. The "latest" default aligns with user expectations.

One consideration: if a user adds 5 tools and the 4th fails, the first 3 are already written. This partial-success behavior might be worth documenting or handling with a rollback, but it's acceptable for a CLI tool.


35-60: Provider implementation looks good.

Standard pattern, consistent with other toolchain commands.

cmd/markdown/atmos_toolchain_add.md (1)

1-19: Documentation examples are accurate and comprehensive.

The examples cover all use cases: specific version, default to latest, multi-tool, and custom file path. The markdownlint warnings about dollar signs and code fence languages are expected per project convention. Based on learnings, the " $ atmos command" format is the established pattern in cmd/markdown/.

cmd/toolchain/add_test.go (2)

11-32: Good structural coverage.

These tests verify the command metadata effectively. Note there's some overlap with TestAddCommand_LatestVersionDefault (both check for "latest" in Long description).


74-106: Table-driven tests are well structured.

Clean coverage of argument counts. This overlaps somewhat with TestAddCommand_Args but the table-driven approach here is more thorough.

website/docs/cli/commands/toolchain/toolchain-add.mdx (3)

22-40: Examples are clear and consistent.

Good coverage showing both short names (terraform) and full owner/repo format. Multi-tool example aligns with cmd/markdown/atmos_toolchain_add.md.


44-54: Arguments section documents the new syntax well.

The (required, repeatable) annotation and default-to-latest behavior are clearly explained. Format examples help users understand both short and long forms.


56-63: Flag documentation updated correctly.

The --tool-versions flag with its default path is documented. Matches the global flag behavior.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 16, 2026
Add native GitHub Actions support for `atmos toolchain env` with several
improvements:

New features:
- Add `--format github` that outputs paths one per line, compatible with
  GitHub Actions' $GITHUB_PATH environment file
- Add `--output` flag to append output to any file instead of stdout
- Auto-detect $GITHUB_PATH when using github format and write to it
- Show success message when writing to file

Improvements:
- Fix PATH not respecting user's $PATH - use os.Getenv instead of viper
- Add helpful error hints when tools aren't installed:
  - "Run 'atmos toolchain add'" when no .tool-versions file
  - "Run 'atmos toolchain install'" when tools not installed
- Make `toolchain path` an alias for `toolchain env` with flag mapping

Technical changes:
- Refactor appendToFile to reduce cyclomatic complexity
- Extract format-specific content generation into helper functions
- Add constants for shell escaping to satisfy magic constant linter
- Update tests to use t.Setenv for proper test isolation
- Add comprehensive tests for new functionality

Documentation:
- Update toolchain-env.mdx with github format and --output flag
- Add blog post announcing GitHub Actions support
- Update roadmap with GitHub Actions integration milestone

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions github-actions bot added size/xl Extra large size PR and removed size/m Medium size PR labels Jan 16, 2026
@mergify
Copy link
Copy Markdown

mergify bot commented Jan 16, 2026

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.
Consider refactoring it into smaller, more focused PRs to facilitate a smoother review process.

Add pr: 1979 to the Native GitHub Actions PATH integration milestone
and add the PR to the ci-cd initiative's prs array.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Update golden snapshot for toolchain --help to reflect recent changes
  (add description pluralized, path description includes alias note)
- Fix TestConstructFinalPath to use os.PathListSeparator instead of
  hardcoded ':' for Windows compatibility
- Fix TestAppendToFile_FishFormat to use platform-appropriate path
  separator since formatFishContent splits by os.PathListSeparator
- Fix TestResolveDirPath to use filepath.IsAbs() instead of checking
  result[0] == '/' which fails on Windows drive letters (e.g., D:\)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The test expected 5 formats but supportedFormats now includes "github"
(added in commit 3b6c9c1 for GitHub Actions support).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 17, 2026

Codecov Report

❌ Patch coverage is 90.42254% with 34 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.10%. Comparing base (2f95f4a) to head (3e96fdb).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
toolchain/env.go 81.39% 13 Missing and 3 partials ⚠️
toolchain/path_helpers.go 52.38% 9 Missing and 1 partial ⚠️
cmd/root.go 50.00% 1 Missing and 1 partial ⚠️
cmd/toolchain/add.go 77.77% 1 Missing and 1 partial ⚠️
pkg/ansi/trim.go 98.37% 2 Missing ⚠️
pkg/ui/formatter.go 83.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1979      +/-   ##
==========================================
+ Coverage   74.97%   75.10%   +0.13%     
==========================================
  Files         775      777       +2     
  Lines       71464    71636     +172     
==========================================
+ Hits        53577    53804     +227     
+ Misses      14402    14345      -57     
- Partials     3485     3487       +2     
Flag Coverage Δ
unittests 75.10% <90.42%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
cmd/about/about.go 81.81% <ø> (+9.09%) ⬆️
cmd/env/env.go 51.85% <ø> (ø)
cmd/help_template.go 80.09% <100.00%> (ø)
cmd/internal/executor.go 100.00% <100.00%> (ø)
cmd/internal/registry.go 87.96% <100.00%> (+0.22%) ⬆️
cmd/list/list.go 100.00% <ø> (ø)
cmd/toolchain/clean.go 54.54% <ø> (ø)
cmd/toolchain/env.go 80.00% <100.00%> (+22.85%) ⬆️
cmd/toolchain/list.go 80.00% <ø> (ø)
cmd/toolchain/path.go 89.18% <100.00%> (+20.43%) ⬆️
... and 11 more

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Add comprehensive tests for cmd/toolchain command providers:
- command_provider_test.go: Table-driven tests for all CommandProviders
- get_test.go: Flag and argument validation tests
- path_test.go: Flag description tests
- which_test.go: Example and argument validation tests

Expand toolchain/ package tests:
- path_helpers_test.go: Empty PATH fallback, edge cases, cross-platform fixes
- env_output_test.go: Format helper function tests

Fix pre-existing lint issues:
- packer.go: Convert single-case switch to if statement
- packer_output.go: Fix error string capitalization

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mergify
Copy link
Copy Markdown

mergify bot commented Jan 18, 2026

💥 This pull request now has conflicts. Could you fix it @osterman? 🙏

@mergify mergify bot added the conflict This PR has conflicts label Jan 18, 2026
…lp-fix

# Conflicts:
#	internal/exec/packer.go
#	internal/exec/packer_output.go
@mergify mergify bot removed the conflict This PR has conflicts label Jan 18, 2026
Add retry logic with exponential backoff to handle transient network
issues in CI when fetching the latest release from GitHub API:
- Retry up to 3 times for transient errors (timeout, abort, DNS, reset)
- Use exponential backoff (1s, 2s, 4s) between retries
- Log warnings when retrying to help debug CI issues

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
cmd/env/env.go (1)

23-26: Harden env output file permissions. These files may contain secrets; using 0o644 makes newly created files world-readable. Prefer 0o600 by default.

🔒 Proposed change.
-	defaultFileMode = 0o644
+	defaultFileMode = 0o600

Also applies to: 194-199

🤖 Fix all issues with AI agents
In `@cmd/version/version.go`:
- Around line 36-38: Update the comment above the versionCmd declaration to
accurately state that the command registry will automatically apply NoArgs to
any command that does not define an Args field and does not provide a
PositionalArgsBuilder, not only to parent commands with subcommands; reference
the versionCmd symbol and mention the Args and PositionalArgsBuilder concepts so
readers know where this behavior originates.

- Add DocumentIndent constant (2 spaces) for left margin on markdown content
- Add Document.Indent to glamour stylesheet for visual breathing room
- Add H1 Prefix/Suffix spaces for internal padding inside colored header box
- Adjust word wrap width calculation to account for document indent
- Update test expected values to include the 2-space indent

This fixes the `atmos about` command output where:
- Content started flush against the terminal edge
- H1 header text touched the blue background edges

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Consolidates duplicate ANSI manipulation functions from across the codebase
into a single, reusable pkg/ansi package:

- Create pkg/ansi/ansi.go with Strip, Length, and core parsing helpers
- Create pkg/ansi/trim.go with TrimRight, TrimLinesRight, and related functions
- Add comprehensive tests in pkg/ansi/*_test.go
- Remove ~370 lines of ANSI functions from pkg/ui/formatter.go
- Update cmd/root.go and cmd/help_template.go to use new package

The new package distinguishes between styled content (with background color
48;2;...) and Glamour padding (foreground-only 38;2;...) to preserve
intentional suffix spaces like H1 header badges " About Atmos " while
trimming unnecessary padding.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add 13 edge case tests to pkg/ansi/trim_test.go covering:
- Loop iteration paths in TrimRight (consecutive resets, styled space + bare ANSI)
- Early return edge cases in trimTrailingStyledSpace (just reset code, non-space
  before reset, plain space without ANSI, malformed ANSI without m terminator)
- Malformed ANSI sequences in trimTrailingBareANSI (empty string, no terminator)
- Short indent edge case in TrimTrailingWhitespace (fewer spaces than indent width)

Coverage improved from 93.4% to 99.3%. The remaining 0.7% is defensive dead code
in TrimLeftSpaces (break skipLoop) that cannot be reached due to preconditions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Args: cobra.MaximumNArgs(1) to workflow command to allow the optional
workflow name to pass through to execution logic.

This fixes a regression from commit a46962d where NoArgs was auto-applied
to commands without explicit Args. The workflow command needs to accept an
optional workflow name (0 or 1 args) so users get helpful contextual errors
like "No workflow exists" with available workflows listed, instead of generic
"Unknown command X for atmos workflow" errors.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add perf.Track to Execute function in cmd/internal/executor.go
- Check flag-set errors with require.NoError in cmd/toolchain/path_test.go
- Clarify comment about registry-applied Args in cmd/version/version.go
- Fix pre-existing lint issues in cmd/vendor.go and cmd/vendor_pull.go

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@mergify
Copy link
Copy Markdown

mergify bot commented Jan 20, 2026

💥 This pull request now has conflicts. Could you fix it @osterman? 🙏

@mergify mergify bot added the conflict This PR has conflicts label Jan 20, 2026
Update golden snapshot to match new error output format after
merging main with updated error handling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update the comment above versionCmd to explain the exact conditions under
which the command registry applies cobra.NoArgs automatically:
- Command does not define an Args field
- CommandProvider does not return a PositionalArgsBuilder

Reference the specific file (cmd/internal/registry.go) and explain how
this applies to versionCmd.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aknysh aknysh merged commit 6afea27 into main Jan 21, 2026
92 of 93 checks passed
@aknysh aknysh deleted the osterman/toolchain-help-fix branch January 21, 2026 04:26
aknysh added a commit that referenced this pull request Jan 21, 2026
Merge main branch to incorporate recent changes including:
- GitHub Actions PATH integration (PR #1979)
- Locals YAML functions support
- Toolchain improvements
- Various bug fixes and enhancements

Resolved conflicts in:
- website/plugins/fetch-latest-release/index.js
- website/src/data/roadmap.js

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

These changes were released in v1.204.1-rc.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor New features that do not break anything size/xl Extra large size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants