Search code examples
cloudbeesbuildhive

Is there a branch-specific badge icon?


I'm using BuildHive currently and displaying the embeddable build status icon in my README. More often than not, a pull-request fails to build and the status icon turns to red, whereas the master still is OK.

Travis-CI has per-branch build status images so I was wondering if BuildHive has something equivalent?


Solution

  • I think there is not. The question is probably broader than the status badge icon plugin. Jenkins has a linear build history, so SCM plugins like Git which support building from multiple branches (branchspec ** in this case) can start new builds but not really tell the core what they refer to. For example, a commonly used core option is to discard all but the last stable build, but this would be unreasonable if a branch were stable but master were not!

    It is possible a new API in Jenkins is needed so that the build history can be either formed into a tree mirroring the VCS graph—assuming enough historical builds have been retained for common ancestors to be shown—or more simply grouped into buckets according to branch name (and/or repository), with some way of automatically cleaning up obsolete buckets such as for merged pull requests.

    The matrix project type is actually close to this functionality already, but it is designed for running a number of predefined variants of a build in parallel, which is not quite right. (In fact you might well want to build all branches of a matrix project.)

    The upshot for BuildHive is that there seems to be nothing in Jenkins generally which would support the kind of feature you are asking for. It could perhaps implement branch-specific badges without general support, via a custom variant of the status badge icon plugin which also performed branch-sensitive build and artifact history trimming.