-
Notifications
You must be signed in to change notification settings - Fork 156
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
Refactor the git clone to make the variable scope smaller #5190
Conversation
Move the authArgs into the singleflight closure, as they are only used within it. Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ナイス👍
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5190 +/- ##
==========================================
- Coverage 22.95% 22.93% -0.02%
==========================================
Files 419 419
Lines 44996 44996
==========================================
- Hits 10329 10322 -7
- Misses 33872 33878 +6
- Partials 795 796 +1 ☔ View full report in Codecov by Sentry. |
Move the authArgs into the singleflight closure, as they are only used within it. Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]> Signed-off-by: pipecd-bot <[email protected]>
* Modified to use Git with PAT (#4571) * fix to read PAT settings from file Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * piped Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * include PAT information in URL Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: modification of conditional branching Co-authored-by: sivchari <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: corrected error in error message Co-authored-by: sivchari <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: integration of mask function Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: make validation test Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: function name Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: rename function for validation PAT Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: fix test code as pointed out in the review Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * feat: add explan for git personal access token in document Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: change required in documentation Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: change return value Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: add test case Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: fix test Signed-off-by: swallow <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: PipedGit struct to use password authentication instead of personal access token Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix to read PAT settings from file Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * piped Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: integration of mask function Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: make validation test Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: function name Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: rename function for validation PAT Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: fix test Signed-off-by: swallow <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: PipedGit struct to use password authentication instead of personal access token Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * Fix Git authentication configuration Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * Update password authentication configuration Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * Fix error variable name Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * Fix rename password Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * Refactor includePasswordAuthRemote function Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * Update password authentication in clone test Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: delete PasswordAuth Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: remove unused PasswordAuth field and refactor password authentication in git client Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * Remove unnecessary print statement in Validate function Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: fix code for rebase Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * fix: remove unused GitPasswordAuth configuration Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: sZma5a <[email protected]> * feat: add password decoding for password in includePasswordRemote function Signed-off-by: sZma5a <[email protected]> * fix: refactor Git password authentication method Signed-off-by: sZma5a <[email protected]> * fix: update password encoding in TestCloneUsingPassword Signed-off-by: sZma5a <[email protected]> * Update docs/content/en/docs-dev/user-guide/managing-piped/configuration-reference.md Co-authored-by: Yoshiki Fujikane <[email protected]> Signed-off-by: sZma5a <[email protected]> * Update pkg/config/piped.go Co-authored-by: Yoshiki Fujikane <[email protected]> Signed-off-by: sZma5a <[email protected]> * [wip] delete password Signed-off-by: sZma5a <[email protected]> * [wip] not tested - change token to args from url Signed-off-by: sZma5a <[email protected]> * Fix commented out test case Signed-off-by: sZma5a <[email protected]> * Refactor authentication in git client Signed-off-by: sZma5a <[email protected]> * feat: add password decoding function and replace Password string Signed-off-by: sZma5a <[email protected]> --------- Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Co-authored-by: sZma5a <[email protected]> Co-authored-by: sivchari <[email protected]> Co-authored-by: 鈴木 優耀 <[email protected]> Co-authored-by: Your Name <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]> Signed-off-by: pipecd-bot <[email protected]> * Use singleflight to clone/update repository cache (#5171) Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]> Signed-off-by: pipecd-bot <[email protected]> * Refactor the git clone (#5190) Move the authArgs into the singleflight closure, as they are only used within it. Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]> Signed-off-by: pipecd-bot <[email protected]> --------- Signed-off-by: sZma5a <[email protected]> Signed-off-by: 鈴木 優耀 <[email protected]> Signed-off-by: Your Name <[email protected]> Signed-off-by: sZma5a <[email protected]> Signed-off-by: swallow <[email protected]> Signed-off-by: pipecd-bot <[email protected]> Signed-off-by: Shinnosuke Sawada-Dazai <[email protected]> Co-authored-by: sZma5a <[email protected]> Co-authored-by: sZma5a <[email protected]> Co-authored-by: sivchari <[email protected]> Co-authored-by: 鈴木 優耀 <[email protected]> Co-authored-by: Your Name <[email protected]> Co-authored-by: Yoshiki Fujikane <[email protected]> Co-authored-by: Shinnosuke Sawada-Dazai <[email protected]>
What this PR does / why we need it:
Move the authArgs into the singleflight closure, as they are only used within it.
Which issue(s) this PR fixes:
Follows #5171
Does this PR introduce a user-facing change?: