Skip to content
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

feat: Move app resources commands to dedicated command file #9306

Merged

Conversation

pasha-codefresh
Copy link
Member

@pasha-codefresh pasha-codefresh commented May 5, 2022

Move commands to dedicated file, also few functions to utils

NewApplicationPatchResourceCommand
NewApplicationDeleteResourceCommand
NewApplicationListResourceCommand

Signed-off-by: pashavictorovich <pavel@codefresh.io>
…e_cli_distinguish

� Conflicts:
�	cmd/argocd/commands/app_test.go
Signed-off-by: pashavictorovich <pavel@codefresh.io>
@codecov
Copy link

codecov bot commented May 5, 2022

Codecov Report

Merging #9306 (865709b) into master (194f090) will increase coverage by 0.02%.
The diff coverage is 21.19%.

@@            Coverage Diff             @@
##           master    #9306      +/-   ##
==========================================
+ Coverage   46.06%   46.08%   +0.02%     
==========================================
  Files         217      218       +1     
  Lines       25908    25917       +9     
==========================================
+ Hits        11934    11945      +11     
+ Misses      12317    12316       -1     
+ Partials     1657     1656       -1     
Impacted Files Coverage Δ
cmd/argocd/commands/app.go 18.54% <0.00%> (+0.55%) ⬆️
cmd/argocd/commands/app_actions.go 0.00% <0.00%> (ø)
cmd/argocd/commands/app_resources.go 8.54% <8.54%> (ø)
cmd/util/app.go 52.38% <78.57%> (+1.97%) ⬆️
applicationset/services/scm_provider/github.go 75.29% <0.00%> (-5.89%) ⬇️
server/server.go 54.12% <0.00%> (-0.11%) ⬇️
util/settings/settings.go 48.16% <0.00%> (+0.05%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 194f090...865709b. Read the comment docs.

@pasha-codefresh pasha-codefresh changed the title Feat: App resource cli to dedicated file feat: Move app resources commands to dedicated command file May 5, 2022
Copy link
Collaborator

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

I know it's just a cleanup PR, but I'd love to see unit tests on the util functions. 😄

If there's no time for that, LGTM besides one nit.

cmd/util/app.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

Great refactoring PR! Tks for this.
I think the main purpose of this refactoring is to enable proper unit testing the command. It would be great to have at least the main test cases implemented as part of this PR.

Signed-off-by: pashavictorovich <pavel@codefresh.io>
@pasha-codefresh
Copy link
Member Author

@leoluz @crenshaw-dev
I have added additional test cases for FilterResources and also added test for print table of resources

Signed-off-by: pashavictorovich <pavel@codefresh.io>
Copy link
Collaborator

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

lgtm, thanks Pasha!

@crenshaw-dev crenshaw-dev merged commit b7b000a into argoproj:master May 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants