-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add missing await
s
#379
Merged
Merged
Add missing await
s
#379
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dscho
force-pushed
the
await-async-functions
branch
3 times, most recently
from
October 30, 2020 17:02
e5694e6
to
05d6633
Compare
ericsciple
reviewed
Oct 30, 2020
ericsciple
reviewed
Oct 30, 2020
ericsciple
reviewed
Oct 30, 2020
After writing the `.extraheader` config, we manually replace the token with the actual value. This is done in an `async` function, but we were not `await`ing the result. In our tests, this commit fixes a flakiness we observed where `remote.origin.url` sometimes (very rarely, actually) is not set for submodules. Our interpretation is that the configs are in the process of being rewritten with the correct token value _while_ another `git config` that wants to set the `insteadOf` value is reading the config, which is currently empty. A more idiomatic way to fix this in Typescript would use `Promise.all()`, like this: await Promise.all( configPaths.map(async configPath => { core.debug(`Replacing token placeholder in '${configPath}'`) await this.replaceTokenPlaceholder(configPath) }) ) However, during review of actions#379 it was decided to keep the `for` loop in the interest of simplicity. Reported by Ian Lynagh. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This rule is quite helpful in avoiding hard-to-debug missing `await`s. Note: there are two locations in `src/main.ts` that trigger warnings: the `run()` and the `cleanup()` function are called without `await` and without any `.catch()` clause. In the initial version of actions#379, this was addressed by adding `.catch()` clauses. However, it was determined that this is boilerplate code that will need to be fixed in a broader way. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho
force-pushed
the
await-async-functions
branch
from
October 31, 2020 09:05
05d6633
to
1607ea3
Compare
I changed the PR description to reflect @igfoo's finding that this PR fixes the bug they observed. @ericsciple this PR is now ready. |
TingluoHuang
approved these changes
Nov 3, 2020
Thank you, @ericsciple and @TingluoHuang! |
SadeghHayeri
pushed a commit
to pipeline-actions/checkout
that referenced
this pull request
Jan 16, 2021
* auth-helper: properly await replacement of the token value in the config After writing the `.extraheader` config, we manually replace the token with the actual value. This is done in an `async` function, but we were not `await`ing the result. In our tests, this commit fixes a flakiness we observed where `remote.origin.url` sometimes (very rarely, actually) is not set for submodules. Our interpretation is that the configs are in the process of being rewritten with the correct token value _while_ another `git config` that wants to set the `insteadOf` value is reading the config, which is currently empty. A more idiomatic way to fix this in Typescript would use `Promise.all()`, like this: await Promise.all( configPaths.map(async configPath => { core.debug(`Replacing token placeholder in '${configPath}'`) await this.replaceTokenPlaceholder(configPath) }) ) However, during review of actions/checkout#379 it was decided to keep the `for` loop in the interest of simplicity. Reported by Ian Lynagh. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * downloadRepository(): await the result of recursive deletions Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * Ask ESLint to report floating Promises This rule is quite helpful in avoiding hard-to-debug missing `await`s. Note: there are two locations in `src/main.ts` that trigger warnings: the `run()` and the `cleanup()` function are called without `await` and without any `.catch()` clause. In the initial version of actions/checkout#379, this was addressed by adding `.catch()` clauses. However, it was determined that this is boilerplate code that will need to be fixed in a broader way. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * Rebuild This trick was brought to you by `npm ci && npm run build`. Needed to get the PR build to pass. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
SadeghHayeri
pushed a commit
to pipeline-actions/checkout
that referenced
this pull request
Jan 16, 2021
* auth-helper: properly await replacement of the token value in the config After writing the `.extraheader` config, we manually replace the token with the actual value. This is done in an `async` function, but we were not `await`ing the result. In our tests, this commit fixes a flakiness we observed where `remote.origin.url` sometimes (very rarely, actually) is not set for submodules. Our interpretation is that the configs are in the process of being rewritten with the correct token value _while_ another `git config` that wants to set the `insteadOf` value is reading the config, which is currently empty. A more idiomatic way to fix this in Typescript would use `Promise.all()`, like this: await Promise.all( configPaths.map(async configPath => { core.debug(`Replacing token placeholder in '${configPath}'`) await this.replaceTokenPlaceholder(configPath) }) ) However, during review of actions/checkout#379 it was decided to keep the `for` loop in the interest of simplicity. Reported by Ian Lynagh. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * downloadRepository(): await the result of recursive deletions Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * Ask ESLint to report floating Promises This rule is quite helpful in avoiding hard-to-debug missing `await`s. Note: there are two locations in `src/main.ts` that trigger warnings: the `run()` and the `cleanup()` function are called without `await` and without any `.catch()` clause. In the initial version of actions/checkout#379, this was addressed by adding `.catch()` clauses. However, it was determined that this is boilerplate code that will need to be fixed in a broader way. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * Rebuild This trick was brought to you by `npm ci && npm run build`. Needed to get the PR build to pass. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This was referenced Mar 6, 2021
This was referenced Mar 15, 2021
AliRAMADA
reviewed
Jun 5, 2021
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.
780000234403440333000030428
|
xmas7
added a commit
to marks-5/checkout
that referenced
this pull request
Oct 4, 2022
* auth-helper: properly await replacement of the token value in the config After writing the `.extraheader` config, we manually replace the token with the actual value. This is done in an `async` function, but we were not `await`ing the result. In our tests, this commit fixes a flakiness we observed where `remote.origin.url` sometimes (very rarely, actually) is not set for submodules. Our interpretation is that the configs are in the process of being rewritten with the correct token value _while_ another `git config` that wants to set the `insteadOf` value is reading the config, which is currently empty. A more idiomatic way to fix this in Typescript would use `Promise.all()`, like this: await Promise.all( configPaths.map(async configPath => { core.debug(`Replacing token placeholder in '${configPath}'`) await this.replaceTokenPlaceholder(configPath) }) ) However, during review of actions/checkout#379 it was decided to keep the `for` loop in the interest of simplicity. Reported by Ian Lynagh. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * downloadRepository(): await the result of recursive deletions Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * Ask ESLint to report floating Promises This rule is quite helpful in avoiding hard-to-debug missing `await`s. Note: there are two locations in `src/main.ts` that trigger warnings: the `run()` and the `cleanup()` function are called without `await` and without any `.catch()` clause. In the initial version of actions/checkout#379, this was addressed by adding `.catch()` clauses. However, it was determined that this is boilerplate code that will need to be fixed in a broader way. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * Rebuild This trick was brought to you by `npm ci && npm run build`. Needed to get the PR build to pass. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
DymysClaflin3
pushed a commit
to DymysClaflin3/checkout
that referenced
this pull request
Apr 29, 2023
* auth-helper: properly await replacement of the token value in the config After writing the `.extraheader` config, we manually replace the token with the actual value. This is done in an `async` function, but we were not `await`ing the result. In our tests, this commit fixes a flakiness we observed where `remote.origin.url` sometimes (very rarely, actually) is not set for submodules. Our interpretation is that the configs are in the process of being rewritten with the correct token value _while_ another `git config` that wants to set the `insteadOf` value is reading the config, which is currently empty. A more idiomatic way to fix this in Typescript would use `Promise.all()`, like this: await Promise.all( configPaths.map(async configPath => { core.debug(`Replacing token placeholder in '${configPath}'`) await this.replaceTokenPlaceholder(configPath) }) ) However, during review of actions/checkout#379 it was decided to keep the `for` loop in the interest of simplicity. Reported by Ian Lynagh. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * downloadRepository(): await the result of recursive deletions Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * Ask ESLint to report floating Promises This rule is quite helpful in avoiding hard-to-debug missing `await`s. Note: there are two locations in `src/main.ts` that trigger warnings: the `run()` and the `cleanup()` function are called without `await` and without any `.catch()` clause. In the initial version of actions/checkout#379, this was addressed by adding `.catch()` clauses. However, it was determined that this is boilerplate code that will need to be fixed in a broader way. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> * Rebuild This trick was brought to you by `npm ci && npm run build`. Needed to get the PR build to pass. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
girishpn
pushed a commit
to girishpn/checkout-1
that referenced
this pull request
Feb 5, 2024
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In our testing, this fixes a flakiness we observed in the recursive checkout of submodules, where
remote.origin.url
is sometimes not set after checkout./cc @igfoo