Skip to content

feat: Add command aliases for vendor and workflow list#1981

Merged
aknysh merged 5 commits intomainfrom
osterman/check-vendor-workflow-cmds
Jan 20, 2026
Merged

feat: Add command aliases for vendor and workflow list#1981
aknysh merged 5 commits intomainfrom
osterman/check-vendor-workflow-cmds

Conversation

@osterman
Copy link
Copy Markdown
Member

@osterman osterman commented Jan 16, 2026

What

Added bidirectional command aliases so users can use both atmos vendor list and atmos list vendor interchangeably, and atmos workflow list and atmos list workflows interchangeably. Refactored vendor command to use CommandProvider pattern to support aliases.

Why

Users naturally expect list commands under the parent command (e.g., atmos vendor list), while Atmos organizes all list commands under atmos list. This bidirectional aliasing improves discoverability and follows the existing pattern used for atmos list themesatmos theme list. Demo tapes can now use intuitive command forms.

References

Related to demo tape cleanup where atmos vendor list and atmos workflow list were changed to cat vendor.yaml and atmos describe workflows respectively due to missing commands.

Summary by CodeRabbit

  • New Features

    • Added command aliases: atmos vendor listatmos list vendor and atmos workflow listatmos list workflows.
    • Introduced a top-level vendor command with pull and diff subcommands (with their flags).
  • Bug Fixes / UX

    • CLI help updated to show workflow [command] indicating it accepts subcommands.
  • Refactor

    • Reorganized vendor command implementation for cleaner structure.

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

- Added `atmos vendor list` as alias for `atmos list vendor`
- Added `atmos workflow list` as alias for `atmos list workflows`
- Refactored vendor command to use CommandProvider pattern for alias support
- Added blog post documenting the new aliases
- Updated roadmap with shipped milestone

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:25
@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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jan 16, 2026

Warning

Rate limit exceeded

@osterman has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 3 minutes and 25 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 480667b and c78a9da.

📒 Files selected for processing (2)
  • cmd/root.go
  • website/src/data/roadmap.js
📝 Walkthrough

Walkthrough

Adds a VendorCommandProvider-based vendor command (with pull/diff stubs), removes legacy vendor command files, registers the provider via side-effect import, and adds two CLI aliases: atmos vendor list and atmos workflow list for the existing list subcommands.

Changes

