Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
d5b0d86
feat: implement source provisioner for JIT component vendoring
osterman Dec 16, 2025
d8d65a2
docs: add terraform source command documentation and blog post
osterman Dec 16, 2025
9db8739
fix: address code review feedback and pre-existing lint issues
osterman Dec 16, 2025
469747c
feat: add GetUserHomeDir and ObfuscateSensitivePaths utilities
osterman Dec 16, 2025
e3c1566
test: regenerate snapshots for terraform source command
osterman Dec 16, 2025
1d0c569
test: increase test coverage for source provisioner and terraform sou…
osterman Dec 17, 2025
8f0f356
fix: add performance tracking to GetUserHomeDir and ObfuscateSensitiv…
osterman Dec 17, 2025
4425208
feat: Move source configuration from metadata.source to top-level sou…
osterman Dec 18, 2025
d0e0543
fix: Update describe command output to match stack manifest schema
osterman Dec 18, 2025
05adcca
refactor: update user-facing strings from metadata.source to source
osterman Dec 18, 2025
ae8fe32
test: regenerate golden snapshots for source field
osterman Dec 18, 2025
f8fc419
fix: add missing perf.Track calls and fix atmosConfigPtr references
osterman Dec 18, 2025
a338dbb
refactor: consolidate source create/update commands into pull
osterman Dec 18, 2025
5b2264c
refactor: reorganize terraform source and generate docs into folders
osterman Dec 18, 2025
63e6e09
fix: address CodeRabbit review feedback
osterman Dec 18, 2025
67bed0f
chore: update NOTICE file for dario.cat/mergo URL change
osterman Dec 19, 2025
bf1d1d2
[autofix.ci] apply automated fixes
autofix-ci[bot] Dec 19, 2025
0357e22
feat: add retry support with exponential backoff for source/vendoring…
osterman Dec 19, 2025
ebf9d39
docs: add retry configuration to source-provisioner PRD and design pa…
osterman Dec 19, 2025
db3605d
docs: add blog post announcing retry support for vendoring
osterman Dec 19, 2025
68ad1e3
fix: make TestUnmarshalYAMLFromFile test network-independent
osterman Dec 23, 2025
3ea1dc1
feat: make source provisioner component-agnostic for terraform, helmf…
osterman Dec 23, 2025
5277b62
fix: address CodeRabbit review comments for downloader package
osterman Dec 23, 2025
49f11fd
docs: update roadmap to mark source provisioner as shipped
osterman Dec 27, 2025
44883bd
Merge branch 'main' into osterman/source-provisioner
osterman Dec 28, 2025
31a4b2a
fix: mock GitHub rate limit and HTTP client in TestUnmarshalYAMLFromFile
osterman Dec 28, 2025
a68c236
docs: add missing period in planfiles documentation
osterman Dec 28, 2025
f81fb88
Merge branch 'main' into osterman/source-provisioner
aknysh Dec 28, 2025
3aae191
fix PRD and blog post, add tests
aknysh Dec 28, 2025
bdd575a
address comments, fix PRD and blog post, add tests
aknysh Dec 28, 2025
2bad1a2
address comments, fix PRD and blog post, add tests
aknysh Dec 28, 2025
164ad5d
address comments, add tests
aknysh Dec 29, 2025
f778d1c
address comments, add tests, update docs
aknysh Dec 29, 2025
050d2d9
update Atmos JSON schemas, remove mentions of deprecated `metadata.so…
aknysh Dec 29, 2025
78b2e93
update blog post on how to use `source` and `provision.workdir` toget…
aknysh Dec 29, 2025
2868186
add integration tests for both `source` and `provision.workdir`
aknysh Dec 29, 2025
2b8d98b
Merge branch 'main' into osterman/source-provisioner
aknysh Dec 29, 2025
0d5321c
fix docs, update tests
aknysh Dec 29, 2025
fc5e555
update docs
aknysh Dec 29, 2025
9e07972
fix: address CodeRabbit review comments for source provisioner
aknysh Dec 29, 2025
cd04c37
address comments, update docs and tests
aknysh Dec 29, 2025
e6e6ecf
address comments
aknysh Dec 29, 2025
dc804bb
address comments
aknysh Dec 29, 2025
7eac6b3
feat(source): Add automatic JIT source provisioning
aknysh Dec 30, 2025
058a30d
docs: Update documentation for automatic JIT source provisioning
aknysh Dec 30, 2025
30fb4e3
feat: Add JIT source provisioning for helmfile and packer
aknysh Dec 30, 2025
aa63ee2
fix: Use workdir path in construct*ComponentWorkingDir functions
aknysh Dec 30, 2025
de5a9d0
fix: Handle empty source specs gracefully in source provisioner
aknysh Dec 30, 2025
3db30ea
style: Align error message formatting with terraform.go
aknysh Dec 30, 2025
fbba679
fix: Pass component type to AutoProvisionSource for correct path reso…
aknysh Dec 30, 2025
7f9c5f8
fix: Make source pull respect workdir setting for consistency
aknysh Dec 30, 2025
0226658
feat: Extend source configuration support to helmfile and packer comp…
aknysh Dec 30, 2025
fddb0ea
feat: Extend provision section support to helmfile and packer components
aknysh Dec 30, 2025
9f0bb5d
docs: Update blog post to include helmfile and packer source support
aknysh Dec 30, 2025
537d18d
address comments, add tests
aknysh Dec 30, 2025
4ce8844
fix: Use filepath.FromSlash for cross-platform test compatibility
aknysh Dec 30, 2025
ad8531d
test: Add clarifying comment about ErrorBuilder enrichments
aknysh Dec 30, 2025
19ea313
fix: Cross-platform test compatibility for path handling
aknysh Dec 30, 2025
eb54196
fix: Normalize workdir paths for cross-platform compatibility
aknysh Dec 30, 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
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ linters:
- "!**/internal/aws_utils/**"
- "!**/pkg/aws/identity/**"
- "!**/pkg/provisioner/backend/**"
- "!**/pkg/github/**"
- "$test"
deny:
# AWS: Identity and auth-related SDKs
Expand Down
6 changes: 6 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ Maintain aliases: `cfg`, `log`, `u`, `errUtils`
### Performance Tracking (MANDATORY)
Add `defer perf.Track(atmosConfig, "pkg.FuncName")()` + blank line to all public functions. Use `nil` if no atmosConfig param.

**Exceptions (do NOT add perf.Track):**
- Trivial getters/setters (e.g., `GetName()`, `SetValue()`)
- Command constructor functions (e.g., `DescribeCommand()`, `ListCommand()`)
- Simple factory functions that just return structs
- Functions that only delegate to another tracked function

### Configuration Loading
Precedence: CLI flags → ENV vars → config files → defaults (use Viper)

Expand Down
4 changes: 4 additions & 0 deletions cmd/helmfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"github.com/spf13/cobra"

helmfilesource "github.com/cloudposse/atmos/cmd/helmfile/source"
e "github.com/cloudposse/atmos/internal/exec"
)

Expand All @@ -22,6 +23,9 @@ func init() {
helmfileCmd.PersistentFlags().Bool("", false, doubleDashHint)
AddStackCompletion(helmfileCmd)
RootCmd.AddCommand(helmfileCmd)

// Add source subcommand from the source subpackage.
helmfileCmd.AddCommand(helmfilesource.GetSourceCommand())
}

func helmfileRun(cmd *cobra.Command, commandName string, args []string) error {
Expand Down
45 changes: 45 additions & 0 deletions cmd/helmfile/source/source.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Package source provides CLI commands for managing helmfile component sources.
// This includes JIT (just-in-time) vendoring from source configuration.
package source

import (
"github.com/spf13/cobra"

sourcecmd "github.com/cloudposse/atmos/pkg/provisioner/source/cmd"
)

// helmfileConfig holds the component-type-specific configuration for helmfile.
var helmfileConfig = &sourcecmd.Config{
ComponentType: "helmfile",
TypeLabel: "Helmfile",
}

// sourceCmd represents the source command.
var sourceCmd = &cobra.Command{
Use: "source",
Short: "Manage Helmfile component sources (JIT vendoring)",
Long: `Manage Helmfile component sources defined in stack configuration.

