|Hudson Continuous Integration Server|
|Mailing List • Forums • IRC • mattermost|
|Open • Help Wanted • Bug Day|
|Tracking version using fingerprint feature|
When you have interdependent projects on Hudson. It often becomes hard to keep track of which version of this is used by which version of that. Hudson supports "file fingerprinting" to simplify this.
For example, suppose you have the TOP project that depends on the MIDDLE project, which in turn depends on the BOTTOM project. You are working on the BOTTOM project. The TOP team reported that bottom.jarthat they are using causes an NPE, which you thought you fixed in BOTTOM #32. Hudson can tell you which MIDDLE builds and TOP builds are using (or not using) your bottom.jar #32.
How do I set it up?
To make this work, all the relevant projects need to be configured to record fingerprints of the jar files (in this case, bottom.jar.)
For example, if you just want to track which BOTTOM builds are used by which TOP builds, configure TOP and BOTTOM to record bottom.jar. If you also want to know which MIDDLE builds are using which bottom.jar, also configure MIDDLE.
Since recording fingerprints is a cheap operation, the simplest thing to do is just blindly record all fingerprints of the followings:
- jar files that your project produce
- jar files that your project rely on
The disk usage is affected more by the number of files fingerprinted, as opposed to the size of files or the number of builds they are used. So unless you have a plenty of disk space, you don't want to fingerprint "*/".
How does it work?
The fingerprint of a file is simply a MD5 checksum. Hudson maintains a database of md5sum, and for each md5sum, Hudson records which builds of which projects used. This database is updated every time a build runs and files are fingerprinted.
To avoid the excessive disk usage, Hudson does not store the actual file. Instead, it just stores md5sum and their usages. These files can be seen in $HUDSON_HOME/fingerprints.
How can I use it?
Here is a few typical scenarios that benefit from this feature:
You develop the BOTTOM project and you want to know who is using BOTTOM #13 in which builds
- Go to BOTTOM #13 build page.
- Click the "fingeprint" icon of bottom.jar in the build artifacts
- You'll see all the projects and builds that uses it.
You develop the TOP project and you want to know which build of bottom.jar and middle.jar you are using in TOP #10.
- Go to TOP #10 build page.
- Click "see fingerprints"
- You'll see all the files fingerprinted in TOP #10, along with where they came from.
You have the TOP project that builds a jar. You also have the TOP-TEST project that runs after the TOP project and does extensive integration tests on the latest TOP bits. You want to know the test results of TOP #7.
- Go to TOP #7 build page.
- Click the "fingeprint" icon of top.jar in the build artifacts
- You'll see all the TOP-TEST builds that used it.
- Click it and you'll be taken to the appropriate TOP-TEST build page, which will show you test reports.
- If there's no TOP-TEST builds displayed, then that means TOP-TEST build didn't run against TOP #7. Maybe it skipped TOP #7 (this can happen if there are a lot of TOP builds in a short period of time), or maybe a new TOP-TEST build is in progress.