Skip to content

fix: locale-independent gpg output parsing #5269

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

Conversation

twz123
Copy link
Member

@twz123 twz123 commented Jan 18, 2021

Explicitly specify the "C" language during the invocation of the gpg binary. That way, parsing its output is more robust on non-english systems.

Signed-off-by: Tom Wieczorek t.wieczorek@yieldlab.de

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • My build is green (troubleshooting builds).

@codecov-io
Copy link

Codecov Report

Merging #5269 (12dc699) into master (ae6b824) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #5269   +/-   ##
=======================================
  Coverage   40.89%   40.89%           
=======================================
  Files         136      136           
  Lines       18423    18423           
=======================================
  Hits         7534     7534           
  Misses       9813     9813           
  Partials     1076     1076           
Impacted Files Coverage Δ
util/gpg/gpg.go 67.70% <100.00%> (ø)

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 ae6b824...12dc699. Read the comment docs.

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.

Good catch!

Can you please extend this to also change the call for the Git verify-commit operation in util/git/client.go - I think we don't set the locale when running Git, so the output of GnuPG when verifying signatures could be affected as well.

cmd.Env = append(cmd.Env, fmt.Sprintf("GNUPGHOME=%s", common.GetGnuPGHomePath()))

Explicitly specify the "C" language during the invocation of the gpg
binary. That way, parsing its output is more robust on non-english
systems.

Signed-off-by: Tom Wieczorek <t.wieczorek@yieldlab.de>
@twz123 twz123 force-pushed the locale-independent-gpg-output-parsing branch from 12dc699 to c74a219 Compare January 18, 2021 19:12
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. Thank you, @twz123!

@jannfis jannfis merged commit a12f805 into argoproj:master Jan 18, 2021
shubhamagarwal19 pushed a commit to shubhamagarwal19/argo-cd that referenced this pull request Apr 15, 2021
Explicitly specify the "C" language during the invocation of the gpg
binary. That way, parsing its output is more robust on non-english
systems.

Signed-off-by: Tom Wieczorek <t.wieczorek@yieldlab.de>
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.

3 participants