Azure / Azure/azure-rest-api-specs
[extract-inputs] Search for PRs by SHA using "list pull requests" of 100 recently updated
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
Add as fallback between "get PRs for commit SHA" and "search".
We should extract the existing code from `context.js` and create a helper method `listPullRequestsForCommit(head_owner, head_repo, head_sha, base_owner, base_repo)`, which tries the following:
1. repos.listPullRequestsAssociatedWithCommit(head_owner, head_repo, head_sha)
- Should work on fork and non-fork PRs to public, and non-fork PRs to private
2. pulls.list(base_owner, base_repo, orderby: updated-desc), client-side filter by head_sha
- Should work on fork PRs to private
- Max 100 pulls per API call, so maybe only search first page?
3. search(base_owner, base_repo, head_sha)
- Should work on fork and non-fork PRs to public and private
- Low rate limit of 30 req/min
Contributor guide
Assessment
This issue has not been assessed yet.