Cohort / File(s) Summary
List command aliases
cmd/list/list.go, cmd/list/list_test.go
GetAliases() now returns two aliases (atmos vendor list, atmos workflow list) instead of nil; tests updated to validate alias metadata (Subcommand, ParentCommand, Name, Long, Example).
Vendor command provider
cmd/vendor/vendor.go, cmd/vendor/vendor_test.go
New VendorCommandProvider implementing command registry methods; defines top-level vendor command and pull/diff subcommand wiring, flags, and executor delegation; tests added for provider behavior.
Root registration
cmd/root.go
Added side-effect import to register the new vendor provider with the command registry.
Removed legacy vendor files
cmd/vendor.go, cmd/vendor_pull.go, cmd/vendor_diff.go, cmd/vendor_test.go
Deleted old standalone vendor command implementations and associated tests (consolidated into provider).
Docs / roadmap
website/blog/2026-01-16-vendor-workflow-list-aliases.mdx, website/src/data/roadmap.js
New blog post describing aliases and roadmap entries marking feature shipped (Q1-2026).
CLI help snapshots
tests/snapshots/*help*.stdout.golden
Updated help output formatting for workflow to show subcommand placeholder (workflow [command]) and related snapshot updates.

Sequence Diagram(s)

sequenceDiagram
  participant User as User (CLI)
  participant Root as RootCmd
  participant Registry as Command Registry
  participant ListProv as ListCommandProvider
  participant VendorProv as VendorCommandProvider
  participant Executor as Command Executor

  rect rgba(200,200,255,0.5)
    User->>Root: runs "atmos vendor list" (alias)
    Root->>Registry: resolve command providers & aliases
    Registry->>ListProv: match alias -> "list vendor"
    ListProv->>Executor: invoke list vendor handler
    Executor-->>User: outputs vendor list
  end
Loading
sequenceDiagram
  participant Start as App start
  participant Root as root.go
  participant SideImport as cmd/vendor package
  participant Registry as Command Registry

  rect rgba(200,255,200,0.5)
    Start->>Root: initialize CLI
    Root->>SideImport: side-effect import (registers provider)
    SideImport->>Registry: register VendorCommandProvider
    Registry-->>Root: vendor command available
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • aknysh
  • kevcube
  • milldr
🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% 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 accurately summarizes the main change: adding command aliases for vendor and workflow list commands, matching the core objective of enabling bidirectional command usage.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch osterman/check-vendor-workflow-cmds

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.

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

🤖 Fix all issues with AI agents
In `@cmd/vendor/vendor_test.go`:
- Around line 10-19: The test currently calls vendorPullCmd.RunE(...) which
bypasses Cobra flag parsing and passes "--invalid-flag" as a positional arg to
ExecuteVendorPullCmd; to properly test invalid flag handling, replace the RunE
call with vendorPullCmd.SetArgs([]string{"--invalid-flag"}) followed by
vendorPullCmd.Execute() (keeping the same assertion on err), or alternatively
rename TestVendorCommands_Error and its comment to state it validates handling
of positional arguments via ExecuteVendorPullCmd if you prefer not to change
execution style; target the vendorPullCmd, RunE, SetArgs and Execute symbols
when making this change.
🧹 Nitpick comments (5)
website/src/data/roadmap.js (1)

199-199: Consider adding the PR number to the milestone entry.

Per coding guidelines, shipped milestones should include the PR number for traceability. This helps users track back to the original implementation.

Suggested addition
-        { label: 'Command aliases for vendor and workflow list', status: 'shipped', quarter: 'q1-2026', changelog: 'vendor-workflow-list-aliases', description: 'Added `atmos vendor list` and `atmos workflow list` as aliases for their `atmos list` counterparts for intuitive command discovery.', benefits: 'Users can use either command form. Natural command structure regardless of preference.' },
+        { label: 'Command aliases for vendor and workflow list', status: 'shipped', quarter: 'q1-2026', pr: 1981, changelog: 'vendor-workflow-list-aliases', description: 'Added `atmos vendor list` and `atmos workflow list` as aliases for their `atmos list` counterparts for intuitive command discovery.', benefits: 'Users can use either command form. Natural command structure regardless of preference.' },
cmd/list/list.go (1)

77-99: LGTM!

The alias structure correctly follows the CommandAlias interface pattern. Both aliases are well-documented with appropriate Short, Long, and Example fields.

One minor nit: the comment at line 79 is missing a trailing period (enforced by godot linter per coding guidelines).

Add trailing period to comment
 // GetAliases returns command aliases for list subcommands.
 // Creates "atmos vendor list" as an alias for "atmos list vendor".
-// Creates "atmos workflow list" as an alias for "atmos list workflows".
+// Creates "atmos workflow list" as an alias for "atmos list workflows".

Wait, the period is already there. Let me re-check... Yes, line 79 does end with a period. All good!

website/blog/2026-01-16-vendor-workflow-list-aliases.mdx (1)

16-17: Minor wording repetition.

Static analysis flagged "now" appearing twice in close proximity. Not blocking, but consider rephrasing for flow.

Suggested rewording
-- `atmos vendor list` is now an alias for `atmos list vendor`
-- `atmos workflow list` is now an alias for `atmos list workflows`
+- `atmos vendor list` → alias for `atmos list vendor`
+- `atmos workflow list` → alias for `atmos list workflows`
cmd/vendor/vendor.go (2)

21-32: Consider simplifying the RunE return.

The logic works fine, but the intermediate err variable is unnecessary here.

Simplify RunE
 	RunE: func(cmd *cobra.Command, args []string) error {
-		err := e.ExecuteVendorPullCmd(cmd, args)
-		return err
+		return e.ExecuteVendorPullCmd(cmd, args)
 	},

34-44: Missing Args constraint on vendorDiffCmd.

For consistency with vendorPullCmd, consider adding Args: cobra.NoArgs to prevent unexpected positional arguments when this command is eventually enabled.

Add Args constraint
 var vendorDiffCmd = &cobra.Command{
 	Use:                "diff",
 	Short:              "Show differences in vendor configurations or dependencies",
 	Long:               "This command compares and displays the differences in vendor-specific configurations or dependencies.",
 	FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
+	Args:               cobra.NoArgs,
 	RunE: func(cmd *cobra.Command, args []string) error {
-		err := e.ExecuteVendorDiffCmd(cmd, args)
-		return err
+		return e.ExecuteVendorDiffCmd(cmd, args)
 	},
 }
📜 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 d6e2a01.

📒 Files selected for processing (11)
  • cmd/list/list.go
  • cmd/list/list_test.go
  • cmd/root.go
  • cmd/vendor.go
  • cmd/vendor/vendor.go
  • cmd/vendor/vendor_test.go
  • cmd/vendor_diff.go
  • cmd/vendor_pull.go
  • cmd/vendor_test.go
  • website/blog/2026-01-16-vendor-workflow-list-aliases.mdx
  • website/src/data/roadmap.js
💤 Files with no reviewable changes (4)
  • cmd/vendor_test.go
  • cmd/vendor_pull.go
  • cmd/vendor.go
  • cmd/vendor_diff.go
🧰 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/root.go
  • cmd/list/list.go
  • cmd/vendor/vendor.go
  • cmd/vendor/vendor_test.go
  • cmd/list/list_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 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/root.go
  • cmd/list/list.go
  • cmd/vendor/vendor.go
  • cmd/vendor/vendor_test.go
  • cmd/list/list_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/root.go
  • cmd/list/list.go
  • cmd/vendor/vendor.go
  • cmd/vendor/vendor_test.go
  • cmd/list/list_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/blog/2026-01-16-vendor-workflow-list-aliases.mdx
  • website/src/data/roadmap.js
website/blog/*.mdx

📄 CodeRabbit inference engine (CLAUDE.md)

PRs labeled minor or major MUST include a blog post at website/blog/YYYY-MM-DD-feature-name.mdx with YAML frontmatter, using only tags defined in website/blog/tags.yml

Files:

  • website/blog/2026-01-16-vendor-workflow-list-aliases.mdx
**/*_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/vendor/vendor_test.go
  • cmd/list/list_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/vendor/vendor_test.go
  • cmd/list/list_test.go
