From 9dd678a87e4539c19fa551eb0560793ab8ffc0b9 Mon Sep 17 00:00:00 2001 From: Tyler Mace Date: Wed, 4 Oct 2023 10:13:12 -0700 Subject: [PATCH] Issue-361: Add prudent information about a publishing of checks. --- .../plugins/checks/github/GitHubChecksPublisher.java | 9 ++++++--- .../checks/github/GitHubChecksPublisherITest.java | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/jenkins/plugins/checks/github/GitHubChecksPublisher.java b/src/main/java/io/jenkins/plugins/checks/github/GitHubChecksPublisher.java index 72665956..a2c50636 100644 --- a/src/main/java/io/jenkins/plugins/checks/github/GitHubChecksPublisher.java +++ b/src/main/java/io/jenkins/plugins/checks/github/GitHubChecksPublisher.java @@ -96,9 +96,12 @@ public void publish(final ChecksDetails details) { context.addActionIfMissing(run.getId(), gitHubDetails.getName()); - buildLogger.log("GitHub check (name: %s, status: %s) has been published.", gitHubDetails.getName(), - gitHubDetails.getStatus()); - SYSTEM_LOGGER.fine(format("Published check for repo: %s, sha: %s, job name: %s, name: %s, status: %s", + buildLogger.log("GitHub check (name: %s, status: %s, url: %s) has been published.", + gitHubDetails.getName(), + gitHubDetails.getStatus(), + gitHub.getApiUrl()); + SYSTEM_LOGGER.fine(format("Published check for url: %s, repo: %s, sha: %s, job name: %s, name: %s, status: %s", + gitHub.getApiUrl(), context.getRepository(), context.getHeadSha(), context.getJob().getFullName(), diff --git a/src/test/java/io/jenkins/plugins/checks/github/GitHubChecksPublisherITest.java b/src/test/java/io/jenkins/plugins/checks/github/GitHubChecksPublisherITest.java index b09a00c8..a831268b 100644 --- a/src/test/java/io/jenkins/plugins/checks/github/GitHubChecksPublisherITest.java +++ b/src/test/java/io/jenkins/plugins/checks/github/GitHubChecksPublisherITest.java @@ -245,6 +245,7 @@ public void shouldLogChecksParametersIfExceptionHappensWhenPublishChecks() { assertThat(loggerRule.getMessages().get(0)) .contains("Failed Publishing GitHub checks: ") .contains("name='Jenkins'") + .contains("url=foobar") .contains("status=COMPLETED") .contains("conclusion=SUCCESS") .contains("title='Jenkins Check'")