Skip to content
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

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

mem
Copy link
Contributor

@mem mem commented Aug 30, 2024

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.

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>
@mem mem requested a review from a team as a code owner August 30, 2024 21:34
Copy link
Member

@nadiamoe nadiamoe left a 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.

scripts/generate-tags Show resolved Hide resolved
# 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
Copy link
Contributor

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:

@mem mem merged commit 51a4e2f into main Sep 4, 2024
2 checks passed
@mem mem deleted the mem/output-unadorned-version-tag-for-releases branch September 4, 2024 22:14
nadiamoe added a commit that referenced this pull request Sep 19, 2024
* 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>
@nadiamoe nadiamoe mentioned this pull request Sep 19, 2024
nadiamoe added a commit that referenced this pull request Sep 19, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants