Commit based view of Jenkins builds
Asked Answered
F

1

14

I would like to be able to present a view of Jenkins builds similar to the buildbot console view. With Jenkins out of the box, there appears to be really no good way to associate a commit with a build. You have to access the specific built to determine what commit it was building.

I would like to be able to show status on what commits have been tested in a particular branch, so we know if a commit was skipped or if the latest commit has not yet been tested.

I tried using the Jenkins API for this, but I found that I could only see the SHA1 hash for a git commit via the build itself, i.e. via http://server/job/job-name/388/api/json. So, the only way I can see to take a commit and find builds for it is to iterate through every build in a job and retrieve its associated build info. This is certainly not going to be efficient and fast. Is there another way to do it?

Fair answered 25/5, 2012 at 21:30 Comment(2)
What does http://<jenkins-server>/job/<job-name>/changes say?Polymorphonuclear
That url has no associated api, and doesn't associate commits with builds. I assume I'll need to add support for this task to Jenkins, but I've left this question open until that happens.Fair
M
5

Imperfect Answer: put the "revision number" you care about in the package name of all related artifacts, and use the "fingerprint" feature.

For example: my "product package" artifacts have a revision number, and if I carried that through to the "test package" artifact (which includes the unpacked product artifact) you would be able to track that revision number via the "artifact/fingerprint" feature, and show which test jobs used it. Below, you can't tell with a single click which test used which "commit."

prod_fingerprint enter image description here

Mirthamirthful answered 19/12, 2012 at 0:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.