Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
213 commits
Select commit Hold shift + click to select a range
bba4888
adding drift detection support
milldr May 15, 2025
a9deaa6
adding drift detection support
milldr May 15, 2025
30dac22
adding drift detection support
milldr May 15, 2025
d28dd5d
adding drift detection support
milldr May 15, 2025
702d236
adding drift detection support
milldr May 15, 2025
20785f9
adding drift detection support
milldr May 15, 2025
150c1ce
adding drift detection support
milldr May 15, 2025
ebea868
adding drift detection support
milldr May 15, 2025
1f1a22f
cleaning up tests
milldr May 15, 2025
eeba626
cleaning up tests
milldr May 15, 2025
b3d8a81
cleaning up tests
milldr May 15, 2025
e30b7eb
Merge branch 'main' into feat/atmos-list-upload
milldr May 15, 2025
48de779
[autofix.ci] apply automated fixes
autofix-ci[bot] May 15, 2025
0d66402
use cb logger
milldr May 16, 2025
e5553a3
more tests
milldr May 16, 2025
6002909
more tests
milldr May 16, 2025
f6b335b
Merge branch 'feat/atmos-list-upload' of github.com:cloudposse/atmos …
milldr May 16, 2025
c90dde6
more tests
milldr May 16, 2025
3a284b4
more tests
milldr May 16, 2025
d2408a9
clean up tests
milldr May 16, 2025
204f56b
Merge branch 'main' into feat/atmos-list-upload
milldr May 16, 2025
17d9d28
Merge branch 'main' into feat/atmos-list-upload
milldr May 22, 2025
7d51fdd
updated table design
milldr May 22, 2025
02157f5
dont process templates or functions with list deployments
milldr May 22, 2025
e5a9d33
Merge branch 'main' into feat/atmos-list-upload
milldr May 22, 2025
ab22c6a
tests for windows
milldr May 22, 2025
1339290
snapshots
milldr May 22, 2025
ef81dbf
reset unintended changes
milldr May 22, 2025
0071ac6
reset unintended changes
milldr May 22, 2025
9e2436d
use internal package not pkg
milldr May 22, 2025
35fb2ae
more tests
milldr May 22, 2025
71e3b08
fix tests
milldr May 22, 2025
5f01771
Merge branch 'main' into feat/atmos-list-upload
milldr May 27, 2025
ec24435
more tests
milldr May 27, 2025
8dd4865
[autofix.ci] apply automated fixes
autofix-ci[bot] May 27, 2025
bbf9c5e
building atmos plan upload
milldr May 28, 2025
e49969f
Creating plan upload
milldr May 29, 2025
074a495
fixed logic for plan args
milldr May 29, 2025
2817a53
adding tests
milldr May 29, 2025
04fd74d
more tests
milldr May 29, 2025
dc3ca64
test coverage
milldr May 30, 2025
bea9e90
Merge branch 'main' into feat/atmos-plan-upload
milldr May 30, 2025
6271662
[autofix.ci] apply automated fixes
autofix-ci[bot] May 30, 2025
f34ee99
fixed git lib
milldr May 30, 2025
a1cfa5d
fixing logging
milldr May 30, 2025
e6ba64f
Merge branch 'feat/atmos-plan-upload' of github.com:cloudposse/atmos …
milldr May 30, 2025
fc330a3
cleaning up usage
milldr May 30, 2025
be60360
PR review
milldr May 30, 2025
45edf64
PR review
milldr May 30, 2025
b36b1ff
use pointers
milldr May 30, 2025
80cc607
Merge branch 'main' into feat/atmos-list-upload
milldr May 30, 2025
9a8cecb
tlc and merge
milldr May 30, 2025
02b76eb
updated testing
milldr May 30, 2025
501aea8
fix sort
milldr May 30, 2025
12afe45
clean up logger
milldr May 30, 2025
05c5e3c
Adding tests
milldr May 30, 2025
ffcd2c3
feedback
milldr May 30, 2025
dfa38c5
fixed TestProcessStackComponents test
milldr May 30, 2025
2fa20f3
sort logic and new snapshots
milldr May 30, 2025
a40ab9f
more tests
milldr May 31, 2025
febcfae
more tests
milldr May 31, 2025
4f54434
remove unnecessary logger
milldr Jun 2, 2025
542addb
Merge branch 'main' into feat/atmos-list-upload
milldr Jun 3, 2025
ae82ff4
Merge branch 'main' into feat/atmos-list-upload
milldr Jun 4, 2025
c6d0251
Merge branch 'main' into feat/atmos-list-upload
milldr Jun 6, 2025
21868e0
merging main
milldr Jun 9, 2025
93a9730
merging main
milldr Jun 9, 2025
6254a4d
Merge branch 'feat/atmos-list-upload' of github.com:cloudposse/atmos …
milldr Jun 9, 2025
c0bf064
clean up comments
milldr Jun 9, 2025
ba438a4
merged
milldr Jun 10, 2025
a6984ad
merged
milldr Jun 10, 2025
444a29a
merged
milldr Jun 10, 2025
81058ae
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 10, 2025
fe78f86
clean up review
milldr Jun 10, 2025
244bf7d
Merge branch 'feat/atmos-list-upload' of github.com:cloudposse/atmos …
milldr Jun 10, 2025
845d50f
merged
milldr Jun 10, 2025
aa5590f
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 10, 2025
99b55d1
clean up review
milldr Jun 10, 2025
200c28c
Merge branch 'feat/atmos-list-upload' of github.com:cloudposse/atmos …
milldr Jun 10, 2025
9e22f31
Fixed build
milldr Jun 10, 2025
6fde5ee
fixing tests
milldr Jun 10, 2025
0f44522
more tests
milldr Jun 10, 2025
ba5c133
fixed tests
milldr Jun 10, 2025
4327651
fixed tests
milldr Jun 10, 2025
32fb0e2
fixed tests
milldr Jun 10, 2025
f6903f0
Update pkg/list/list_deployments.go
milldr Jun 10, 2025
e19688a
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 10, 2025
0baacfe
fixed tests
milldr Jun 10, 2025
d9f23fd
prompt suggestions
milldr Jun 10, 2025
a6ab979
prompt suggestions
milldr Jun 10, 2025
0275792
prompt suggestions
milldr Jun 10, 2025
a15dcfa
Merge branch 'main' into feat/atmos-list-upload
milldr Jun 12, 2025
e3dadc9
rename stacks to deployments
mcalhoun Jun 13, 2025
66e714a
remove logger
mcalhoun Jun 13, 2025
b8b34ce
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 13, 2025
ef18399
Merge branch 'main' into feat/atmos-list-upload
Jun 13, 2025
f23d04a
Merge branch 'main' into feat/atmos-list-upload
goruha Jun 13, 2025
6768203
update to deployments
mcalhoun Jun 18, 2025
25cc00a
force rc bulid
mcalhoun Jun 18, 2025
00612aa
rename drift status to deployment status
mcalhoun Jun 18, 2025
6676670
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 18, 2025
59c8a1a
update lint errors
mcalhoun Jun 18, 2025
dd9ac22
fix test errors
mcalhoun Jun 18, 2025
7ee4504
Merge branch 'main' into feat/atmos-list-upload
goruha Jun 24, 2025
100b415
Update feature-release.yml
goruha Jun 24, 2025
c238765
Update feature-release.yml
goruha Jun 24, 2025
62880ea
Update feature-release.yml
goruha Jun 24, 2025
8cfd3cf
Update feature-release.yml
goruha Jun 24, 2025
61326e0
Update feature-release.yml
goruha Jun 24, 2025
e7127bb
Merge branch 'main' into feat/atmos-list-upload
goruha Jun 25, 2025
1bf0718
Support draft release
goruha Jun 25, 2025
58b7710
Update feature-release.yml
goruha Jun 25, 2025
38913b8
Merge branch 'main' into feat/atmos-list-upload
goruha Jun 25, 2025
1969b57
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 25, 2025
6466043
Update describe_affected.go
goruha Jun 25, 2025
0fedbf2
Update describe_affected.go
goruha Jun 25, 2025
84e3eb8
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 25, 2025
a918577
Update test.yml
goruha Jun 25, 2025
0dea003
Update test.yml
goruha Jun 25, 2025
f60c502
Update test.yml
goruha Jun 25, 2025
5e3538e
Update test.yml
goruha Jun 25, 2025
f5bd948
Update describe_affected.go
goruha Jun 25, 2025
6ec3e86
[autofix.ci] apply automated fixes
autofix-ci[bot] Jun 25, 2025
8f4e248
Update test.yml
goruha Jun 25, 2025
3653411
Merge branch 'main' into feat/atmos-list-upload
goruha Jul 28, 2025
1553b44
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 28, 2025
0c2ed44
Fix conflicts
goruha Jul 28, 2025
3c90739
fix json struct
mcalhoun Jul 28, 2025
3e91f89
merging main
milldr Aug 4, 2025
7968783
merged main and resolved errors
milldr Aug 4, 2025
f453353
regenerate snapshot TestCLICommands/atmos_list_deployments
milldr Aug 4, 2025
dde8cae
regenerate snapshot TestCLICommands/atmos_list_deployments
milldr Aug 4, 2025
badfd5a
pro client logging
milldr Aug 6, 2025
c12d554
pro client logging
milldr Aug 6, 2025
a12d9a8
merged main
milldr Aug 6, 2025
25385c3
centralize logging logic for atmos pro client
milldr Aug 7, 2025
e8564c2
centralize logging logic for atmos pro client
milldr Aug 7, 2025
d0311fc
code scan warning
milldr Aug 7, 2025
aca35dd
Merge branch 'main' into feat/atmos-list-upload
milldr Aug 7, 2025
cc39c43
Merge branch 'main' into feat/atmos-list-upload
milldr Aug 8, 2025
2c26884
Merge branch 'main' into feat/atmos-list-upload
milldr Aug 19, 2025
fbe6cdb
fixed build
milldr Aug 19, 2025
4e70553
Render templates for list deployments
milldr Aug 20, 2025
84c42ca
removed duplicate
milldr Aug 20, 2025
53ca3b1
Merge branch 'main' into feat/atmos-list-upload
milldr Sep 2, 2025
5dfa18c
Merge branch 'main' into feat/atmos-list-upload
milldr Sep 5, 2025
91f6169
Merge branch 'main' into feat/atmos-list-upload
milldr Sep 9, 2025
be3df55
Merge branch 'main' into feat/atmos-list-upload
milldr Sep 10, 2025
66165c0
Add git SHA and GitHub run ID to deployment status upload
milldr Sep 10, 2025
2e76813
Merge branch 'feat/atmos-list-upload' of github.com:cloudposse/atmos …
milldr Sep 10, 2025
f01bd0c
handle upload exit code 2
milldr Sep 10, 2025
2b4583a
Fix typo in variable name and update usage throughout code
milldr Sep 10, 2025
8116420
Merge branch 'main' into feat/atmos-list-upload
milldr Sep 10, 2025
c7f7591
adding tests
milldr Sep 10, 2025
ce71c37
adding tests
milldr Sep 10, 2025
9aeef8f
adding tests
milldr Sep 10, 2025
1590e95
pr feedback
milldr Sep 10, 2025
42c90cd
more tests
milldr Sep 10, 2025
eca4937
more tests and ai feedback
milldr Sep 10, 2025
bc77ffb
pr feedback, fix atmos pro run id
milldr Sep 10, 2025
a8ed2d8
pr feedback
milldr Sep 10, 2025
f784a50
pr feedback
milldr Sep 10, 2025
3d669c3
update snapshots
milldr Sep 11, 2025
7ce648f
pr feedback
milldr Sep 11, 2025
064fb81
update snapshots
milldr Sep 11, 2025
04d447b
pr feedback
milldr Sep 11, 2025
ebc0e32
more tests
milldr Sep 11, 2025
aa20599
pr feedback
milldr Sep 11, 2025
fc1746c
coderabbitai review
milldr Sep 11, 2025
abb7eeb
code scan fixes
milldr Sep 11, 2025
54a1dd4
coderabbitai review
milldr Sep 11, 2025
e4907f1
coderabbitai review
milldr Sep 11, 2025
fbe33bb
coderabbitai review
milldr Sep 11, 2025
7ebe03c
coderabbitai review
milldr Sep 11, 2025
c26bfce
coderabbitai review
milldr Sep 11, 2025
3bcbad6
coderabbitai review
milldr Sep 11, 2025
5c7fead
coderabbitai review
milldr Sep 11, 2025
3af0643
coderabbitai review
milldr Sep 11, 2025
9d1f599
coderabbitai review
milldr Sep 11, 2025
7619dd0
coderabbitai review
milldr Sep 11, 2025
95bb343
coderabbitai review
milldr Sep 11, 2025
8b7cdb2
PR feedback
milldr Sep 15, 2025
8575297
PR feedback
milldr Sep 15, 2025
bdf7060
PR feedback
milldr Sep 15, 2025
9efaaa9
Merge branch 'main' into feat/atmos-list-upload
milldr Sep 22, 2025
f051f81
nitpicks
milldr Sep 22, 2025
a0344d0
rename deployments to instances
milldr Sep 22, 2025
44ff17b
reverted --upload-deployment-status
milldr Sep 22, 2025
a590eb6
feedback
milldr Sep 22, 2025
b2d1e1f
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 22, 2025
0129ed9
Merge branch 'main' into feat/atmos-list-upload
milldr Sep 22, 2025
0f8d233
feedback
milldr Sep 22, 2025
748acee
renamed to upload-status
milldr Sep 22, 2025
e40cacc
feedback
milldr Sep 22, 2025
5d950ce
feedback
milldr Sep 22, 2025
9cddc48
feedback
milldr Sep 22, 2025
08d316f
Add sentinel errors for slice operations
milldr Sep 22, 2025
03c7b59
Add test cases and implementation for removing flag and value
milldr Sep 22, 2025
80aa0b3
Add test for converting slice of interfaces to slice of strings
milldr Sep 22, 2025
2dd1c3b
Merge branch 'main' into feat/atmos-list-upload
milldr Sep 22, 2025
ec714e8
Merge branch 'main' into feat/atmos-list-upload
milldr Sep 23, 2025
38da6e2
feedback
milldr Sep 23, 2025
aba0e90
[autofix.ci] apply automated fixes
autofix-ci[bot] Sep 23, 2025
0f40cd6
feedback
milldr Sep 23, 2025
3577375
merge conflicts
milldr Sep 23, 2025
72f3779
Merge branch 'feat/atmos-list-upload' of github.com:cloudposse/atmos …
milldr Sep 23, 2025
3d8012a
feedback
milldr Sep 23, 2025
385b77b
feedback
milldr Sep 23, 2025
f5e6474
Add NewDefaultGitRepo constructor and error wrapping logic
milldr Sep 23, 2025
1a268c1
Merge branch 'main' into feat/atmos-list-upload
aknysh Sep 24, 2025
957f180
renamed errUtils
milldr Sep 24, 2025
8158dcf
Merge branch 'feat/atmos-list-upload' of github.com:cloudposse/atmos …
milldr Sep 24, 2025
da27903
updated TestCLICommands/atmos_describe_config_imports snapshots
milldr Sep 24, 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
12 changes: 0 additions & 12 deletions cmd/cmd_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"time"

