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

Fetching old PRs #1

Open
crstamps2 opened this issue Feb 26, 2019 · 8 comments · May be fixed by #4
Open

Fetching old PRs #1

crstamps2 opened this issue Feb 26, 2019 · 8 comments · May be fixed by #4

Comments

@crstamps2
Copy link

It seems that this resource starts at the earliest PRs instead of the latest, so it takes some pump priming to get to PRs created after you start using the resource.

@shinmyung0
Copy link
Owner

Thanks for the heads up. I think it probably has to do with this ordering:
https://github.com/shinmyung0/pullrequest-events-resource/blob/master/scripts/common.js#L160

The order of PRs being fetched is in order of UPDATED_AT in ASC order which...in retrospect might not be the best way. I can put in a fix with some tests when I have time or if you want to file a PR that would also be cool.

@crstamps2
Copy link
Author

I can submit a PR.

@shinmyung0
Copy link
Owner

Would the better ordering be PR's that have been updated recently in DESC order?

@crstamps2
Copy link
Author

I am not sure. Maybe it should be configurable?

The use case I am doing is essentially a 1 to 1 ratio. 1 PR merged/closed causes the job to run for that PR, no more, no less.

@shinmyung0
Copy link
Owner

yeah I think being configurable is reasonable

@jdstone-loansnap
Copy link

@crstamps2 @shinmyung0 has any fix been released for this issue?

@jdstone-loansnap
Copy link

It was performing the job on all PRs, not just the first 5 (first: 5), like I had it set to, forward in time. I changed line 160 in common.js to DESC, but now it's just going backwards in time instead of forward and still doing all PRs, not just the first 5.

@mattdodge mattdodge linked a pull request Sep 11, 2019 that will close this issue
@MadhuvanthG
Copy link

It was performing the job on all PRs, not just the first 5 (first: 5), like I had it set to, forward in time. I changed line 160 in common.js to DESC, but now it's just going backwards in time instead of forward and still doing all PRs, not just the first 5.

+1. We tried using it for a repo that's ~2 years old and it was triggering the pipeline for every single one. If someone can confirm that this is how it would work, I think it's worth a mention in README at least

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants