[JENKINS-73791] Prevent PR 404 on details to break Branches scan
Description
JENKINS-73791: The retrieval of branches can fail the entire Branch Scanning if a BranchDiscoveryTrait strategy that involves checking on PRs is used while some PR parts cannot be retrieved with a 404 FileNotFoundException.
This is an extension of JENKINS-56996 / https://github.com/jenkinsci/github-branch-source-plugin/pull/224.
Submitter checklist
- [x] Link to JIRA ticket in description, if appropriate.
- [x] Change is code complete and matches issue description
- [x] Automated tests have been added to exercise the changes
- [ ] Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.
Reviewer checklist
- [ ] Run the changes and verify that the change matches the issue description
- [ ] Reviewed the code
- [ ] Verified that the appropriate tests have been written or valid explanation given
Documentation changes
- [ ] Link to jenkins.io PR, or an explanation for why no doc changes are needed
Users/aliases to notify
@jenkinsci/github-branch-source-plugin-developers
First commit to reproduce the failure. Second commit coming soon to demonstrate the fix.
@dwnusbaum @jeromepochat @rsandell Can we merge this ?
LGTM
Does #840 not cover this case?
@jglick Nope. That https://github.com/jenkinsci/github-branch-source-plugin/pull/840 is for the Organization Scan. This here is for Branch Indexing.
NOTE: Copilot is also an example that interrupts branch indexing. It will be handled specifically at https://github.com/jenkinsci/github-branch-source-plugin/pull/864.