-
-
Notifications
You must be signed in to change notification settings - Fork 132
add pager to describe workflow #1266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
samtholiya
merged 142 commits into
main
from
feature/dev-3251-add-pager-to-atmos-describe-workflow-command
Jun 13, 2025
Merged
Changes from 138 commits
Commits
Show all changes
142 commits
Select commit
Hold shift + click to select a range
3abddd4
add pager to describe config command
samtholiya 2c3c2a2
add model test
samtholiya 180bc51
[autofix.ci] apply automated fixes
autofix-ci[bot] 0d70b34
Merge branch 'main' into feature/dev-3131-add-pager-to-atmos-describe…
samtholiya 6cdf3a3
update structure
samtholiya 223fe38
Merge branch 'feature/dev-3131-add-pager-to-atmos-describe-config-com…
samtholiya 0e28d7d
update with unit test cases
samtholiya 2b5d34d
[autofix.ci] apply automated fixes
autofix-ci[bot] 1981bbe
remove unwanted interface
samtholiya c035f9f
Merge branch 'feature/dev-3131-add-pager-to-atmos-describe-config-com…
samtholiya 474d45e
fix tests
samtholiya 7de12fb
updated describe config
samtholiya 44cbfa9
implement status with help
samtholiya 7b9c10e
[autofix.ci] apply automated fixes
autofix-ci[bot] 9b03310
error view added
samtholiya 57c7cac
Merge branch 'feature/dev-3131-add-pager-to-atmos-describe-config-com…
samtholiya 67a37cf
Update pkg/pager/model.go
samtholiya 00f5920
Merge branch 'main' into feature/dev-3131-add-pager-to-atmos-describe…
samtholiya 9639a6e
fix tests
samtholiya 5c4c67c
Merge branch 'feature/dev-3131-add-pager-to-atmos-describe-config-com…
samtholiya 94c247b
fix lint
samtholiya f7be563
fix golangci-lint
samtholiya af69dc6
updated pager variable
samtholiya b101302
fix tests
samtholiya a2ab7b3
fixed test cases
samtholiya 4b01ade
Merge branch 'main' into feature/dev-3131-add-pager-to-atmos-describe…
samtholiya d20c96a
update the pager variable logic
samtholiya 8a84f67
updated the pager logic
samtholiya dcccd4a
updated test case
samtholiya 5ef05c5
fix pager bool
samtholiya b7e52cb
add pager for describe component
samtholiya efafca9
fix test case
samtholiya 51b9a2d
fix test cases
samtholiya 8990001
Update the docs
samtholiya 2494cd1
add pager to describe config command
samtholiya 0bd38c8
add model test
samtholiya eb55512
[autofix.ci] apply automated fixes
autofix-ci[bot] 746b105
update structure
samtholiya bfa2e74
update with unit test cases
samtholiya b23ac9d
remove unwanted interface
samtholiya 03fa985
[autofix.ci] apply automated fixes
autofix-ci[bot] a20d636
fix tests
samtholiya 51bd717
updated describe config
samtholiya bb88f35
implement status with help
samtholiya b6752b9
error view added
samtholiya 5119033
[autofix.ci] apply automated fixes
autofix-ci[bot] bc455d3
fix tests
samtholiya 7ccc618
Update pkg/pager/model.go
samtholiya 1fcf428
fix lint
samtholiya aa35f38
fix golangci-lint
samtholiya fda30bb
updated pager variable
samtholiya dfc53e7
fix tests
samtholiya dd1e6da
fixed test cases
samtholiya 6b38f6b
update the pager variable logic
samtholiya 151e8da
updated the pager logic
samtholiya 29ff77a
updated test case
samtholiya e39721f
fix pager bool
samtholiya 3fa3c1d
unit test case for isPagerEnabled
samtholiya da01289
Merge branch 'feature/dev-3131-add-pager-to-atmos-describe-config-com…
samtholiya 1649fa7
fix error name
samtholiya c1de851
Merge branch 'main' into feature/dev-3131-add-pager-to-atmos-describe…
samtholiya f467d7e
fix tests
samtholiya 0155079
checking error in runner
samtholiya 6ccb69c
fix struct
samtholiya 967c830
fix tests
samtholiya 62cb279
add tests
samtholiya 3780c8a
added tests
samtholiya 48c5c45
added test for cmd
samtholiya 0758f21
added tests for print as json
samtholiya 97b3b0a
revert changes to limit the pr contents
samtholiya 9233db8
shift common code
samtholiya 988dabf
fix command
samtholiya 99c38f1
fix test coverage scope
samtholiya 91b348a
Merge branch 'main' into feature/dev-3131-add-pager-to-atmos-describe…
samtholiya 2248e87
Merge branch 'feature/dev-3131-add-pager-to-atmos-describe-config-com…
samtholiya e401eef
add more test cases
samtholiya aecd470
[autofix.ci] apply automated fixes
autofix-ci[bot] c0598f2
add more test cases
samtholiya f4ec621
Merge branch 'main' into feature/dev-3131-add-pager-to-atmos-describe…
osterman 8e46da4
Merge branch 'feature/dev-3131-add-pager-to-atmos-describe-config-com…
samtholiya 66162fa
describe affected with pager
samtholiya 8d24f5b
[autofix.ci] apply automated fixes
autofix-ci[bot] 9bd46bb
fix complexity
samtholiya 7985cac
Merge branch 'feature/dev-3182-add-pager-to-atmos-describe-affected-c…
samtholiya a116546
Merge remote-tracking branch 'origin/main' into feature/dev-3182-add-…
Benbentwo 70c7fa1
updated scroll function
samtholiya af53eff
Merge branch 'feature/dev-3182-add-pager-to-atmos-describe-affected-c…
samtholiya 2bd026a
just checking
samtholiya 2891ec9
push highlighted utils golint fix
samtholiya d86ddfd
make it more unit testable
samtholiya d705761
Merge branch 'main' into feature/dev-3182-add-pager-to-atmos-describe…
samtholiya 1a93a97
[autofix.ci] apply automated fixes
autofix-ci[bot] 2d4337a
fix lint
samtholiya b90befd
Merge branch 'feature/dev-3182-add-pager-to-atmos-describe-affected-c…
samtholiya 0baebcc
[autofix.ci] apply automated fixes
autofix-ci[bot] 755c15c
Merge branch 'main' into feature/dev-3182-add-pager-to-atmos-describe…
samtholiya 6d6f957
fix golint
samtholiya 1040770
Merge branch 'feature/dev-3182-add-pager-to-atmos-describe-affected-c…
samtholiya ee7a7a8
[autofix.ci] apply automated fixes
autofix-ci[bot] 72e4ffb
fix build issue
samtholiya 95fd01b
remove unwanted function
samtholiya 96b44b9
fix code rabbit
samtholiya 2581c56
fix code rabbit
samtholiya 5d0a802
fix flag
samtholiya 7f24ea8
fix default format
samtholiya e35cd98
add test cases
samtholiya e5ba0f4
[autofix.ci] apply automated fixes
autofix-ci[bot] 215f607
fix test
samtholiya 0a35636
Merge branch 'main' into feature/dev-3162-add-pager-to-atmos-describe…
samtholiya 3567c20
Merge branch 'main' into feature/dev-3162-add-pager-to-atmos-describe…
samtholiya c4d20d7
Merge branch 'feature/dev-3162-add-pager-to-atmos-describe-component-…
samtholiya c6d6873
Merge branch 'main' into feature/dev-3182-add-pager-to-atmos-describe…
samtholiya bef67e4
fix lint
samtholiya a0deb55
Merge branch 'feature/dev-3182-add-pager-to-atmos-describe-affected-c…
samtholiya 083ecd6
fix
samtholiya eeb792e
test updated
samtholiya 03dab23
fix test case
samtholiya 4b7d587
add more test coverage
samtholiya 1a812ef
init changes describe stacks for pager
samtholiya 35d747d
fix comments
samtholiya cf82fcb
describe stacks with scroll
samtholiya 18e8ca2
add test case
samtholiya fddcc7a
Merge branch 'main' into feature/dev-3182-add-pager-to-atmos-describe…
samtholiya 22e6c3c
Merge branch 'feature/dev-3182-add-pager-to-atmos-describe-affected-c…
samtholiya ed22a1c
[autofix.ci] apply automated fixes
autofix-ci[bot] b7ae279
[autofix.ci] apply automated fixes
autofix-ci[bot] 6ae85b8
Merge branch 'feature/dev-3221-add-pager-to-atmos-describe-stack-comm…
samtholiya 71f4f1b
add tests
samtholiya 4dd8fa6
add pager to describe workflow
samtholiya 951164e
add tests
samtholiya 3ae314c
add tests
samtholiya c41f5db
Merge branch 'main' of https://github.com/cloudposse/atmos into featu…
samtholiya fc3ca77
fix lint
samtholiya 3b0d241
[autofix.ci] apply automated fixes
autofix-ci[bot] ed6da98
fix coderabbit
samtholiya cd3236e
Merge branch 'feature/dev-3251-add-pager-to-atmos-describe-workflow-c…
samtholiya e9eb6b0
fix pager flag
samtholiya 7cf9f20
Update cmd/describe_affected.go
samtholiya 1788041
fix test
samtholiya b1e801c
[autofix.ci] apply automated fixes
autofix-ci[bot] 823c024
Merge branch 'main' into feature/dev-3251-add-pager-to-atmos-describe…
Benbentwo d09365f
Merge branch 'main' into feature/dev-3251-add-pager-to-atmos-describe…
samtholiya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
package cmd | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/cloudposse/atmos/internal/exec" | ||
"github.com/cloudposse/atmos/pkg/schema" | ||
"github.com/golang/mock/gomock" | ||
"github.com/spf13/cobra" | ||
"github.com/spf13/pflag" | ||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestSetFlagInDescribeWorkflow(t *testing.T) { | ||
// Initialize test cases | ||
tests := []struct { | ||
name string | ||
setFlags func(*pflag.FlagSet) | ||
expected *exec.DescribeWorkflowsArgs | ||
expectedErr bool | ||
}{ | ||
{ | ||
name: "Set string flags", | ||
setFlags: func(fs *pflag.FlagSet) { | ||
fs.Set("format", "json") | ||
fs.Set("output", "map") | ||
}, | ||
expected: &exec.DescribeWorkflowsArgs{ | ||
Format: "json", | ||
OutputType: "map", | ||
}, | ||
}, | ||
{ | ||
name: "No flags changed, set default format", | ||
setFlags: func(fs *pflag.FlagSet) { | ||
// No flags set | ||
}, | ||
expected: &exec.DescribeWorkflowsArgs{ | ||
Format: "yaml", | ||
OutputType: "list", | ||
}, | ||
}, | ||
{ | ||
name: "Set invalid format, no override", | ||
setFlags: func(fs *pflag.FlagSet) { | ||
fs.Set("format", "invalid_format") | ||
}, | ||
expectedErr: true, | ||
}, | ||
{ | ||
name: "Set invalid output type, no override", | ||
setFlags: func(fs *pflag.FlagSet) { | ||
fs.Set("output", "invalid_output") | ||
}, | ||
expectedErr: true, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
fs := pflag.NewFlagSet("test", pflag.ContinueOnError) | ||
fs.StringP("format", "f", "yaml", "Specify the output format (`yaml` is default)") | ||
fs.StringP("output", "o", "list", "Specify the output type (`list` is default)") | ||
fs.StringP("query", "q", "", "Specify a query to filter the output") | ||
tt.setFlags(fs) | ||
describeWorkflowsArgs := &exec.DescribeWorkflowsArgs{} | ||
err := flagsToDescribeWorkflowsArgs(fs, describeWorkflowsArgs) | ||
if tt.expectedErr { | ||
assert.Error(t, err) | ||
return | ||
} | ||
assert.NoError(t, err) | ||
assert.Equal(t, tt.expected, describeWorkflowsArgs) | ||
}) | ||
} | ||
} | ||
|
||
func TestDescribeWorklows(t *testing.T) { | ||
ctrl := gomock.NewController(t) | ||
describeWorkflowsMock := exec.NewMockDescribeWorkflowsExec(ctrl) | ||
describeWorkflowsMock.EXPECT().Execute(gomock.Any(), gomock.Any()).Return(nil).Times(1) | ||
run := getRunnableDescribeWorkflowsCmd( | ||
func(opts ...AtmosValidateOption) {}, | ||
func(componentType string, cmd *cobra.Command, args, additionalArgsAndFlags []string) (schema.ConfigAndStacksInfo, error) { | ||
return schema.ConfigAndStacksInfo{}, nil | ||
}, | ||
func(info schema.ConfigAndStacksInfo, validate bool) (schema.AtmosConfiguration, error) { | ||
return schema.AtmosConfiguration{}, nil | ||
}, | ||
describeWorkflowsMock, | ||
) | ||
run(describeWorkflowsCmd, []string{}) | ||
ctrl.Finish() | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.