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: delay setting git.username and git.email config till commit time #912

Merged
merged 1 commit into from
Nov 8, 2024

Conversation

chengfang
Copy link
Collaborator

In https://github.com/argoproj-labs/argocd-image-updater/blob/master/pkg/argocd/git.go#L161-L167, it sets git.username and git.email config to the git client. These 2 configs are used by commit operation later. In some cases, the commit operation will not be needed, either because there are errors before the commit, or because the commit should be skipped due to absence of real changes.

This PR delays setting these 2 configs, which involves calling git command twice, till before the commit operation. In addition to the savings from skipping the 2 command calls, the logs will also be cleaner.

@chengfang chengfang force-pushed the git.username.git.email branch from d3c1203 to ab50856 Compare November 3, 2024 13:27
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 74.70%. Comparing base (17a57da) to head (ab50856).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #912   +/-   ##
=======================================
  Coverage   74.70%   74.70%           
=======================================
  Files          31       31           
  Lines        3922     3922           
=======================================
  Hits         2930     2930           
  Misses        856      856           
  Partials      136      136           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Collaborator

@ishitasequeira ishitasequeira 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
Contributor

@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!

@jannfis jannfis merged commit 1924339 into argoproj-labs:master Nov 8, 2024
10 checks passed
chengfang added a commit to chengfang/argocd-image-updater that referenced this pull request Nov 8, 2024
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.

4 participants