Coder Social home page Coder Social logo

Comments (7)

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on July 19, 2024 1

There are a few possible improvements:

  • Add public void applyTo(ChecksDetails) to ChecksInfo and make consumers call that instead of copying the name themselves. This would let later versions of checks-api-plugin add features to ChecksInfo without always needing more changes in consumers.
  • Give StepContext or just StepContext::get as a parameter to ChecksPublisherFactory.createPublisher. This would let implementing plugins define pipeline steps that add SCM-specific info types to the context, and then look them up when publishing. This would belong in ChecksPublisherFactory rather than ChecksPublisher, so that the SCM-specific info could include API endpoints etc. and make the ChecksPublisherFactory eligible even if it would not otherwise be.

I should file separate requests for those, I guess.

from checks-api-plugin.

XiongKezhi avatar XiongKezhi commented on July 19, 2024

do you mean the actions in GitHub checks API? And when you click on that button, a request from GitHub will be sent to your Jenkins? May I ask what are you going to use it for?

from checks-api-plugin.

tallen1983 avatar tallen1983 commented on July 19, 2024

@XiongKezhi yes, I actually meant to put this on jenkinsci/github-checks-plugin (I had both tabs open). Oops.

There could be any number of reasons to add actions. Perhaps someone builds debug by default as a PR check, but sometimes they want a release build (or vice versa). Maybe it annotated a couple lines which can be auto-fixed with a "Fix these" action, etc.

from checks-api-plugin.

XiongKezhi avatar XiongKezhi commented on July 19, 2024

I'm planning to implement this, along with #28.

But the only thing we can do is no more than exposing the API to add action buttons, the handlers/subscribers for those actions still need the implementation from the users themselves, like https://github.com/jenkinsci/github-checks-plugin/blob/master/src/main/java/io/jenkins/plugins/checks/github/CheckRunGHEventSubscriber.java.

from checks-api-plugin.

KalleOlaviNiemitalo avatar KalleOlaviNiemitalo commented on July 19, 2024

A use case that may be relevant:

I have a Jenkins job that builds HTML documentation and publishes it to a web server (as opposed to having Jenkins serve it). I'd like to post the web server address to the SCM system as part of a checks report, so that I can browse to it without going through Jenkins. However, the SCM is not GitHub and does not support Markdown in the report. Instead, it supports links that have a title and a URL. If I could have the Jenkinsfile generate the web site URL and publish that via Checks API as if it were an action, then that would be cool. Thus, I hope that the actions API being added will allow URLs that do not point to Jenkins.

It would be even better if I could make the link part of the checks report that is already published by another plugin, rather than a separate report. I imagine the withChecks step could be changed to take links as an argument. With the current Checks API though, it seems this would require changing the consumer plugins such as Warnings NG as well, because implementations of ChecksPublisher cannot discover ChecksInfo themselves.

from checks-api-plugin.

XiongKezhi avatar XiongKezhi commented on July 19, 2024

... Instead, it supports links that have a title and a URL ... Thus, I hope that the actions API being added will allow URLs that do not point to Jenkins.

If only considering GitHub, this is not possible. The action for GitHub is just adding buttons to the checks report and used for users to require additional behavior that is pre-defined in Jenkins. But since we are now at the API level and as you said, the SCM is not GitHub, so we can discuss and define a wider-scoped API (not only in this action part) for users if we can have a better abstraction beyond the GitHub one.

I imagine the withChecks step could be changed to take links as an argument. With the current Checks API though, it seems this would require changing the consumer plugins such as Warnings NG as well, because implementations of ChecksPublisher cannot discover ChecksInfo themselves.

This could be done, and yes, this requires changes of the consumers. But if we want to forcefully change the link published by consumers, maybe we need another step, since it's not our purpose of the withChecks.

from checks-api-plugin.

XiongKezhi avatar XiongKezhi commented on July 19, 2024

The basic functionality to add action buttons is fixed by #85.

from checks-api-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.