Skip to content

Commit

Permalink
Merge pull request #85 from gsmet/hide-runs-if-successful
Browse files Browse the repository at this point in the history
Various small improvements
  • Loading branch information
gsmet authored Apr 19, 2021
2 parents 5b3f786 + fc9b047 commit b9b21cf
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<version.formatter.plugin>2.15.0</version.formatter.plugin>
<version.impsort.plugin>1.4.1</version.impsort.plugin>

<quarkus-github-app.version>1.0.4</quarkus-github-app.version>
<quarkus-github-app.version>1.0.5</quarkus-github-app.version>
<glob.version>0.9.0</glob.version>
</properties>
<dependencyManagement>
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/io/quarkus/bot/AnalyzeWorkflowRunResults.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ void analyzeWorkflowResults(@WorkflowRun.Completed GHEventPayload.WorkflowRun wo
if (!WorkflowConstants.QUARKUS_CI_WORKFLOW_NAME.equals(workflow.getName())) {
return;
}
if (workflowRun.getConclusion() != Conclusion.FAILURE && workflowRun.getConclusion() != Conclusion.CANCELLED) {
return;
}
if (workflowRun.getEvent() != GHEvent.PULL_REQUEST) {
return;
}
Expand Down Expand Up @@ -98,11 +95,15 @@ void analyzeWorkflowResults(@WorkflowRun.Completed GHEventPayload.WorkflowRun wo
}
GHPullRequest pullRequest = pullRequestOptional.get();

HideOutdatedWorkflowRunResults.hideOutdatedWorkflowRunResults(quarkusBotConfig, pullRequest);

if (pullRequest.isDraft()) {
return;
}

HideOutdatedWorkflowRunResults.hideOutdatedWorkflowRunResults(quarkusBotConfig, pullRequest);
if (workflowRun.getConclusion() != Conclusion.FAILURE && workflowRun.getConclusion() != Conclusion.CANCELLED) {
return;
}

List<GHArtifact> surefireReportsArtifacts = artifacts
.stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ public List<WorkflowReportJob> getJobs() {
return jobs;
}

public boolean hasJobsFailing() {
for (WorkflowReportJob job : jobs) {
if (job.isFailing()) {
return true;
}
}
return false;
}

public List<WorkflowReportJob> getJobsWithTestFailures() {
return jobs.stream().filter(j -> j.hasTestFailures()).collect(Collectors.toList());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
:no_entry_sign: This build has been cancelled.

{/if}
{#if report.failure && report.jobs.empty}
{#if report.failure && !report.jobsFailing}
✖ This build has failed but no jobs reported an error. Something weird happened, please check [the workflow run page]({report.workflowRunUrl}) carefully.

{/if}
{#if !report.jobs.empty}
{#if report.jobsFailing}
## <a id="build-summary-top"></a>Failing Jobs - Building {report.sha} - [Back to Pull Request]({pullRequest.htmlUrl})

| Status | Name | Step | Test failures | Logs | Raw logs |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
:no_entry_sign: This workflow run has been cancelled.

{/if}
{#if report.failure && report.jobs.empty}
{#if report.failure && !report.jobsFailing}
✖ This workflow run has failed but no jobs reported an error. Something weird happened, please check [the workflow run page]({report.workflowRunUrl}) carefully: it might be an issue with the workflow configuration itself.

{/if}
{#if !report.jobs.empty}
{#if report.jobsFailing}
## Failing Jobs - Building {report.sha}

{#if !artifactsAvailable}:warning: Artifacts of the workflow run were not available thus the report misses some details.{/if}
Expand Down

0 comments on commit b9b21cf

Please sign in to comment.