jenkinsci / checks-api-plugin

Jenkins plugin that defines an API for Jenkins to publish checks to SCM platforms.
https://plugins.jenkins.io/checks-api/
MIT License
42 stars 28 forks source link

Message "[Checks API] No suitable checks publisher found." started to appear in pipeline console output #38

Closed vladaurosh closed 3 years ago

vladaurosh commented 3 years ago

Hello. I've updated jenkins plugins today and looks like some of Pipeline plugins installed Checks API Plugin (version 1.0.2), which I didn't have installed. Now in console output of pipeline jobs I see messages "[Checks API] No suitable checks publisher found." after I use git, and second time at the very end of pipeline. Pipelines work fine, I just get these messages.

Is there any way to suppress these messages, at least as an option?

XiongKezhi commented 3 years ago

Which plugin are you using? Currently, there are warnings-ng and code-coverage plugins are using the checks-api plugin, and they all provide configurations to skip publishing checks. E.g, for warning-ng plugins: https://github.com/jenkinsci/warnings-ng-plugin/blob/master/doc/Documentation.md#warnings-checks-for-github-projects

vladaurosh commented 3 years ago

Hello. I do not have any of those 2 plugins. I can provide full list of plugins installed if that would help. My pipeline is scripted pipeline where I have something like this stage('SOURCE') { git credentialsId: 'xxxxx', branch: "some_branch", url:"some_url" } After git command I get "[Checks API] No suitable checks publisher found."

After that stage I have stage where I build app using maven but I am not getting that message in that stage. And at the very end I have this (all stages are finished):

[Checks API] No suitable checks publisher found. Finished: SUCCESS

XiongKezhi commented 3 years ago

Check if you have installed the checks-api-plugin, just uninstall it.

vladaurosh commented 3 years ago

I do have it, but it was installed as dependency for some plugins that I updated (not installed) this morning. These were updated (or installed as dependency) this morning: timestamper.jpi junit.jpi checks-api.jpi credentials-binding.jpi workflow-step-api.jpi

But I can't uninstall it, it is greyed out.

checks api

vladaurosh commented 3 years ago

Looks like JUnit plugin has Check API plugin as dependency. https://plugins.jenkins.io/junit/#dependencies

XiongKezhi commented 3 years ago

junit plug-in started use this API: https://github.com/jenkinsci/junit-plugin/pull/180

vladaurosh commented 3 years ago

