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

[BUGFIX] Fix handling of failures to fetch the PR list and the PR comments #93

Merged
merged 2 commits into from
Jun 25, 2019

Conversation

proski
Copy link

@proski proski commented May 8, 2019

*  Fix handling of failures to fetch the PR list and the PR comments
   
   Add a new exception StashApiException, throw it in both cases.
   
   Don't trigger a build on a failure to fetch PR comments. That issue has
   been observed creating a large number of builds if the connection between
   Jenkins and Stash is unstable.

@proski proski changed the title Fix starting PR builds if Stahs API is down Fix starting PR builds if Stash API is down or very slow May 8, 2019
@proski proski force-pushed the stampede-fix branch 2 times, most recently from cce7629 to 6ebd94f Compare May 14, 2019 00:35
@proski proski changed the title Fix starting PR builds if Stash API is down or very slow [BUGFIX] Fix starting PR builds if Stash API is down or very slow May 24, 2019
@proski proski mentioned this pull request May 24, 2019
@proski proski changed the title [BUGFIX] Fix starting PR builds if Stash API is down or very slow [BUGFIX] Fix handling of failures to fetch the PR list and the PR comments Jun 2, 2019
@proski
Copy link
Author

proski commented Jun 2, 2019

Rewritten from scratch with a custom exception StashApiException.

@proski
Copy link
Author

proski commented Jun 3, 2019

Added a separate commit to add Nonnull annotations in the functions that throw instead of returning null. The commit also removes null checks that are not necessary anymore. FindBugs reported one of those checks as a bug.

Add a new exception StashApiException, throw it in both cases.

Don't trigger a build on a failure to fetch PR comments. That issue has
been observed creating a large number of builds if the connection between
Jenkins and Stash is unstable.
In StashApiClient.java, getPullRequests() and getPullRequestComments()
don't return null anymore, they throw StashApiException on error.
extractComments() is used getPullRequestComments() and doesn't return
null either, so annotate it as well.

In StashRepository.java, remove null checks for the results of the
@nonnull methods.
@jakub-bochenski jakub-bochenski merged commit 4f9b7d0 into jenkinsci:master Jun 25, 2019
@proski proski deleted the stampede-fix branch June 25, 2019 17:19
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