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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The next release will require at least [Go 1.25].
- Add `const Version` in `go.opentelemetry.io/contrib/detectors/azure/azurevm`. (#8553)
- Add `const Version` in `go.opentelemetry.io/contrib/processors/baggagecopy`. (#8557)
- Add `const Version` in `go.opentelemetry.io/contrib/detectors/aws/lambda`. (#8510)
- Add `const Version` in `go.opentelemetry.io/contrib/propagators/autoprop`. (#8488)

### Fixed

Expand Down
7 changes: 7 additions & 0 deletions propagators/autoprop/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package autoprop // import "go.opentelemetry.io/contrib/propagators/autoprop"

// Version is the current release version of the autoprop module.
const Version = "0.65.0"
24 changes: 24 additions & 0 deletions propagators/autoprop/version_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package autoprop_test

import (
"regexp"
"testing"

"github.com/stretchr/testify/assert"

"go.opentelemetry.io/contrib/propagators/autoprop"
)

// regex taken from https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
var versionRegex = regexp.MustCompile(`^(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-]+)*))?$`)

func TestVersionSemver(t *testing.T) {
v := autoprop.Version
assert.NotNil(t, versionRegex.FindStringSubmatch(v), "version is not semver: %s", v)
}
Loading