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

JENKINS-65970 Ability to ignore indexing errors and continue scanning #471

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sfosterdw
Copy link

@sfosterdw sfosterdw commented Oct 2, 2021

Description

A brief summary describing the changes in this pull request. See
JENKINS-65970 for further information.

The linked issue is about a specific case where this plugin is looking for a Jenkinsfile in a path which is a submodule root for a given SCMHead. Jackson tries to deserialize the response as an array and fails because a single submodule result is returned, which is also not currently handled in the github-api library. I tried to figure out what would be required to cover that case and found some discussion about needing submodule traversal support to properly handle it hub4j/github-api#915.

One option is ignoring the specific MismatchedInputException in the GitHubSCMProbe.stat function which retrieves the contents of a directory, but that didn't seem great. I left it commented out in the draft.

I then saw that there was some error-ignoring logic for Pull Request heads already which had a comment implying the rationale behind interrupting scanning except in this case. I think there are probably cases where a user doesn't mind ignoring most errors and would rather complete the indexing job. I tried to implement similar error-ignoring logic for the other SCMHead types on an opt-in basis.

I'm opening this PR for solution discussion as well as reviews of this implementation.
Not much of a java developer so any pointers are appreciated :)

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • 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

@sfosterdw sfosterdw marked this pull request as ready for review October 28, 2021 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants