Update nightly builds to use Golang pseudo-version#125
Update nightly builds to use Golang pseudo-version#125docker-unir[bot] merged 1 commit intodocker:masterfrom
Conversation
|
|
||
| DATE_COMMAND="date" | ||
| if [[ $(uname) -eq "Darwin" ]]; then | ||
| DATE_COMMAND="docker run --rm alpine date" |
There was a problem hiding this comment.
Looks like this was because macOS date doesn't have --date="string"?
I replaced this for echo "datestring" | xargs date -d ....
There was a problem hiding this comment.
Argh; looks like that doesn't work on macOS after all 😕
| # the underlying commit, and the v0.0.0- prefix identifies the pseudo-version | ||
| # as a pre-release before version v0.0.0, so that the go command prefers any | ||
| # tagged release over any pseudo-version. | ||
| gitUnix="$($GIT_COMMAND log -1 --pretty='%ct')" |
There was a problem hiding this comment.
note: changed %at (author date) to %ct (committer date) - author date can be days in the past, i.e., not matching the date that the commit was merged
| gitDate="$(echo @${gitUnix} | xargs date +'%Y%m%d%H%M%S' -u -d)" | ||
| gitCommit="$($GIT_COMMAND log -1 --pretty='%h')" | ||
| debVersion="0.${gitDate}-${gitCommit}" | ||
| debVersion="0.0.0-${gitDate}-${gitCommit}" |
There was a problem hiding this comment.
IIUC; both deb and rpm don't expect the v prefix
| # $ dpkg --compare-versions 18.06.0-ce-rc3 gt 18.06.0-ce-rc2 && echo true || echo false | ||
| # true | ||
| # $ dpkg --compare-versions 18.06.0-ce gt 18.06.0-ce-rc2 && echo true || echo false | ||
| # false |
There was a problem hiding this comment.
Noticed this one; curious how we resolved that
There was a problem hiding this comment.
We add some magic sorting numbers at around line 30
There was a problem hiding this comment.
I honestly think we should just remove these comments in general, they haven't really been relevant for a while.
There was a problem hiding this comment.
Yeah, I ran them to verify the new version did what we expected
We should put this all in a function (looks like it's basically the same in deb, rpm and static) .. but that's for a follow-up
There was a problem hiding this comment.
I guess the comments are misleading since they don't accurately reflect the final outcome, but I like the idea of being able to see the functionality.
|
ping @seemethere @andrewhsu PTAL (please double-check; I tested it out-of-band in a shell) |
based on golang's pseudo-version: https://groups.google.com/forum/#!topic/golang-dev/a5PqQuBljF4 > using a "pseudo-version" of the form v0.0.0-yyyymmddhhmmss-abcdefabcdef, > where the time is the commit time in UTC and the final suffix is the prefix > of the commit hash. The time portion ensures that two pseudo-versions can > be compared to determine which happened later, the commit hash identifes > the underlying commit, and the v0.0.0- prefix identifies the pseudo-version > as a pre-release before version v0.0.0, so that the go command prefers any > tagged release over any pseudo-version. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
ee54823 to
d2baf8f
Compare
seemethere
left a comment
There was a problem hiding this comment.
LGTM, I'll need to check with our nightly build reaper to see if it works correctly with that but as far as this PR goes I think it should work.
|
P.S. I love your feature branch name @thaJeztah ❤️ |
LOL, should see some of my other ones 😂 |
jose-bigio
left a comment
There was a problem hiding this comment.
I am wondering what benefit we will have from using a pseudo-version?
From my understanding the benefit of a pseudo-version is that it would allow people to go get modules in a better fashion. However, this is changing deb and rpm packages to use pseudo-version.
Does this somehow make it easier for people to consume the nightly packages?
|
In response to my own comment catching up on: to better understand the need for this change. I was even cced on the discussion 🤦♂️ |
|
After reading the discussion my understanding is that we want to make this change because it could become a standard. I haven't really given much thought to whether one versioning scheme (the original) is better than the other, but am fine either way. My apologies for discussing this a little late, but wanted to talk about it before we brought it in. |
|
I think the big advantage is that it's valid semver and provides all the information that's needed (time committed, git sha); in addition to something becoming more of a standard (instead of a self-defined format) |
|
If we would not take this change; we should still merge the fix for the right commit date; currently I think it's possible we go back in time (ie a PR merged that was rebased, but authored a long time ago) |
|
documentation updates in docker/docs#7090 |
based on golang's pseudo-version: https://groups.google.com/forum/#!topic/golang-dev/a5PqQuBljF4