asfgit closed pull request #72: IGNITE-10275 Jira spam fast fix URL: https://github.com/apache/ignite-teamcity-bot/pull/72
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java index 5ad13505..86768688 100644 --- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java +++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/observer/ObserverTask.java @@ -141,7 +141,7 @@ protected String runObserverTask() { if (info.isFinishedWithFailures(teamcity)) { boolean rmv = compactInfos().remove(compactInfo); - + Preconditions.checkState(rmv, "Key not found: " + compactInfo); logger.error("JIRA will not be commented." + @@ -157,34 +157,35 @@ protected String runObserverTask() { continue; } - ICredentialsProv creds = tcHelper.getServerAuthorizerCreds(); + try { + rmvdVisas.add(objMapper.writeValueAsString(compactInfo)); + } + catch (Exception e) { + logger.error("JSON string parse failed: " + e.getMessage(), e); - Visa visa = jiraIntegration.notifyJira(info.srvId, creds, info.buildTypeId, - info.branchForTc, info.ticket); + return "Exception while JSON parsing: " + e.getClass().getSimpleName() + ": " + e.getMessage(); + } - visasHistoryStorage.updateVisaRequestRes(info.getContributionKey(), info.date, visa); + try { + boolean rmv = compactInfos().remove(compactInfo); - if (visa.isSuccess()) { - ticketsNotified.add(info.ticket); + if (!rmv) + continue; + } + catch (Exception e) { + logger.error("cache remove: " + e.getMessage(), e); + + return X.getFullStackTrace(e); + } - try { - rmvdVisas.add(objMapper.writeValueAsString(compactInfo)); - } - catch (Exception e) { - logger.error("JSON string parse failed: " + e.getMessage(), e); + ICredentialsProv creds = tcHelper.getServerAuthorizerCreds(); - return "Exception while JSON parsing: " + e.getClass().getSimpleName() + ": " + e.getMessage(); - } + Visa visa = jiraIntegration.notifyJira(info.srvId, creds, info.buildTypeId, + info.branchForTc, info.ticket); - try { - compactInfos().remove(compactInfo); - } - catch (Exception e) { - logger.error("cache remove: " + e.getMessage(), e); + visasHistoryStorage.updateVisaRequestRes(info.getContributionKey(), info.date, visa); - return X.getFullStackTrace(e); - } - } + ticketsNotified.add(info.ticket); } return "Checked " + checkedBuilds + " not finished " + notFinishedBuilds + " notified: " + ticketsNotified + ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services