🧠 Learnings (24)
📓 Common learnings
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: 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: 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
📚 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:

  • cmd/root.go
📚 Learning: 2025-07-05T20:59:02.914Z
Learnt from: aknysh
Repo: cloudposse/atmos PR: 1363
File: internal/exec/template_utils.go:18-18
Timestamp: 2025-07-05T20:59:02.914Z
Learning: In the Atmos project, gomplate v4 is imported with a blank import (`_ "github.com/hairyhenderson/gomplate/v4"`) alongside v3 imports to resolve AWS SDK version conflicts. V3 uses older AWS SDK versions that conflict with newer AWS modules used by Atmos. A full migration to v4 requires extensive refactoring due to API changes and should be handled in a separate PR.

Applied to files:

  • cmd/root.go
  • cmd/vendor/vendor.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:

  • cmd/root.go
📚 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/root.go
📚 Learning: 2024-12-11T18:40:12.808Z
Learnt from: Listener430
Repo: cloudposse/atmos PR: 844
File: cmd/helmfile.go:37-37
Timestamp: 2024-12-11T18:40:12.808Z
Learning: In the atmos project, `cliConfig` is initialized within the `cmd` package in `root.go` and can be used in other command files.

Applied to files:

  • cmd/root.go
  • cmd/vendor/vendor.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:

  • cmd/root.go
