Skip to content

infra: handle commits without associated PRs#15841

Open
Ap4sh wants to merge 1 commit into
google:masterfrom
Ap4sh:pr-helper-empty-commit-pulls
Open

infra: handle commits without associated PRs#15841
Ap4sh wants to merge 1 commit into
google:masterfrom
Ap4sh:pr-helper-empty-commit-pulls

Conversation

@Ap4sh

@Ap4sh Ap4sh commented Jul 5, 2026

Copy link
Copy Markdown

summary

  • handle an empty response from GitHub's commit-to-PR endpoint in pr_helper
  • keep the existing previous-commit fallback when an earlier commit is not tied to a PR
  • add coverage for the helper response cases and the final main() fallback message

why

get_pull_request_number() already lets callers fall back to a previous commit link when a commit has no associated PR. GitHub can return 200 [] for that endpoint, but the helper currently indexes [0] first, which raises IndexError before the fallback runs

testing

  • python infra/presubmit.py
  • PYTHONPATH=infra pytest infra/pr_helper_test.py -q

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.

1 participant