The source provisioner enables just-in-time (JIT) vendoring of component sources
directly from stack configuration. Components can declare their source location
inline using the source field without requiring a separate component.yaml file.

Commands:
pull Vendor component source (use --force to re-vendor)
list List components with source in a stack
describe Show source configuration for a component
delete Remove vendored source directory`,
}

func init() {
// Add subcommands from shared package.
sourceCmd.AddCommand(sourcecmd.PullCommand(helmfileConfig))
sourceCmd.AddCommand(sourcecmd.ListCommand(helmfileConfig))
sourceCmd.AddCommand(sourcecmd.DescribeCommand(helmfileConfig))
sourceCmd.AddCommand(sourcecmd.DeleteCommand(helmfileConfig))
}

// GetSourceCommand returns the source command for parent registration.
func GetSourceCommand() *cobra.Command {
return sourceCmd
}
4 changes: 4 additions & 0 deletions cmd/packer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cmd
import (
"github.com/spf13/cobra"

packersource "github.com/cloudposse/atmos/cmd/packer/source"
e "github.com/cloudposse/atmos/internal/exec"
u "github.com/cloudposse/atmos/pkg/utils"
)
Expand All @@ -25,6 +26,9 @@ func init() {

AddStackCompletion(packerCmd)
RootCmd.AddCommand(packerCmd)

// Add source subcommand from the source subpackage.
packerCmd.AddCommand(packersource.GetSourceCommand())
}

func packerRun(cmd *cobra.Command, commandName string, args []string) error {
Expand Down
45 changes: 45 additions & 0 deletions cmd/packer/source/source.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Package source provides CLI commands for managing packer component sources.
// This includes JIT (just-in-time) vendoring from source configuration.
package source

import (
"github.com/spf13/cobra"

sourcecmd "github.com/cloudposse/atmos/pkg/provisioner/source/cmd"
)

// packerConfig holds the component-type-specific configuration for packer.
var packerConfig = &sourcecmd.Config{
ComponentType: "packer",
TypeLabel: "Packer",
}

// sourceCmd represents the source command.
var sourceCmd = &cobra.Command{
Use: "source",
Short: "Manage Packer component sources (JIT vendoring)",
Long: `Manage Packer component sources defined in stack configuration.

