github-branch-source-plugin icon indicating copy to clipboard operation
github-branch-source-plugin copied to clipboard

[JENKINS-66661] Fix fallback behavior of Fork PR trust criteria

Open Dohbedoh opened this issue 2 years ago • 6 comments

Description

JENKINS-66661: The "Collaborators" and "From users with Admin or Write permission" trust strategies of the PR from Fork traits are breaking Indexing / event mechanism / Jenkinsfile retrieval in cases where the request fails with 401 | 403 | 404. Instead of failing the entire scan, the trust check should return that the revision is not trusted.

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
  • [x] 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

Dohbedoh avatar Jun 28 '23 05:06 Dohbedoh

ping @jenkinsci/github-branch-source-plugin-developers

Dohbedoh avatar Jun 28 '23 06:06 Dohbedoh

(also see https://github.com/jenkinsci/scm-api-plugin/pull/180)

jglick avatar Jun 28 '23 16:06 jglick

Adjusted the behavior to the following:

  • on PR retrieval (org scan / branch indexing / PR event) the PR is skipped if the trust check fails with an exception
  • on PR revision retrieval (get the Jenkinsfile when building a PR) the retrieval fails if the trust check fails with an exception

Dohbedoh avatar Jul 05 '23 11:07 Dohbedoh