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

fix: log plugin commands in a better format #12260

Merged

Conversation

crenshaw-dev
Copy link
Collaborator

Plugin logs are misleading. sh -c echo hello world makes no sense. Log as sh -c "echo hello world" instead.

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Feb 2, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.01 🎉

Comparison is base (ed6e9e9) 47.77% compared to head (adee5be) 47.79%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #12260      +/-   ##
==========================================
+ Coverage   47.77%   47.79%   +0.01%     
==========================================
  Files         246      246              
  Lines       42060    42075      +15     
==========================================
+ Hits        20096    20111      +15     
  Misses      19962    19962              
  Partials     2002     2002              
Impacted Files Coverage Δ
cmpserver/plugin/plugin.go 80.14% <100.00%> (+1.13%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Contributor

@drpaneas drpaneas left a comment

Choose a reason for hiding this comment

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

Overall, improving the readability and usability of logs and terminal output it's quite useful. The added unit test provides confidence that the getCommandArgsToLog function works correctly in various scenarios, so thx for that as well.

+1
/lgtm

@crenshaw-dev
Copy link
Collaborator Author

/cherry-pick release-2.6
/cherry-pick release-2.5
/cherry-pick release-2.4

cmpserver/plugin/plugin.go Outdated Show resolved Hide resolved
cmpserver/plugin/plugin.go Outdated Show resolved Hide resolved
@crenshaw-dev
Copy link
Collaborator Author

/cherry-pick release-2.5

@crenshaw-dev
Copy link
Collaborator Author

/cherry-pick release-2.4

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev
Copy link
Collaborator Author

@jannfis made requested changes, PTAL

Copy link
Member

@jannfis jannfis left a comment

Choose a reason for hiding this comment

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

LGTM!

@crenshaw-dev crenshaw-dev merged commit 3c058ea into argoproj:master Mar 15, 2023
@crenshaw-dev crenshaw-dev deleted the better-plugin-command-logging branch March 15, 2023 13:29
gcp-cherry-pick-bot bot pushed a commit that referenced this pull request Mar 15, 2023
* fix: log plugin commands in a better format

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* comments

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@gcp-cherry-pick-bot
Copy link

Cherry-pick failed with Merge error 3c058ea732f620459e6d7f60e72bf46c483d2d3f into temp-cherry-pick-e22b07-release-2.5

@gcp-cherry-pick-bot
Copy link

Cherry-pick failed with Merge error 3c058ea732f620459e6d7f60e72bf46c483d2d3f into temp-cherry-pick-e22b07-release-2.4

crenshaw-dev added a commit that referenced this pull request Mar 15, 2023
* fix: log plugin commands in a better format

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* comments

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
crenshaw-dev added a commit that referenced this pull request Mar 15, 2023
* fix: log plugin commands in a better format

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* comments

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
@crenshaw-dev
Copy link
Collaborator Author

Cherry-picked onto release-2.5 for 2.5.15 and release-2.4 for 2.4.27.

crenshaw-dev added a commit that referenced this pull request Mar 15, 2023
* fix: log plugin commands in a better format



* comments



---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
alexec pushed a commit to alexec/argo-cd that referenced this pull request Mar 19, 2023
* fix: log plugin commands in a better format

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* comments

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
yyzxw pushed a commit to yyzxw/argo-cd that referenced this pull request Aug 9, 2023
* fix: log plugin commands in a better format

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

* comments

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>

---------

Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
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