📚 Learning: 2025-10-07T00:25:16.333Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 1498
File: website/src/components/Screengrabs/atmos-terraform-metadata--help.html:25-55
Timestamp: 2025-10-07T00:25:16.333Z
Learning: In Atmos CLI, subcommands inherit flags from their parent commands via Cobra's command inheritance. For example, `atmos terraform metadata --help` shows `--affected` and related flags inherited from the parent `terraform` command (defined in cmd/terraform.go), even though the metadata subcommand doesn't explicitly define these flags. This is expected Cobra behavior and auto-generated help screengrabs accurately reflect this inheritance.

Applied to files:

  • cmd/root.go
  • cmd/vendor/vendor.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/root.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/root.go
📚 Learning: 2025-01-30T19:30:59.120Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 959
File: cmd/workflow.go:74-74
Timestamp: 2025-01-30T19:30:59.120Z
Learning: Error handling for `cmd.Usage()` is not required in the Atmos CLI codebase, as confirmed by the maintainer.

Applied to files:

  • cmd/root.go
📚 Learning: 2025-09-13T18:06:07.674Z
Learnt from: samtholiya
Repo: cloudposse/atmos PR: 1466
File: toolchain/list.go:39-42
Timestamp: 2025-09-13T18:06:07.674Z
Learning: In the cloudposse/atmos repository, for UI messages in the toolchain package, use utils.PrintfMessageToTUI instead of log.Error or fmt.Fprintln(os.Stderr, ...). Import pkg/utils with alias "u" to follow the established pattern.

Applied to files:

  • cmd/root.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/root.go
  • cmd/list/list.go
  • cmd/vendor/vendor.go
  • cmd/vendor/vendor_test.go
  • cmd/list/list_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/root.go
  • cmd/list/list.go
  • cmd/vendor/vendor.go
  • cmd/vendor/vendor_test.go
  • cmd/list/list_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/vendor/vendor.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/vendor/vendor.go
  • cmd/vendor/vendor_test.go
📚 Learning: 2025-11-10T03:03:31.505Z
Learnt from: osterman
Repo: cloudposse/atmos PR: 0
File: :0-0
Timestamp: 2025-11-10T03:03:31.505Z
Learning: In the Atmos codebase, commands using the `StandardParser` flag pattern (from pkg/flags) do NOT need explicit `viper.BindPFlag()` calls in their code. The StandardParser encapsulates flag binding internally: flags are registered via `parser.RegisterFlags(cmd)` in init(), and bound via `parser.BindFlagsToViper(cmd, v)` in RunE, which internally calls viper.BindPFlag for each flag. This pattern is used throughout Atmos (e.g., cmd/toolchain/get.go, cmd/toolchain/info.go, cmd/toolchain/install.go, cmd/toolchain/path.go). Do not flag missing viper.BindPFlag calls when StandardParser is used.

Applied to files:

  • cmd/vendor/vendor.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/vendor/vendor.go
📚 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:

  • website/blog/2026-01-16-vendor-workflow-list-aliases.mdx
📚 Learning: 2025-09-27T20:50:20.564Z
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.

Applied to files:

  • website/blog/2026-01-16-vendor-workflow-list-aliases.mdx
📚 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/vendor/vendor_test.go
  • cmd/list/list_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/vendor/vendor_test.go
  • cmd/list/list_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/vendor/vendor_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: PRs labeled `minor` or `major` MUST update `website/src/data/roadmap.js` with shipped milestones, status, changelog link, PR number, and initiative progress percentage

Applied to files:

  • website/src/data/roadmap.js
🧬 Code graph analysis (3)
cmd/list/list.go (1)
cmd/internal/command.go (1)
  • CommandAlias (11-31)
cmd/vendor/vendor.go (2)
internal/exec/vendor.go (2)
  • ExecuteVendorPullCmd (27-31)
  • ExecuteVendorDiffCmd (34-36)
pkg/flags/compat/compatibility_flags.go (1)
  • CompatibilityFlag (33-37)
cmd/vendor/vendor_test.go (1)
cmd/vendor/vendor.go (1)
  • VendorCommandProvider (70-70)
🪛 LanguageTool
website/blog/2026-01-16-vendor-workflow-list-aliases.mdx

