Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Fetch tags
Comment thread
joe-elliott marked this conversation as resolved.
run: git fetch --prune --unshallow --tags
- name: Set up Go
uses: actions/setup-go@v5
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## main / unreleased

* [ENHANCEMENT] Send semver version in api/stattus/buildinfo for cloud deployments [#4110](https://github.com/grafana/tempo/pull/4110) [@Aki0x137]
* [ENHANCEMENT] Speedup tempo-query trace search by allowing parallel queries [#4159](https://github.com/grafana/tempo/pull/4159) (@pavolloffay)
* [CHANGE] tempo-cli: add support for /api/v2/traces endpoint [#4127](https://github.com/grafana/tempo/pull/4127) (@electron0zero)
**BREAKING CHANGE** The `tempo-cli` now uses the `/api/v2/traces` endpoint by default,
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ help: ## Display this help
.DEFAULT_GOAL:=help

# Version number
VERSION=$(shell ./tools/image-tag | cut -d, -f 1)
VERSION=$(shell ./tools/version-tag.sh | cut -d, -f 1)

GIT_REVISION := $(shell git rev-parse --short HEAD)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
Expand Down
6 changes: 6 additions & 0 deletions integration/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,12 @@ func CallBuildinfo(t *testing.T, svc *e2e.HTTPService) {
_, ok := jsonResponse[key]
require.True(t, ok)
}

version, ok := jsonResponse["version"].(string)
require.True(t, ok)
semverRegex := `^v?(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$`
require.Regexp(t, semverRegex, version)

defer res.Body.Close()
}

Expand Down
27 changes: 27 additions & 0 deletions tools/version-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -o errexit
set -o nounset
set -o pipefail

REPO_ROOT=$(git rev-parse --show-toplevel)

is_valid_semver() {
local version=$1
# regex taken from https://semver.org/
if [[ $version =~ ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ ]] ;then
return 1
else
return 0
fi
}


VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
if is_valid_semver "$VERSION"; then
echo "$VERSION"
exit 0
fi


source "${REPO_ROOT}/tools/image-tag"