Change storage and common version files to emulate image's#867
Change storage and common version files to emulate image's#867TomSweeneyRedHat wants to merge 1 commit into
Conversation
|
I tried searching for version to see if these changes might mess up test, but ended up with a bazillion hits from grep. Let's see what the tests turn up. |
|
Packit jobs failed. @containers/packit-build please check. |
| // VersionMajor is for an API incompatible changes | ||
| VersionMajor = 0 | ||
| // VersionMinor is for functionality in a backwards-compatible manner | ||
| VersionMinor = 69 | ||
| // VersionPatch is for backwards-compatible bug fixes | ||
| VersionPatch = 0 | ||
|
|
||
| // VersionDev indicates development branch. Releases will be empty string. | ||
| VersionDev = "-dev" | ||
| ) |
There was a problem hiding this comment.
I do not care that much but personally I find a single string much much simpler than this unnecessary splitting
There was a problem hiding this comment.
As a general matter I dislike strings and especially string parsing, so providing numeric constants (which don’t take any runtime space) is nice.
[Running Sprintf at runtime, on every startup, is a bit less nice, but definitely not worth over-engineering to avoid.]
There was a problem hiding this comment.
As a general matter I dislike strings and especially string parsing, so providing numeric constants (which don’t take any runtime space) is nice.
[Running Sprintf at runtime, on every startup, is a bit less nice, but definitely not worth over-engineering to avoid.]
Well but this is the problem, you now end up with a non constant string.
A public string can be overwritten by anyone so now the API can be abused, unlikely that we would care but still.
There was a problem hiding this comment.
I’m a sucker for technically-interesting over-engineering, so:
0001-PROTOTYPE-Generate-a-version-string.patch
The generator would need to be moved elsewhere and shared across packages.
Is this really worthwhile, though? I’m leaning towards thinking this patch is best discarded.
There was a problem hiding this comment.
The generator would need to be moved elsewhere and shared across packages.
… and integrated into Makefile to keep the values up-to-date.
2df0dcf to
3a14eb1
Compare
Change the version file for c/common and c/storage to emulate the version file that is in c/image. This updates version/version.go in c/common, and moves the VERSION file in c/storage to version/version.go. Signed-off-by: Tom Sweeney <tsweeney@redhat.com>
3a14eb1 to
968ac67
Compare
mtrmac
left a comment
There was a problem hiding this comment.
ACK, but tests are failing.
Change the version file for c/common and c/storage to emulate the version file that is in c/image. This updates version/version.go in c/common, and moves the VERSION file in c/storage to version/version.go.