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

[NoQA] Increase the octokit gh throttling times #22210

Merged
merged 7 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/actions/javascript/awaitStagingDeploys/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,21 @@ function getStringInput(name, options, defaultValue = undefined) {
return input;
}

/**
* Simple implementation of a sleep method.
*
* @param {Number} milliseconds - Number of milliseconds the execution should sleep for
*
* @returns {Promise}
*/
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}

module.exports = {
getJSONInput,
getStringInput,
sleep,
};


Expand Down
12 changes: 12 additions & 0 deletions .github/actions/javascript/getDeployPullRequestList/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,21 @@ function getStringInput(name, options, defaultValue = undefined) {
return input;
}

/**
* Simple implementation of a sleep method.
*
* @param {Number} milliseconds - Number of milliseconds the execution should sleep for
*
* @returns {Promise}
*/
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}

module.exports = {
getJSONInput,
getStringInput,
sleep,
};


Expand Down
12 changes: 12 additions & 0 deletions .github/actions/javascript/getPullRequestDetails/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,21 @@ function getStringInput(name, options, defaultValue = undefined) {
return input;
}

/**
* Simple implementation of a sleep method.
*
* @param {Number} milliseconds - Number of milliseconds the execution should sleep for
*
* @returns {Promise}
*/
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}

module.exports = {
getJSONInput,
getStringInput,
sleep,
};


Expand Down
12 changes: 12 additions & 0 deletions .github/actions/javascript/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,21 @@ function getStringInput(name, options, defaultValue = undefined) {
return input;
}

/**
* Simple implementation of a sleep method.
*
* @param {Number} milliseconds - Number of milliseconds the execution should sleep for
*
* @returns {Promise}
*/
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}

module.exports = {
getJSONInput,
getStringInput,
sleep,
};


Expand Down
13 changes: 13 additions & 0 deletions .github/actions/javascript/markPullRequestsAsDeployed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ function getDeployMessage(deployer, deployVerb, prTitle) {
*/
function commentPR(PR, message) {
return GithubUtils.createComment(context.repo.repo, PR, message)
.then(() => ActionUtils.sleep(1000))
.then(() => console.log(`Comment created on #${PR} successfully 🎉`))
.catch((err) => {
console.log(`Unable to write comment on #${PR} 😞`);
Expand Down Expand Up @@ -204,9 +205,21 @@ function getStringInput(name, options, defaultValue = undefined) {
return input;
}

/**
* Simple implementation of a sleep method.
*
* @param {Number} milliseconds - Number of milliseconds the execution should sleep for
*
* @returns {Promise}
*/
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}

module.exports = {
getJSONInput,
getStringInput,
sleep,
};


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ function getDeployMessage(deployer, deployVerb, prTitle) {
*/
function commentPR(PR, message) {
return GithubUtils.createComment(context.repo.repo, PR, message)
.then(() => ActionUtils.sleep(1000))
.then(() => console.log(`Comment created on #${PR} successfully 🎉`))
.catch((err) => {
console.log(`Unable to write comment on #${PR} 😞`);
Expand Down
12 changes: 12 additions & 0 deletions .github/actions/javascript/triggerWorkflowAndWait/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,21 @@ function getStringInput(name, options, defaultValue = undefined) {
return input;
}

/**
* Simple implementation of a sleep method.
*
* @param {Number} milliseconds - Number of milliseconds the execution should sleep for
*
* @returns {Promise}
*/
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}

module.exports = {
getJSONInput,
getStringInput,
sleep,
};


Expand Down
12 changes: 12 additions & 0 deletions .github/libs/ActionUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,19 @@ function getStringInput(name, options, defaultValue = undefined) {
return input;
}

/**
* Simple implementation of a sleep method.
*
* @param {Number} milliseconds - Number of milliseconds the execution should sleep for
*
* @returns {Promise}
*/
function sleep(milliseconds) {
return new Promise((resolve) => setTimeout(resolve, milliseconds));
}

module.exports = {
getJSONInput,
getStringInput,
sleep,
};
Loading