The source provisioner enables just-in-time (JIT) vendoring of component sources
directly from stack configuration. Components can declare their source location
inline using the source field without requiring a separate component.yaml file.

Commands:
pull Vendor component source (use --force to re-vendor)
list List components with source in a stack
describe Show source configuration for a component
delete Remove vendored source directory`,
}

func init() {
// Add subcommands from shared package.
sourceCmd.AddCommand(sourcecmd.PullCommand(packerConfig))
sourceCmd.AddCommand(sourcecmd.ListCommand(packerConfig))
sourceCmd.AddCommand(sourcecmd.DescribeCommand(packerConfig))
sourceCmd.AddCommand(sourcecmd.DeleteCommand(packerConfig))
}

// GetSourceCommand returns the source command for parent registration.
func GetSourceCommand() *cobra.Command {
return sourceCmd
}
45 changes: 45 additions & 0 deletions cmd/terraform/source/source.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Package source provides CLI commands for managing terraform component sources.
// This includes JIT (just-in-time) vendoring from source configuration.
package source

import (
"github.com/spf13/cobra"

sourcecmd "github.com/cloudposse/atmos/pkg/provisioner/source/cmd"
)

// terraformConfig holds the component-type-specific configuration for terraform.
var terraformConfig = &sourcecmd.Config{
ComponentType: "terraform",
TypeLabel: "Terraform",
}

// sourceCmd represents the source command.
var sourceCmd = &cobra.Command{
Use: "source",
Short: "Manage Terraform component sources (JIT vendoring)",
Long: `Manage Terraform component sources defined in stack configuration.

The source provisioner enables just-in-time (JIT) vendoring of component sources
directly from stack configuration. Components can declare their source location
inline using the source field without requiring a separate component.yaml file.

Commands:
pull Vendor component source (use --force to re-vendor)
list List components with source in a stack
describe Show source configuration for a component
delete Remove vendored source directory`,
}

func init() {
// Add subcommands from shared package.
sourceCmd.AddCommand(sourcecmd.PullCommand(terraformConfig))
sourceCmd.AddCommand(sourcecmd.ListCommand(terraformConfig))
sourceCmd.AddCommand(sourcecmd.DescribeCommand(terraformConfig))
sourceCmd.AddCommand(sourcecmd.DeleteCommand(terraformConfig))
}

// GetSourceCommand returns the source command for parent registration.
func GetSourceCommand() *cobra.Command {
return sourceCmd
}
4 changes: 4 additions & 0 deletions cmd/terraform/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/cloudposse/atmos/cmd/internal"
"github.com/cloudposse/atmos/cmd/terraform/backend"
"github.com/cloudposse/atmos/cmd/terraform/generate"
"github.com/cloudposse/atmos/cmd/terraform/source"
"github.com/cloudposse/atmos/cmd/terraform/workdir"
errUtils "github.com/cloudposse/atmos/errors"
e "github.com/cloudposse/atmos/internal/exec"
Expand Down Expand Up @@ -64,6 +65,9 @@ func init() {
// Add backend subcommand from the backend subpackage.
terraformCmd.AddCommand(backend.GetBackendCommand())

// Add source subcommand from the source subpackage.
terraformCmd.AddCommand(source.GetSourceCommand())

// Add workdir subcommand from the workdir subpackage.
terraformCmd.AddCommand(workdir.GetWorkdirCommand())

Expand Down
2 changes: 1 addition & 1 deletion docs/prd/component-workdir.md
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ terraform:
| `ErrSourceDownload` | Failed to download component source |
| `ErrSourceCacheRead` | Failed to read source cache |
| `ErrSourceCacheWrite` | Failed to write source cache |
| `ErrInvalidSource` | Invalid metadata.source configuration |
| `ErrInvalidSource` | Invalid source configuration |

---

Expand Down
Loading
Loading