-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output unadorned version tag for releases #862
Conversation
There's stuff out there with pretty weird ideas as to what constitutes a "correct" version number. We have been trying to solve this problem of "incorrect versioning" for over 30 years with no success. You have to wonder why that is. For the specific case of releases, in addition to using vX.Y.Z-0-sha, also output a vX.Y.Z tag. That allows stuff to be happy about seeing something that matches its expectations in terms of version numbers. We still need to output something else in the n != 0 case, because we need to be able to differentiate between intermediate builds. It's incorrect in semver terms, because those are prereleases that sort _before_ vX.Y.Z, not after it. To do it correctly, we would have to transform vX.Y.Z to vX.Y.(Z+1) and append the prerelease bit to that. Since that would become confusing really fast (in the face of existing practice), let's not do that. As long as nothing tries to "upgrade" vX.Y.Z-n-sha to vX.Y.Z, we shoud be OK. Signed-off-by: Marcelo E. Magallon <marcelo.magallon@grafana.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach looks good to me. Just want to double-check we want to drop the hash from the output of the version script.
# If an optional suffix is provided, append it to all the tags as `-suffix`. | ||
# Note that this breaks the semver format, because appending -foobar means it's | ||
# a pre-release version, not a "flavor" as some people claim. The more | ||
# appropriate way to express this would be to use `+suffix`, but we'll defer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commenting to add further context - Docker tags don't support +
in the character set currently:
* Update module github.com/prometheus/common to v0.58.0 * Output unadorned version tag for releases (#862) * Update debian:stable-slim Docker digest to 64bc71f (#867) * Update module github.com/prometheus/client_golang to v1.20.3 (#869) * Update module github.com/prometheus/common to v0.59.1 (#870) * Update module golang.org/x/net to v0.29.0 * Update alpine:3.20 Docker digest to beefdbd (#874) * Update github.com/grafana/loki/pkg/push digest to 0780456 (#876) * Update golang.org/x/exp digest to e7e105d (#877) * Update renovatebot/github-action action to v40.2.8 * scripts: update go to 1.23 * Update module google.golang.org/grpc to v1.66.1 (#884) * Update module google.golang.org/grpc to v1.66.2 (#885) * Move browser Docker build into separate Dockerfile (#886) * Stop publishing browser image to GCR (#888) * Update grafana-build-tools to 0.23.1 (#889) * Migrate base image from Debian to Alpine (#875) * k6runner: error if script timeout is not set * scraper: use check frequency as the context deadline for k6 checks * scraper/test: work around panic if all settings are nil in test * k6runner/http: override only logger in WithLogger * k6runner/http: retry requests * k6runner: promote log messages surfacing errors to warning level * Update renovatebot/github-action action to v40.2.10 (#891) * Update module github.com/prometheus/client_golang to v1.20.4 (#893) * scripts/go: update gosec to v2 proper * Update module github.com/mccutchen/go-httpbin/v2 to v2.15.0 Signed-off-by: Nadia Santalla <nadia@santalla.io>
* Update module github.com/prometheus/common to v0.58.0 * Output unadorned version tag for releases (#862) * Update debian:stable-slim Docker digest to 64bc71f (#867) * Update module github.com/prometheus/client_golang to v1.20.3 (#869) * Update module github.com/prometheus/common to v0.59.1 (#870) * Update module golang.org/x/net to v0.29.0 * Update alpine:3.20 Docker digest to beefdbd (#874) * Update github.com/grafana/loki/pkg/push digest to 0780456 (#876) * Update golang.org/x/exp digest to e7e105d (#877) * Update renovatebot/github-action action to v40.2.8 * scripts: update go to 1.23 * Update module google.golang.org/grpc to v1.66.1 (#884) * Update module google.golang.org/grpc to v1.66.2 (#885) * Move browser Docker build into separate Dockerfile (#886) * Stop publishing browser image to GCR (#888) * Update grafana-build-tools to 0.23.1 (#889) * Migrate base image from Debian to Alpine (#875) * k6runner: error if script timeout is not set * scraper: use check frequency as the context deadline for k6 checks * scraper/test: work around panic if all settings are nil in test * k6runner/http: override only logger in WithLogger * k6runner/http: retry requests * k6runner: promote log messages surfacing errors to warning level * Update renovatebot/github-action action to v40.2.10 (#891) * Update module github.com/prometheus/client_golang to v1.20.4 (#893) * scripts/go: update gosec to v2 proper * Update module github.com/mccutchen/go-httpbin/v2 to v2.15.0 Signed-off-by: Nadia Santalla <nadia@santalla.io>
There's stuff out there with pretty weird ideas as to what constitutes a "correct" version number. We have been trying to solve this problem of "incorrect versioning" for over 30 years with no success. You have to wonder why that is.
For the specific case of releases, in addition to using vX.Y.Z-0-sha, also output a vX.Y.Z tag. That allows stuff to be happy about seeing something that matches its expectations in terms of version numbers. We still need to output something else in the n != 0 case, because we need to be able to differentiate between intermediate builds. It's incorrect in semver terms, because those are prereleases that sort before vX.Y.Z, not after it. To do it correctly, we would have to transform vX.Y.Z to vX.Y.(Z+1) and append the prerelease bit to that. Since that would become confusing really fast (in the face of existing practice), let's not do that. As long as nothing tries to "upgrade" vX.Y.Z-n-sha to vX.Y.Z, we shoud be OK.