What Makes Version Information Useful?
Here are the things we wanted from version information:- Determine if two builds come from the same source (even if built on different machines, at different times).
- Easily find the code associated with a particular build.
- Easily determine approximately how old a build is; compare age of versions.
- Provide an easy mechanism for the user to tell different versions of builds apart.
A Decent Solution
After a bit of messing around with our build system and our source control tools, we ended up using these 4 values as our “version” information:- Commit Hash – Makes it trivial to figure out the source that the build is derived from. If you were using a SVN or something, you could use your repo path and revision instead.
- Most Recent Tag – Not necessary, but nice for applying traceable easily-human-readable version numbers. Any code built from a commit after the tag would have this.
- A Local Changes Flag – Indicates if there are uncommitted changes that are not reflected in the commit hash, which would also indicate that this is unsafe for production use.
- Change Date – If local changes is false, this is the date-time of the commit, otherwise it is the date-time at the start of the build.
Комментариев нет:
Отправить комментарий