-
Notifications
You must be signed in to change notification settings - Fork 432
fix: add rate-limit retry to PR creation and fallback issue paths #31244
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
Changes from all commits
f661e2a
c63241c
c520b2a
c59c8a6
a7e75d3
9a66ae7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ const { isStagedMode } = require("./safe_output_helpers.cjs"); | |
| const { pushSignedCommits } = require("./push_signed_commits.cjs"); | ||
| const { updateActivationCommentWithCommit, updateActivationComment } = require("./update_activation_comment.cjs"); | ||
| const { getErrorMessage } = require("./error_helpers.cjs"); | ||
| const { withRetry, RATE_LIMIT_RETRY_CONFIG } = require("./error_recovery.cjs"); | ||
| const { normalizeBranchName } = require("./normalize_branch_name.cjs"); | ||
| const { pushExtraEmptyCommit } = require("./extra_empty_commit.cjs"); | ||
| const { detectForkPR, checkBranchPushable } = require("./pr_helpers.cjs"); | ||
|
|
@@ -471,13 +472,18 @@ async function main(config = {}) { | |
| }); | ||
|
|
||
| try { | ||
| const { data: issue } = await githubClient.rest.issues.create({ | ||
| owner: repoParts.owner, | ||
| repo: repoParts.repo, | ||
| title: issueTitle, | ||
| body: issueBody, | ||
| labels: ["agentic-workflows"], | ||
| }); | ||
| const { data: issue } = await withRetry( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [/tdd] The manifest-protection issue creation path now uses A test for |
||
| () => | ||
| githubClient.rest.issues.create({ | ||
| owner: repoParts.owner, | ||
| repo: repoParts.repo, | ||
| title: issueTitle, | ||
| body: issueBody, | ||
| labels: ["agentic-workflows"], | ||
| }), | ||
| RATE_LIMIT_RETRY_CONFIG, | ||
| `create manifest-protection review issue in ${repoParts.owner}/${repoParts.repo}` | ||
| ); | ||
| core.info(`Created manifest-protection review issue #${issue.number}: ${issue.html_url}`); | ||
| await updateActivationComment(github, context, core, issue.html_url, issue.number, "issue"); | ||
| return { | ||
|
|
||
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.
[/tdd] This assertion hardcodes
6(1 initial + 5 retries), coupling the test toRATE_LIMIT_RETRY_CONFIG.maxRetries. If the retry config changes, this test fails with a cryptic number mismatch.Consider importing the constant:
This makes the test self-documenting and resilient to config tuning.