-
Notifications
You must be signed in to change notification settings - Fork 509
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
Do not cache the output of gitAskPass
#3250
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3250 +/- ##
==========================================
+ Coverage 91.17% 91.18% +0.01%
==========================================
Files 166 167 +1
Lines 3400 3404 +4
Branches 310 306 -4
==========================================
+ Hits 3100 3104 +4
Misses 300 300 ☔ View full report in Codecov by Sentry. |
Prior to this change, the `gitAskPass` program was called once on start-up and its output was cached and used for API calls to the forge while Git itself does not cache its output but calls it anytime a password is needed. This means if the output of `gitAskPass` changes during a Scala Steward run, the new password is only used for Git operations but not for forge API calls. With this change we now do the same as Git and call `gitAskPass` everytime the password is needed. This should make it easier to support GitHub Apps proper which require different access tokens during a run. See also #2973 (comment).
c512a04
to
ff2098a
Compare
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.
Makes sense to me
I tried this successfully in https://github.com/scala-steward-org/scala-steward/compare/topic/gh-app-2 which modifies |
This removes the unnecessary `Repo` parameter from the function for modifying requests to add authentication headers. This parameter was added in #373 but wasn't ever used as can be observed in the diff of `ForgeSelection`. My motivation for adding `Repo` back then was to eventually use different credentials for different repositories for proper GitHub App support. But #3250 demonstrates that we can achieve this without this extra parameter.
Prior to this change, the
gitAskPass
program was called once on start-up and its output was cached and used for API calls to the forge while Git itself does not cache its output but calls it anytime a password is needed. This means if the output ofgitAskPass
changes during a Scala Steward run, the new password is only used for Git operations but not for forge API calls.With this change we now do the same as Git and call
gitAskPass
everytime the password is needed. This should make it easier to support GitHub Apps proper which require different access tokens during a run. See also #2973 (comment).