Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
9b57ef4
Add vendor update and diff commands
osterman Oct 21, 2025
058a3ec
Add version constraints support for vendor updates
osterman Oct 21, 2025
22b89d6
Update vendor diff documentation to reflect GitHub-only implementation
osterman Oct 21, 2025
c8b4f89
Add vendor source provider interface for multi-provider support
osterman Oct 21, 2025
54c8fa6
Fix code quality and documentation issues per review
osterman Oct 21, 2025
9bc2952
docs: Add comprehensive version constraints documentation
osterman Oct 21, 2025
79e8ab8
docs: Add blog post for vendor update and diff feature
osterman Oct 21, 2025
92ea64c
docs: Strengthen blog post messaging on update debt and shared respon…
osterman Oct 22, 2025
4064d98
Merge main into feat/vendor-diff-and-update
osterman Oct 30, 2025
af9f14a
[autofix.ci] apply automated fixes
autofix-ci[bot] Oct 30, 2025
bb1ff4b
fix: Add performance tracking and update deprecated imports
osterman Oct 30, 2025
84c89fa
[autofix.ci] apply automated fixes
autofix-ci[bot] Oct 30, 2025
9fcde50
Merge origin/main into feat/vendor-diff-and-update
osterman Dec 1, 2025
4d8ce52
refactor: Move vendor commands to cmd/vendor/ and logic to pkg/vendor…
osterman Dec 2, 2025
280d390
fix: Address CodeRabbit review comments for vendor commands
osterman Dec 2, 2025
76bdbf4
refactor: Split pkg/vendoring into source/ and version/ subpackages
osterman Dec 5, 2025
ccb5be3
Merge remote-tracking branch 'origin/main' into feat/vendor-diff-and-…
osterman Dec 5, 2025
a01f0d2
fix: Address CodeRabbit review comments for GitHub provider
osterman Dec 5, 2025
16adbc8
Merge remote-tracking branch 'origin/main' into feat/vendor-diff-and-…
osterman Dec 6, 2025
00eab04
Merge origin/main into feat/vendor-diff-and-update
osterman Dec 7, 2025
6002313
Merge origin/main into feat/vendor-diff-and-update
osterman Dec 10, 2025
22134ca
fix: Address CodeRabbit PR review comments
osterman Dec 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 18 additions & 14 deletions cmd/vendor_diff.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,18 @@ import (

// vendorDiffCmd executes 'vendor diff' CLI commands.
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.",
Use: "diff",
Short: "Show Git diff between two versions of a vendored component",
Long: `This command shows the Git diff between two versions of a vendored component from the remote repository.

The command uses Git to compare two refs (tags, branches, or commits) without requiring a local clone.
Output is colorized automatically when output is to a terminal.

Use --from and --to to specify versions, or let it default to current version vs latest.`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
handleHelpRequest(cmd, args)
// TODO: There was no documentation here:https://atmos.tools/cli/commands/vendor we need to know what this command requires to check if we should add usage help

// Check Atmos configuration
// Vendor diff doesn't require stack validation
checkAtmosConfig()

err := e.ExecuteVendorDiffCmd(cmd, args)
Expand All @@ -25,11 +28,12 @@ var vendorDiffCmd = &cobra.Command{
}

func init() {
vendorDiffCmd.PersistentFlags().StringP("component", "c", "", "Compare the differences between the local and vendored versions of the specified component.")
AddStackCompletion(vendorDiffCmd)
vendorDiffCmd.PersistentFlags().StringP("type", "t", "terraform", "Compare the differences between the local and vendored versions of the specified component, filtering by type (terraform or helmfile).")
vendorDiffCmd.PersistentFlags().Bool("dry-run", false, "Simulate the comparison of differences between the local and vendored versions of the specified component without making any changes.")

// Since this command is not implemented yet, exclude it from `atmos help`
// vendorCmd.AddCommand(vendorDiffCmd)
vendorDiffCmd.PersistentFlags().StringP("component", "c", "", "Component to diff (required)")
_ = vendorDiffCmd.RegisterFlagCompletionFunc("component", ComponentsArgCompletion)
vendorDiffCmd.PersistentFlags().String("from", "", "Starting version/tag/commit (defaults to current version in vendor.yaml)")
vendorDiffCmd.PersistentFlags().String("to", "", "Ending version/tag/commit (defaults to latest)")
vendorDiffCmd.PersistentFlags().String("file", "", "Show diff for specific file within component")
vendorDiffCmd.PersistentFlags().IntP("context", "C", 3, "Number of context lines")
vendorDiffCmd.PersistentFlags().Bool("unified", true, "Show unified diff format")
vendorCmd.AddCommand(vendorDiffCmd)
}
39 changes: 39 additions & 0 deletions cmd/vendor_update.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
)

// vendorUpdateCmd executes 'vendor update' CLI commands.
var vendorUpdateCmd = &cobra.Command{
Use: "update",
Short: "Update version references in vendor configurations to their latest versions",
Long: `This command checks upstream Git sources for newer versions and updates the version references in vendor configuration files.

The command supports checking Git repositories for newer tags and commits, and will preserve YAML structure including anchors, comments, and formatting.

Use the --check flag to see what updates are available without making changes.
Use the --pull flag to both update version references and pull the new components.`,
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
// Vendor update doesn't require stack validation
checkAtmosConfig()

err := e.ExecuteVendorUpdateCmd(cmd, args)
return err
},
}

func init() {
vendorUpdateCmd.PersistentFlags().Bool("check", false, "Check for updates without modifying configuration files (dry-run mode)")
vendorUpdateCmd.PersistentFlags().Bool("pull", false, "Update version references AND pull the new component versions")
vendorUpdateCmd.PersistentFlags().StringP("component", "c", "", "Update version for the specified component name")
_ = vendorUpdateCmd.RegisterFlagCompletionFunc("component", ComponentsArgCompletion)
vendorUpdateCmd.PersistentFlags().String("tags", "", "Update versions for components with the specified tags (comma-separated)")
vendorUpdateCmd.PersistentFlags().StringP("type", "t", "terraform", "Component type: terraform or helmfile")
vendorUpdateCmd.PersistentFlags().Bool("outdated", false, "Show only components with available updates (use with --check)")
vendorCmd.AddCommand(vendorUpdateCmd)
}
Loading
Loading