open-build-service icon indicating copy to clipboard operation
open-build-service copied to clipboard

Badge for github integration

Open weberhofer opened this issue 7 years ago • 7 comments

This is a feature request for a badge which shows the build-status on a github project. Would really be great!

weberhofer avatar Mar 27 '17 15:03 weberhofer

There are many ways to go about this:

  1. Build status of a project, which would be useful for packages that pull elements from many repositories
  2. Build status of a package, which would be useful for packages built from one source only
    • Do we count subpackages from multiple specs into it or should it be split per package?
  3. Build status of repository/architecture in the project for package, which would be the easiest to implement, considering it's a single status, not multiple statuses

How should it look?

  • A percentage of built statuses (works with 1&2) percent
  • A ratio of built statuses (works with 1&2) ratio
  • A symbolic representation of built statuses (works with all) symbol

Other concerns:

  • Should it mention OBS instance name?
  • Should it be made as a set of preset images or on demand (fairly easy to do considering that svg is just an xml document)

hellcp avatar Aug 18 '19 11:08 hellcp

There are many ways to go about this:

  1. Build status of a project, which would be useful for packages that pull elements from many repositories

  2. Build status of a package, which would be useful for packages built from one source only

    • Do we count subpackages from multiple specs into it or should it be split per package?
  3. Build status of repository/architecture in the project for package, which would be the easiest to implement, considering it's a single status, not multiple statuses

How should it look?

I like the images that you created, so like those ;-)

  • A percentage of built statuses (works with 1&2) percent

  • A ratio of built statuses (works with 1&2) ratio

  • A symbolic representation of built statuses (works with all) symbol

Other concerns:

  • Should it mention OBS instance name?

Imho not necessary, if you embed the badge so that it links to the respective view on that OBS instance, then that information is already available.

  • Should it be made as a set of preset images or on demand (fairly easy to do considering that svg is just an xml document)

dcermak avatar Nov 15 '19 09:11 dcermak

Hi, this feature is old, but still it would be very convenient to have... Any chance we get something like this? Where/how would this need to be placed? Are there some kind of "after build" trigger/service one can jump in and implement something modular?

Using rabbitmq might be an option, but yet another server/daemon instance is needed to wait for "build finish" events, etc...

watologo1 avatar Nov 11 '20 10:11 watologo1

Thomas Renninger [email protected] writes:

Hi, this feature is old, but still it would be very convenient to have...

Indeed it would.

Any chance we get something like this? Where/how would this need to be placed? Are there some kind of "after build" trigger/service one can jump in and implement something modular?

I think this could be done far simpler: the badge would be generated dynamically, essentially reusing the GET /build/////_status route. Instead of returning XML, one would render one of Stasiek's SVGs.

dcermak avatar Nov 11 '20 10:11 dcermak

I think this could be done far simpler: the badge would be generated dynamically, essentially reusing the GET /build/////_status route. Instead of returning XML, one would render one of Stasiek's SVGs.

Since this feature is not implemented yet, I just wanted to add building a package on obs to https://kmymoney.org/build.html.

For this I added a small help script to the listed page, which fetches the status from api.opensuse.org and should return a corresponding image.

Unfortunately, this doesn't work because api.opensuse.org expects authorization.

A minimal implementation for this feature, would then be an extension that makes a build status query available without authorization or with an access token.

rhabacker avatar Feb 28 '21 10:02 rhabacker

Another option outside obs would be to fetch the results from the obs project and to parse the build states. Unfortunally this also could not be done easily because the build results are embedded by fetching another url <div class='bg-light' data-buildresult-url='/package/buildresult' id='buildresult-urls'> using javascript, which only works in a full browser.

rhabacker avatar Feb 28 '21 19:02 rhabacker

Let me suggest an inspiration that seems relevant to me.

As in this example, repology.org provides multiple badges with metrics and individual repo versions, and also this matrix-badge :

Packaging status

thomaslepoix avatar Jul 26 '22 18:07 thomaslepoix