Skip to content

Commit

Permalink
Merge pull request #199 from gsmet/small-improvements
Browse files Browse the repository at this point in the history
Use Markdown admonitions in reports
  • Loading branch information
gsmet authored Jul 10, 2024
2 parents 8a262f9 + 0aa2103 commit b11c10b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ private void handleCompleted(GHWorkflow workflow,
artifactsAvailable = true;
} catch (ConditionTimeoutException e) {
if (workflowRun.getConclusion() != Conclusion.CANCELLED) {
LOG.warn("Workflow run #" + workflowRun.getId()
LOG.warn("Workflow run " + workflowRun.getRepository().getFullName() + "#"
+ workflowRun.getName() + ":" + workflowRun.getId()
+ " - Unable to get the artifacts in a timely manner, ignoring them");
}
artifacts = Collections.emptyList();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
## Test Failures

{#if !includeStackTraces}:warning: Unable to include the stracktraces as the report was too long. See annotations below for the details.{/if}
{#if !includeFailureLinks}:warning: Unable to include the failure links as the report was too long. See annotations below for the details.{/if}
{#if !includeStackTraces}
> [!WARNING]
> Unable to include the stracktraces as the report was too long. See annotations below for the details.
{/if}
{#if !includeFailureLinks}
> [!WARNING]
> Unable to include the failure links as the report was too long. See annotations below for the details.
{/if}

{#for job in report.jobsWithReportedFailures}
### :gear: {job.name} {#if job.reportedFailures}<a href="#user-content-{job.failuresAnchor}" id="{job.failuresAnchor}">#</a>{/if}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
{#if report.cancelled}
:no_entry_sign: This build has been cancelled.
> [!NOTE]
> :no_entry_sign: This build has been cancelled.
{/if}
{#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.
> [!CAUTION]
> 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.jobsFailing}
## <a id="build-summary-top"></a>Failing Jobs - Building {report.sha} - [Back to {workflowContext.type}]({workflowContext.htmlUrl})

{#if !artifactsAvailable && !report.cancelled}:warning: Artifacts of the workflow run were not available thus the report misses some details.{/if}
{#if !artifactsAvailable && !report.cancelled}
> [!WARNING]
> Artifacts of the workflow run were not available thus the report misses some details.
{/if}

| Status | Name | Step | Failures | Logs | Raw logs | Build scan |
| :-: | -- | -- | :-: | :-: | :-: | :-: |
Expand All @@ -21,5 +27,7 @@
{/if}

{#if report.flakyTests}
:warning: This workflow run had flaky tests. See details for more information.
> [!WARNING]
> This workflow run had flaky tests. See details for more information.
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,27 @@
This is the status report for running `{report.workflowName}` on commit {report.sha}.

{#if report.cancelled}
:no_entry_sign: This workflow run has been cancelled.
> [!NOTE]
> :no_entry_sign: This build has been cancelled.
{/if}

{#if !includeStackTraces}:warning: Unable to include the stracktraces as the report was too long. See annotations below for the details.{/if}
{#if !includeFailureLinks}:warning: Unable to include the failure links as the report was too long. See annotations below for the details.{/if}
{#if !includeStackTraces}
> [!WARNING]
> Unable to include the stracktraces as the report was too long. See annotations below for the details.
{/if}
{#if !includeFailureLinks}
> [!WARNING]
> Unable to include the failure links as the report was too long. See annotations below for the details.
{/if}

{#if report.failure}
{#if !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.
> [!CAUTION]
> 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.
{#else}
## Failing Jobs

Expand All @@ -33,7 +44,8 @@ Full information is available in the [Build summary check run]({checkRun.htmlUrl
{#if develocityEnabled}{buildScansCheckRunMarker}{/if}

{#if report.errorDownloadingBuildReports}
:warning: Errors occurred while downloading the build reports. This report is incomplete.
> [!WARNING]
> Errors occurred while downloading the build reports. This report is incomplete.
{/if}

{#if report.reportedFailures}
Expand Down Expand Up @@ -88,7 +100,8 @@ Full information is available in the [Build summary check run]({checkRun.htmlUrl
It should be safe to merge provided you have a look at the other checks in the summary.

{#if hasOtherPendingCheckRuns}
:warning: There are other workflow runs running, you probably need to wait for their status before merging.
> [!WARNING]
> There are other workflow runs running, you probably need to wait for their status before merging.
{/if}
{#if develocityEnabled}{buildScansCheckRunMarker}{/if}
Expand Down

0 comments on commit b11c10b

Please sign in to comment.