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

Current hardcoded limits can timeout Github API unexpectedly #2265

Open
radicand opened this issue Apr 9, 2024 · 2 comments
Open

Current hardcoded limits can timeout Github API unexpectedly #2265

radicand opened this issue Apr 9, 2024 · 2 comments
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@radicand
Copy link
Contributor

radicand commented Apr 9, 2024

Environment details

  • OS: ubuntu-latest
  • Node.js version: v18
  • npm version: N/A
  • release-please version: 16.10.0

Steps to reproduce

  1. Run release-please against our current repository/branch configuration. No options are specified in the manifest presently except for specifying a simple release strategy and 4 extraFiles to update.
  2. Receive an error response (below)

Notes

I can reproduce the error directly by manually querying the API call found here (above):

const params = {
cursor,
owner: this.repository.owner,
repo: this.repository.repo,
num: 25,
targetBranch,
maxFilesChanged: 100, // max is 100
};
with what release-please is calling. We have had a few very large commits/merges recently and it is causing the Github API to throw an error which is preventing release-please from completing. We get the following currently:

Running release-please version: 16.10.0
❯ Fetching release-please-config.json from branch REDACTED
❯ Fetching .release-please-manifest.json from branch REDACTED
✔ Building releases
✔ Building strategies by path
❯ .: simple
❯ Fetching release-please-config.json from branch REDACTED
❯ Fetching .release-please-manifest.json from branch REDACTED
✔ Building pull requests
✔ Building strategies by path
❯ .: simple
✔ Collecting release commit SHAs
❯ release search depth: 400
❯ Fetching releases with cursor undefined
❯ Found release for path ., v3.0.0
❯ release for path: ., version: 3.0.0, sha: REDACTED[22](REDACTED)REDACTED
✔ Collecting commits since all latest releases
❯ commit search depth: 1
❯ Set(1) { 'REDACTED[23](REDACTED)REDACTED' }
❯ Fetching merge commits on branch REDACTED with cursor: undefined
Error: release-please failed: We couldn't respond to your request in time. Sorry about that. Please try resubmitting your request and contact us if the problem persists.

If I tweak the parameters however, I can get the query to succeed. Either setting a lower num value (15 works, 20 doesn't for example), or a lower maxFilesChanged (50 works, 75 doesn't), will make the query succeed.

Can these values become configurable? Alternatively, is there something we can do to short-circuit this? Setting bootstrap-sha on the most recent, uncomplicated, commit does nothing to remedy.

@radicand radicand added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Apr 9, 2024
@rafilkmp3
Copy link

I'm having the same problem, even with the modifications you suggested i wasn't able to go through for testing. Is there a way to create some sort of checkpoint and only fetch commits from, let's say, April 01 onwards? My logs:

Running release-please version: 16.10.0
✔ Looking for latest release on branch: master with prefix: 
❯ Fetching merge commits on branch master with cursor: undefined
❯ Fetching merge commits on branch master with cursor: redacted 24
❯ Fetching merge commits on branch master with cursor: redacted 49
❯ Fetching merge commits on branch master with cursor: redacted 74
❯ Fetching merge commits on branch master with cursor: redacted 99
❯ Fetching merge commits on branch master with cursor: redacted 124
❯ Fetching merge commits on branch master with cursor: redacted [14]
❯ Fetching merge commits on branch master with cursor: redacted 174
❯ Fetching merge commits on branch master with cursor: redacted 199
❯ Fetching merge commits on branch master with cursor: redacted 224
Error: release-please failed: We couldn't respond to your request in time. Sorry about that. Please try resubmitting your request and contact us if the problem persists.

@radicand
Copy link
Contributor Author

@rafilkmp3 to temporarily unblock us, I've installed release-please locally, edited its github.js file with these params:

    const params = {
      cursor,
      owner: this.repository.owner,
      repo: this.repository.repo,
      num: 15,
      targetBranch,
      maxFilesChanged: 50, // max is 100
    };

And ran with release-please release-pr --repo-url https://github.com/repo/path --token PAT_HERE --target-branch my-branch

I was able to generate the release this way; it's not ideal, but for anyone who needs to unblock in the interim it may help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

3 participants