Expand Down Expand Up @@ -87,29 +86,18 @@ func processCustomCommands(
executeCustomCommand(atmosConfig, cmd, args, parentCommand, commandConfig)
},
}
// TODO: we need to update this post https://github.com/cloudposse/atmos/pull/959 gets merged
customCommand.PersistentFlags().Bool("", false, doubleDashHint)
// Process and add flags to the command
for _, flag := range commandConfig.Flags {
if flag.Type == "bool" {
defaultVal := false
if flag.Default != "" {
// Accept "true"/"false" as string for bool default
parsed, err := strconv.ParseBool(flag.Default)
if err == nil {
defaultVal = parsed
}
}
if flag.Shorthand != "" {
customCommand.PersistentFlags().BoolP(flag.Name, flag.Shorthand, defaultVal, flag.Usage)
} else {
customCommand.PersistentFlags().Bool(flag.Name, defaultVal, flag.Usage)
}
} else {
defaultVal := ""
if flag.Default != "" {
defaultVal = flag.Default
}
if flag.Shorthand != "" {
customCommand.PersistentFlags().StringP(flag.Name, flag.Shorthand, defaultVal, flag.Usage)
} else {
Expand Down
50 changes: 50 additions & 0 deletions cmd/list_instances.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
package cmd

import (
"github.com/spf13/cobra"

e "github.com/cloudposse/atmos/internal/exec"
"github.com/cloudposse/atmos/pkg/list"
fl "github.com/cloudposse/atmos/pkg/list/flags"
)

// listInstancesCmd lists atmos instances.
var listInstancesCmd = &cobra.Command{
Use: "instances",
Short: "List all Atmos instances",
Long: "This command lists all Atmos instances or is used to upload instances to the pro API.",
FParseErrWhitelist: struct{ UnknownFlags bool }{UnknownFlags: false},
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
// Check Atmos configuration
checkAtmosConfig()
err := ExecuteListInstancesCmd(cmd, args)
if err != nil {
return err
}
return nil
},
}

func init() {
// Add common list flags
fl.AddCommonListFlags(listInstancesCmd)

// Add instance-specific flags
listInstancesCmd.Flags().Bool("upload", false, "Upload instances to pro API")

// Add the command to the list command
listCmd.AddCommand(listInstancesCmd)
}

func ExecuteListInstancesCmd(cmd *cobra.Command, args []string) error {
// Process and validate command line arguments.
configAndStacksInfo, err := e.ProcessCommandLineArgs("list", cmd, args, nil)
if err != nil {
return err
}
configAndStacksInfo.Command = "list"
configAndStacksInfo.SubCommand = "instances"

return list.ExecuteListInstancesCmd(&configAndStacksInfo, cmd, args)
}
5 changes: 3 additions & 2 deletions cmd/terraform_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"fmt"
"os"

"github.com/spf13/cobra"

errUtils "github.com/cloudposse/atmos/errors"
cfg "github.com/cloudposse/atmos/pkg/config"
h "github.com/cloudposse/atmos/pkg/hooks"
"github.com/cloudposse/atmos/pkg/version"
"github.com/spf13/cobra"
)

// getTerraformCommands returns an array of statically defined Terraform commands with flags
Expand Down Expand Up @@ -321,6 +321,7 @@ func attachTerraformCommands(parentCmd *cobra.Command) {

var commandMaps = map[string]func(cmd *cobra.Command){
"plan": func(cmd *cobra.Command) {
cmd.PersistentFlags().Bool(cfg.UploadStatusFlag, false, "If set atmos will upload the plan result to the pro API")
cmd.PersistentFlags().Bool("affected", false, "Plan the affected components in dependency order")
cmd.PersistentFlags().Bool("all", false, "Plan all components in all stacks")
cmd.PersistentFlags().Bool("skip-planfile", false, "Skip writing the plan to a file by not passing the `-out` flag to Terraform when executing the command. Set it to `true` when using Terraform Cloud since the `-out` flag is not supported. Terraform Cloud automatically stores plans in its backend")
Expand Down
68 changes: 58 additions & 10 deletions errors/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,28 @@ var (
ErrReadS3ObjectBody = errors.New("failed to read S3 object body")

// Git-related errors.
ErrGitNotAvailable = errors.New("git must be available and on the PATH")
ErrInvalidGitPort = errors.New("invalid port number")
ErrSSHKeyUsage = errors.New("error using ssh key")
ErrGitCommandExited = errors.New("git command exited with error")
ErrGitCommandFailed = errors.New("error running git command")
ErrReadDestDir = errors.New("failed to read the destination directory during git update")
ErrRemoveGitDir = errors.New("failed to remove the .git directory in the destination directory during git update")
ErrUnexpectedGitOutput = errors.New("unexpected 'git version' output")
ErrGitVersionMismatch = errors.New("git version requirement not met")
ErrGitNotAvailable = errors.New("git must be available and on the PATH")
ErrInvalidGitPort = errors.New("invalid port number")
ErrSSHKeyUsage = errors.New("error using SSH key")
ErrGitCommandExited = errors.New("git command exited with non-zero status")
ErrGitCommandFailed = errors.New("failed to execute git command")
ErrReadDestDir = errors.New("failed to read the destination directory during git update")
ErrRemoveGitDir = errors.New("failed to remove the .git directory in the destination directory during git update")
ErrUnexpectedGitOutput = errors.New("unexpected 'git version' output")
ErrGitVersionMismatch = errors.New("git version requirement not met")
ErrFailedToGetLocalRepo = errors.New("failed to get local repository")
ErrFailedToGetRepoInfo = errors.New("failed to get repository info")
ErrLocalRepoFetch = errors.New("local repo unavailable")
ErrHeadLookup = errors.New("HEAD not found")

// Slice utility errors.
ErrNilInput = errors.New("input must not be nil")
ErrNonStringElement = errors.New("element is not a string")

ErrReadFile = errors.New("error reading file")
ErrInvalidFlag = errors.New("invalid flag")

ErrMissingStack = errors.New("stack is required; specify it on the command line using the flag `--stack <stack>` (shorthand `-s`)\"")
ErrMissingStack = errors.New("stack is required; specify it on the command line using the flag `--stack <stack>` (shorthand `-s`)")
ErrInvalidComponent = errors.New("invalid component")
ErrAbstractComponentCantBeProvisioned = errors.New("abstract component cannot be provisioned")
ErrLockedComponentCantBeProvisioned = errors.New("locked component cannot be provisioned")
Expand All @@ -80,4 +88,44 @@ var (
ErrInvalidListMergeStrategy = errors.New("invalid list merge strategy")
ErrMerge = errors.New("merge error")
ErrInvalidStackManifest = errors.New("invalid stack manifest")

// Pro API client errors.
ErrFailedToCreateRequest = errors.New("failed to create request")
ErrFailedToMarshalPayload = errors.New("failed to marshal request body")
ErrFailedToCreateAuthRequest = errors.New("failed to create authenticated request")
ErrFailedToMakeRequest = errors.New("failed to make request")
ErrFailedToUploadStacks = errors.New("failed to upload stacks")
ErrFailedToReadResponseBody = errors.New("failed to read response body")
ErrFailedToLockStack = errors.New("failed to lock stack")
ErrFailedToUnlockStack = errors.New("failed to unlock stack")
ErrOIDCWorkspaceIDRequired = errors.New("workspace ID environment variable is required for OIDC authentication")
ErrOIDCTokenExchangeFailed = errors.New("failed to exchange OIDC token for Atmos token")
ErrOIDCAuthFailedNoToken = errors.New("OIDC authentication failed: no token")
ErrNotInGitHubActions = errors.New("not running in GitHub Actions or missing OIDC token environment variables")
ErrFailedToGetOIDCToken = errors.New("failed to get OIDC token")
ErrFailedToDecodeOIDCResponse = errors.New("failed to decode OIDC token response")
ErrFailedToExchangeOIDCToken = errors.New("failed to exchange OIDC token")
ErrFailedToDecodeTokenResponse = errors.New("failed to decode token response")
ErrFailedToGetGitHubOIDCToken = errors.New("failed to get GitHub OIDC token")
ErrFailedToUploadInstances = errors.New("failed to upload instances")
ErrFailedToUploadInstanceStatus = errors.New("failed to upload instance status")
ErrFailedToUnmarshalAPIResponse = errors.New("failed to unmarshal API response")
ErrNilRequestDTO = errors.New("nil request DTO")
ErrAPIResponseError = errors.New("API response error")

// Exec package errors.
ErrComponentAndStackRequired = errors.New("both '--component' and '--stack' flags must be provided")
ErrFailedToCreateAPIClient = errors.New("failed to create API client")
ErrFailedToProcessArgs = errors.New("failed to process command-line arguments")
ErrFailedToInitConfig = errors.New("failed to initialize Atmos configuration")
ErrFailedToCreateLogger = errors.New("failed to create logger")
ErrFailedToGetComponentFlag = errors.New("failed to get '--component' flag")
ErrFailedToGetStackFlag = errors.New("failed to get '--stack' flag")
ErrOPAPolicyViolations = errors.New("OPA policy violations detected")

// List package errors.
ErrExecuteDescribeStacks = errors.New("failed to execute describe stacks")
ErrProcessInstances = errors.New("failed to process instances")
ErrParseFlag = errors.New("failed to parse flag value")
ErrFailedToFinalizeCSVOutput = errors.New("failed to finalize CSV output")
)
12 changes: 4 additions & 8 deletions internal/exec/describe_affected.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
errUtils "github.com/cloudposse/atmos/errors"
"github.com/cloudposse/atmos/internal/tui/templates/term"
cfg "github.com/cloudposse/atmos/pkg/config"
l "github.com/cloudposse/atmos/pkg/logger"
"github.com/cloudposse/atmos/pkg/pager"
"github.com/cloudposse/atmos/pkg/pro"
"github.com/cloudposse/atmos/pkg/pro/dtos"
Expand Down Expand Up @@ -311,7 +310,9 @@ func (d *describeAffectedExec) uploadableQuery(args *DescribeAffectedCmdArgs, re
if err != nil {
return err
}
logger, err := l.NewLoggerFromCliConfig(*d.atmosConfig)

log.Debug("Creating API client")
apiClient, err := pro.NewAtmosProAPIClientFromEnv(d.atmosConfig)
if err != nil {
return err
}
Expand All @@ -325,13 +326,8 @@ func (d *describeAffectedExec) uploadableQuery(args *DescribeAffectedCmdArgs, re
RepoHost: gitURL.GetHostName(),
Stacks: affected,
}
log.Debug("Preparing upload affected stacks request", "req", req)

log.Debug("Creating API client")
apiClient, err := pro.NewAtmosProAPIClientFromEnv(logger, d.atmosConfig)
if err != nil {
return err
}
log.Debug("Preparing upload affected stacks request", "req", req)

return apiClient.UploadAffectedStacks(&req)
Comment on lines +330 to 332
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Do not log full request payload; log safe metadata only.

This emits full affected details to logs (may include settings/PII). Log only repo, SHAs, and count.

-	log.Debug("Preparing upload affected stacks request", "req", req)
+	log.Debug("Preparing upload affected stacks request",
+		"repo", fmt.Sprintf("%s/%s", req.RepoOwner, req.RepoName),
+		"host", req.RepoHost,
+		"head_sha", req.HeadSHA,
+		"base_sha", req.BaseSHA,
+		"stacks_count", len(req.Stacks),
+	)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
log.Debug("Preparing upload affected stacks request", "req", req)
return apiClient.UploadAffectedStacks(&req)
log.Debug("Preparing upload affected stacks request",
"repo", fmt.Sprintf("%s/%s", req.RepoOwner, req.RepoName),
"host", req.RepoHost,
"head_sha", req.HeadSHA,
"base_sha", req.BaseSHA,
"stacks_count", len(req.Stacks),
)
return apiClient.UploadAffectedStacks(&req)
🤖 Prompt for AI Agents
In internal/exec/describe_affected.go around lines 330 to 332, the current debug
log prints the entire request payload (including full affected details); change
the log to emit only safe metadata: repository identifier, base SHA, head SHA,
and the count of affected stacks. Extract those fields from req (e.g., req.Repo,
req.BaseSHA, req.HeadSHA, len(req.Affected) or equivalent) and call log.Debug
with a concise message and only those values, removing the full req from the log
to avoid exposing settings/PII.

}
Expand Down
Loading
Loading