Yeah I just saw this: 1.39 Released: 2 days ago 🚀 New features and improvements Checks API integration (#180) @timja

phoenix384 commented 3 years ago

This does not only affect console output of pipeline jobs. Every classic freestyle job also has this message in its console output.

vladaurosh commented 3 years ago

Hello. I see that 1.0.3 update is ready, but looks like this change is not there yet?

XiongKezhi commented 3 years ago

Yes, that's daily dependencies update. This change will be merged soon, only tests are left.

chess-levin commented 3 years ago

We have the same "problem" that junit-plugin prints "[Checks API] No suitable checks publisher found." We are using version 1.0.3 of checks-api-plugin and it is a dependency of junit-plugin. Is there some progress on this issue? How do we get rid of this log output "[Checks API] No suitable checks publisher found." ?

XiongKezhi commented 3 years ago

Just released: https://github.com/jenkinsci/checks-api-plugin/releases/tag/v1.1.0. This should have solved this problem,

kad-meedel commented 3 years ago

I am running version 1.2.0 of the checks-api now, but stil get the messages "[Checks API] No suitable checks publisher found." in the console logs. Is there any thing else to configure to 'suppress' these messages?

XiongKezhi commented 3 years ago

I am running version 1.2.0 of the checks-api now, but stil get the messages "[Checks API] No suitable checks publisher found." in the console logs. Is there any thing else to configure to 'suppress' these messages?

Are you using any consumer plugins of this API (e.g. warnings-ng, junit, or code-coverage)?

kad-meedel commented 3 years ago

We have the junit plugin installed, but I am not using this in my jenkins job. This is a 'simple' pipeline job. The message is shown after a git checkout and at the end of the pipeline job.

uhafner commented 3 years ago

Isn't our listener independent of any consumer? That means the message will be written out for every job.

XiongKezhi commented 3 years ago

Isn't our listener independent of any consumer? That means the message will be written out for every job.

it's independent, but if using a consumer plugin like warnings-ng (without implementation), we'll also see that message. I'm just to make sure it comes from the listener.

XiongKezhi commented 3 years ago

@kad-meedel Does your Jenkins install the github checks plugin? I seem to have found a problem, but not sure if that's your case.

kad-meedel commented 3 years ago

We do not have a separate install of the github-checks or the checks-api plugin. I think one of the other plugins has checks-api plugin as an dependencie! Pipeline: step api fore instance.

kad-meedel commented 3 years ago

We do have an installation of the GitHub Branch Source pugin. This one has an dependency with github checks

XiongKezhi commented 3 years ago

We do have an installation of the GitHub Branch Source pugin. This one has an dependency with github checks

I may need your double-check for it?

our github checks plugin do dependent on github branch source plugin, but not the other way around, see https://github.com/jenkinsci/github-checks-plugin/blob/f9c6e9691269729540b5d94243597a15f89fa05b/pom.xml#L89

kad-meedel commented 3 years ago

Yes you are right. And we do not install the github checks plugin. So what would than be the trigger?

uhafner commented 3 years ago

https://github.com/jenkinsci/checks-api-plugin/blob/bb070c651870fff42e128af7ce80f18ffde3a870/src/main/java/io/jenkins/plugins/checks/status/BuildStatusChecksPublisher.java#L124

XiongKezhi commented 3 years ago

The message is shown after a git checkout and at the end of the pipeline job.

According to your description, it looks like something goes wrong with our the status checks feature although we have carefully designed it not to publish status checks when no implementation is installed. But I can't reproduce it: I deleted the github-checks and runs a template pipeline job, nothing related in its log, however.

pipeline {
    agent any

    stages {
        stage('Build') {
            steps {
                // Get some code from a GitHub repository
                git 'https://github.com/jenkins-checks-api-test/codingstyle'

                // Run Maven on a Unix agent.
                sh "mvn -Dmaven.test.failure.ignore=true clean verify"
            }

            post {
                // If Maven was able to run the tests, even if some of the test
                // failed, record the test results and archive the jar file.
                success {
                    archiveArtifacts 'target/*.jar'
                }
            }
        }
    }
}

Can you simply replay it or create a job to test it and show me the log? Or can you show me your script (you can filter the sensitive information)?

XiongKezhi commented 3 years ago

https://github.com/jenkinsci/checks-api-plugin/blob/bb070c651870fff42e128af7ce80f18ffde3a870/src/main/java/io/jenkins/plugins/checks/status/BuildStatusChecksPublisher.java#L124

That's not the problem if not installing the github-checks, since no properties implementation exists at all (other than the default one which is not applicable to any jobs): https://github.com/jenkinsci/checks-api-plugin/blob/bb070c651870fff42e128af7ce80f18ffde3a870/src/main/java/io/jenkins/plugins/checks/status/AbstractStatusChecksProperties.java#L40

kad-meedel commented 3 years ago

I have run the pipeline script as you mentioned. I only included the mvn tool in the code. ( is not a default implementation ) jenkins-checks-testrun.txt

kad-meedel commented 3 years ago

In a 'simple' pipeline job the message is gone. In a 'simple' jenkins project the message is stil there.

mcascone commented 3 years ago

For what it's worth to anyone coming here now, I added skipPublishingChecks: true to skip this troublesome part. It appears to have been added here (linked PRs in the right column) although i found it first in the plugin's docs.

I know that our Enterprise GitHub is getting build status updates from Jenkins, so those checks are being published some other way, and I was ok to remove this one.

junit testResults: 'results.xml', skipPublishingChecks: true
ap200027 commented 1 year ago

Check if you have installed the checks-api-plugin, just uninstall it.

how??