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

Some PRs listed on Dependency Dashboard are not linked to individual PRs when more than 1000 PRs old #4803

Closed
blowery opened this issue Nov 12, 2019 · 14 comments
Labels
core:dashboard Related to Dependency Dashboard functionality priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality

Comments

@blowery
Copy link

blowery commented Nov 12, 2019

What Renovate type are you using?

App, Github

Describe the bug

See Automattic/wp-calypso#37419
Some renovate updates there are not linked to the individual PRs. It would be nice if they were all linked.

Did you see anything helpful in debug logs?

Nope

To Reproduce

See Automattic/wp-calypso#37419

Additional context

@rarkins
Copy link
Collaborator

rarkins commented Nov 12, 2019

First check: are all the unlinked ones actually opened? Or perhaps are they mistakenly listed as opened when they're not?

@blowery
Copy link
Author

blowery commented Nov 13, 2019

Some are for sure. For instance Automattic/wp-calypso#35623 is listed on the master issue, but not linked. Also Automattic/wp-calypso#34935

@rarkins rarkins added type:bug Bug fix of existing functionality priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others ready labels Dec 11, 2019
@rarkins
Copy link
Collaborator

rarkins commented Dec 11, 2019

Up to date master issue link: Automattic/wp-calypso#37527

Screenshot of master issue open issues (some are unliked):
image

Screenshot of actual open issues, sorted from newest to oldest:
image

@rarkins
Copy link
Collaborator

rarkins commented Dec 11, 2019

I don't think it's a coincidence that the unlinked ones are the oldest ones. I'm guessing it's because we don't fetch every PR, and this repository has a really high number of PRs.

@rarkins
Copy link
Collaborator

rarkins commented Dec 11, 2019

Confirmed, we fetch only 1000 PRs:

{"level":20,"msg":"Retrieving PR list","time":"2019-12-11T09:02:58.885Z"}
{"level":20,"msg":"Retrieved 1000 Pull Requests","time":"2019-12-11T09:03:11.304Z"}

Unfortunately I can't fix this without first refactoring how we fetch PRs, which is a little bit of technical debt I've been meaning to get to. I'll leave this open for addressing afterwards.

@blowery
Copy link
Author

blowery commented Dec 11, 2019

Thanks for looking into this!

@rarkins rarkins changed the title Some PRs listed on Master Issue are not linked to individual PRs Some PRs listed on Master Issue are not linked to individual PRs when more than 1000 PRs old Dec 13, 2019
@rarkins rarkins removed the ready label Jun 18, 2020
@HonkingGoose HonkingGoose added the core:dashboard Related to Dependency Dashboard functionality label Jun 13, 2021
@HonkingGoose

This comment has been minimized.

@rarkins rarkins changed the title Some PRs listed on Master Issue are not linked to individual PRs when more than 1000 PRs old Some PRs listed on Dependency Dashboard are not linked to individual PRs when more than 1000 PRs old Jun 13, 2021
@MaronHatoum
Copy link
Contributor

This should be resolved in Renovate release 25.37.1 (issue: #5668)
@rarkins FYI

@viceice viceice closed this as completed May 1, 2022
@rarkins
Copy link
Collaborator

rarkins commented May 1, 2022

@MaronHatoum are you sure? I thought we limit our fetch to 1000 PRs, so not sure how we would otherwise find them?

@MaronHatoum MaronHatoum reopened this May 1, 2022
@MaronHatoum
Copy link
Contributor

After checking the code I don't see any limitation and getting PRs from GitHub has been refactored recently,
is there another place where there is a limitation?

@rarkins
Copy link
Collaborator

rarkins commented May 1, 2022

Our pagination defaults to 10 pages by default and I think it's used for PRs too

@MaronHatoum
Copy link
Contributor

hi @rarkins
the code was refactored it calls an unlimited number of pages and gets 20 PR per page.
it is a while loop I don't see any restriction to 10 pages at all.

@MaronHatoum
Copy link
Contributor

let pageIdx = 1;
while (needNextPageFetch && needNextPageSync) {
const urlPath = `repos/${repo}/pulls?per_page=20&state=all&sort=updated&direction=desc&page=${pageIdx}`;
const opts: GithubHttpOptions = { paginate: false };
if (pageIdx === 1) {
if (is.emptyArray(prApiCache.getItems())) {
// Speed up initial fetch
opts.paginate = true;
}
}
const res = await http.getJson<GhRestPr[]>(urlPath, opts);
apiQuotaAffected = true;
requestsTotal += 1;

This is the refactored code and it is using the new HTTP(GOT) request instead of the old github.ts request and I don't see any limitation in the new request.

I can see the pagination limitation in the old github.ts request but the github/pr.ts is not calling it anymore.

@rarkins
Copy link
Collaborator

rarkins commented May 2, 2022

It should fetch 20 per page only until a date is hit. Otherwise if the cache is empty it uses opts.paginate=true which is passed to the HTTP layer and limits to 10 pages.

@zharinov please confirm. Also can you check that we're still fetching 100 per page when the cache is missing?

@rarkins rarkins closed this as completed Apr 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
core:dashboard Related to Dependency Dashboard functionality priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:bug Bug fix of existing functionality
Projects
None yet
Development

No branches or pull requests

5 participants