[style] ~17-~17: The adverb ‘now’ was used before in the same sentence. Consider replacing or removing one.
Context: ...list vendor-atmos workflow listis now an alias foratmos list workflows` Bo...

(NOW_REPETITION)

⏰ 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). (3)
  • GitHub Check: Acceptance Tests (macos)
  • GitHub Check: Acceptance Tests (windows)
  • GitHub Check: Summary
🔇 Additional comments (10)
cmd/root.go (1)

65-65: LGTM!

The blank import for side-effect registration follows the established pattern used by other command packages in this file. Alphabetical ordering is correct.

cmd/list/list_test.go (1)

277-296: LGTM!

Test coverage is thorough. Validates both aliases with appropriate assertions for Subcommand, ParentCommand, Name, Long, and Example fields. Using assert.Contains for Long and Example is a good choice—it's flexible enough to survive minor wording changes.

website/blog/2026-01-16-vendor-workflow-list-aliases.mdx (2)

8-41: LGTM!

Blog post is clear, concise, and accurately documents the new aliases. Code examples demonstrate equivalence well.


1-6: The "enhancement" tag is valid and properly defined in website/blog/tags.yml. The blog post follows all requirements: correct file path format, proper YAML frontmatter, and uses only defined tags. No changes needed.

cmd/vendor/vendor.go (4)

1-10: LGTM!

Package declaration and imports are clean. Proper grouping with stdlib first, then third-party, then internal packages.


12-19: LGTM!

Clear command definition with descriptive Short and Long help text. FParseErrWhitelist and Args: cobra.NoArgs are appropriately set.


46-67: LGTM!

Flags are well-documented, subcommand wiring is clean, and the registration with the command registry is properly placed in init(). Good call commenting out the unimplemented vendorDiffCmd.


69-110: LGTM!

The VendorCommandProvider implementation is straightforward and follows the interface contract. Methods are trivial getters/factories, so perf.Track is correctly omitted per guidelines. Documentation comments end with periods as required.

cmd/vendor/vendor_test.go (2)

1-8: LGTM!

Imports are clean with proper grouping.


21-58: LGTM!

Solid coverage of the VendorCommandProvider interface. Subtests are well-organized and verify each method's return value correctly. No NewTestKit needed here since these tests don't interact with RootCmd.

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

Renamed TestVendorCommands_Error to TestVendorPullCmd_ExecutorError
and updated the test to pass "unexpected-arg" instead of "--invalid-flag"
since calling RunE directly bypasses Cobra's flag parsing.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
coderabbitai[bot]
coderabbitai bot previously approved these changes Jan 16, 2026
@osterman osterman added the minor New features that do not break anything label Jan 16, 2026
The workflow command now shows [command] in help output because it has
a subcommand (workflow list alias).

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 92.15686% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.95%. Comparing base (cfd385e) to head (c78a9da).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
cmd/vendor/vendor.go 88.88% 4 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1981      +/-   ##
==========================================
+ Coverage   74.91%   74.95%   +0.03%     
==========================================
  Files         777      775       -2     
  Lines       71333    71355      +22     
==========================================
+ Hits        53439    53484      +45     
+ Misses      14412    14390      -22     
+ Partials     3482     3481       -1     
Flag Coverage Δ
unittests 74.95% <92.15%> (+0.03%) ⬆️

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

Files with missing lines Coverage Δ
cmd/list/list.go 100.00% <100.00%> (ø)
cmd/root.go 68.45% <ø> (ø)
cmd/vendor/vendor.go 88.88% <88.88%> (ø)

... and 2 files with indirect coverage changes

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

@mergify
Copy link
Copy Markdown

mergify bot commented Jan 17, 2026

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

@mergify mergify bot added the conflict This PR has conflicts label Jan 17, 2026
Resolved conflict in website/src/data/roadmap.js by keeping both entries:
- Command aliases for vendor and workflow list (this branch)
- Packer directory-based templates (from main)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@aknysh aknysh merged commit 1eeae7d into main Jan 20, 2026
57 checks passed
@aknysh aknysh deleted the osterman/check-vendor-workflow-cmds branch January 20, 2026 05:46
@github-actions
Copy link
Copy Markdown

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

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/m Medium size PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants