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-56996 - PRs where parts are not found are orphaned #224

Merged
merged 2 commits into from
May 8, 2019

Conversation

bitwiseman
Copy link
Contributor

Bad PRs can happen a number of ways when constituent parts of
the PR were missing, source fork, user, target branch, etc.
The generally mean the PR is permanently dead.

However, before this change one bad PR would throw an exception
and crash an entire scan. In the case of GitHub Org Folder Pipelines
this would happen all too easily and would stop the whole org from scanning.

This change treats the FileNotFound exceptions thrown by these bad PRs
as errors local to the PR, treats them as orphaned, and continues the scan.

This change only effects PRs, not tags or branches, which are
less prone to errors (or are already doing a similar thing).

Bad PRs can happen a number of ways when constituent parts of
the PR were missing, source fork, user, target branch, etc.
The generally mean the PR is permanenently dead.

However, before this change one bad PR would throw an exception
and crash an entire scan. In the case of GitHub Org Folder Pipelines
this would happen all too easily and would stop the whole org from scanning.

This change treats the FileNotFound exceptions thrown by these bad PRs
as errors local to the PR, treats them as orphaned, and continues the scan.

This change only effects PRs, not tags or branches, which are
less prone to errors (or are already doing a similiar thing).
Copy link
Collaborator

@kshultzCB kshultzCB left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

try {
commit = repo.getCommit(this.mergeHash);
} catch (FileNotFoundException e) {
throw new AbortException("Invalid merge hash for pull request " + ((PullRequestSCMHead)this.getHead()).getNumber() + " : commit not found (" + this.mergeHash + "). Try close and reopen this PR to reset merge hash.");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sentence fragment: Try close and reopen this PR to reset merge hash. Wordy version might be Try closing and reopening this PR to reset its merge hash. Terse version might be Close and reopen the PR to reset its merge hash.

@bitwiseman bitwiseman merged commit 760e4e1 into jenkinsci:master May 8, 2019
@bitwiseman bitwiseman deleted the brittle-scan branch May 8, 2019 20:33
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.

3 participants