jenkinsci / jenkinsci/github-checks-plugin

More descriptive Github checks log message

Open
#390 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Java
Stars
89
Forks
50
Avg merge
13h 55m
Merged PRs (30d)
7

Description

### What feature do you want to see added?

Currently, the status line that informs that the check is published looks like this:
```
[GitHub Checks] GitHub check (name: Jenkins, status: completed) has been published.
```
If the status is completed, it is also worth adding information about the conclusion (one of the values: `action_required`, `cancelled`, `failure`, `neutral`, `success`, `skipped`, `stale`, `timed_out`)
so log message will be as below:
```
[GitHub Checks] GitHub check (name: Jenkins, status: completed, conclusion: failure) has been published.
```

The code responsible for this:
https://github.com/jenkinsci/github-checks-plugin/blob/e9ce039f678d13bf665736571b6cca8432c838ba/src/main/java/io/jenkins/plugins/checks/github/GitHubChecksPublisher.java#L99
I have the impression that we just need to change the code as below, but I haven't checked that:
```diff
- buildLogger.log("GitHub check (name: %s, status: %s) has been published.", gitHubDetails.getName(),
- gitHubDetails.getStatus());
+ String conclusion = gitHubDetails.getConclusion();
+ if(conclusion != null) {
+ buildLogger.log("GitHub check (name: %s, status: %s, conclusion: %s) has been published.", gitHubDetails.getName(),
+ gitHubDetails.getStatus(), conclusion);
+ }else {
+ buildLogger.log("GitHub check (name: %s, status: %s) has been published.", +gitHubDetails.getName(),
+ gitHubDetails.getStatus());
+ }
+
```

### Upstream changes

_No response_

### Are you interested in contributing this feature?

Unfortunately no, because it is too complicated from the point of view of corporate procedures.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.