JENKINS-65970 Ability to ignore indexing errors and continue scanning #471
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Reviewer checklist
Documentation changes
Users/aliases to notify