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

Fetch all PRs and search in the result #4

Merged
merged 3 commits into from
Jul 19, 2022

Conversation

weeman1337
Copy link
Contributor

Fixes not finding some PRs such as matrix-org/matrix-react-sdk#9002

For some reason a query with the head param does not always return a
result. Fetching all PRs return these as well. So we fetch all and then
iterate the results to find the PR we are looking for.

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs pagination support otherwise will only work for the latest ~50 PRs iirc

@weeman1337
Copy link
Contributor Author

weeman1337 commented Jul 18, 2022

Needs pagination support otherwise will only work for the latest ~50 PRs iirc

As far as I understand the doc github.paginate() should fetch all pages.

@weeman1337 weeman1337 requested a review from t3chguy July 18, 2022 10:06
@t3chguy
Copy link
Member

t3chguy commented Jul 18, 2022

Oh yes, the lack of syntax highlight made me miss that call somehow.

Do you have a test run of this somewhere?

@t3chguy
Copy link
Member

t3chguy commented Jul 18, 2022

As far as I understand the doc github.paginate() should fetch all pages.

If that is the case then we have the other issue of that dataset growing forever unbounded, and eventually hitting the limit on the GITHUB_TOKEN. So we should only paginate when the previous page did not contain our result.

For some reason a query with the head param does not always return a
result. Fetching all PRs return these as well. So we fetch all and then
iterate the results to find the PR we are looking for.
@weeman1337 weeman1337 force-pushed the weeman1337/improve-pr-query branch from 1c7d8a7 to 9d140e3 Compare July 18, 2022 11:35
@weeman1337

This comment was marked as outdated.

Copy link
Member

@t3chguy t3chguy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane to me

@t3chguy
Copy link
Member

t3chguy commented Jul 19, 2022

This is my test code:

So you haven't tested a version of this action using the code though to verify it end-to-end? You can specify action versions by git sha to refer to your unmerged code as version #9d140e35de7346b58f7730dc50cb2d313f4dc6ed

@weeman1337 weeman1337 marked this pull request as draft July 19, 2022 13:10
@weeman1337
Copy link
Contributor Author

@weeman1337 weeman1337 marked this pull request as ready for review July 19, 2022 14:35
@t3chguy t3chguy merged commit e1f8826 into matrix-org:main Jul 19, 2022
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 this pull request may close these issues.

2 participants