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

added version.go and test file for issue 2143 #3677

Merged
merged 31 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9ef3922
added version.go and test file for issue 2143
ChillOrb Feb 5, 2023
617f3f8
Merge branch 'main' into main
hanyuancheung Feb 6, 2023
f67ff81
added license in metric versiont_test
ChillOrb Feb 6, 2023
a900c28
goimport file linting
ChillOrb Feb 8, 2023
02e3141
Merge pull request #1 from ChillOrb/dev
ChillOrb Feb 8, 2023
debc6bd
Merge branch 'main' into main
ChillOrb Feb 8, 2023
87ba255
Merge branch 'main' into main
ChillOrb Feb 9, 2023
707fce6
Merge branch 'open-telemetry:main' into main
ChillOrb Feb 10, 2023
18f659f
update trace version to v.1.13.0 and metric to 0.36.0
ChillOrb Feb 12, 2023
e1da578
Merge branch 'main' into main
ChillOrb Feb 18, 2023
450b70c
Update sdk/metric/version.go
ChillOrb Feb 21, 2023
4ad58dc
using asser.Regxp
ChillOrb Feb 21, 2023
4d51324
changing regex string as per recommendations
ChillOrb Feb 22, 2023
f2f52dc
Merge branch 'main' into main
ChillOrb Feb 22, 2023
65b4e33
changing regex string as per recommendations
ChillOrb Feb 22, 2023
9705f8f
reverting go mod and go sum changes
ChillOrb Feb 25, 2023
b581ce0
Merge branch 'main' into main
ChillOrb Feb 25, 2023
7e75dc2
Merge branch 'main' into main
ChillOrb Feb 27, 2023
ebc67e9
Merge branch 'main' into main
ChillOrb Feb 28, 2023
7a09571
trace and metric version bump up
ChillOrb Feb 28, 2023
b0db435
Merge branch 'main' into main
ChillOrb Mar 2, 2023
7462b4a
Merge branch 'open-telemetry:main' into main
ChillOrb Mar 4, 2023
7d3799e
version update in sdk/metric , sdk/trace
ChillOrb Mar 4, 2023
96dc693
Merge branch 'open-telemetry:main' into main
ChillOrb Mar 7, 2023
aecaa1a
Merge branch 'open-telemetry:main' into main
ChillOrb Mar 8, 2023
9fff3bb
doc typo fix
ChillOrb Mar 8, 2023
7756059
Merge branch 'main' into main
ChillOrb Mar 9, 2023
7244952
Merge branch 'open-telemetry:main' into main
ChillOrb Mar 19, 2023
3b1bb72
Apply suggestions from code review
MrAlias May 9, 2023
d8c68af
Merge branch 'main' into main
MrAlias May 9, 2023
847d7ac
Merge branch 'main' into main
MrAlias May 9, 2023
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: 1 addition & 1 deletion sdk/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ require (
github.com/go-logr/logr v1.2.3
github.com/google/go-cmp v0.5.9
github.com/stretchr/testify v1.8.1
golang.org/x/sys v0.4.0
pellared marked this conversation as resolved.
Show resolved Hide resolved
go.opentelemetry.io/otel v1.13.0
go.opentelemetry.io/otel/trace v1.13.0
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8
)

require (
Expand Down
4 changes: 2 additions & 2 deletions sdk/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8 h1:h+EGohizhe9XlX18rfpa8k8RAc5XyaeamM+0VHRd4lc=
golang.org/x/sys v0.0.0-20220919091848-fb04ddd9f9c8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.4.0 h1:Zr2JFtRQNX3BCZ8YtxRE9hNJYC8J6I1MVbMg6owUp18=
golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
20 changes: 20 additions & 0 deletions sdk/metric/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package metric // import "go.opentelemetry.io/otel/sdk/metric"

// version is the current release version of the metric SDK in use.
func version() string {
pellared marked this conversation as resolved.
Show resolved Hide resolved
return "v0.35.0"
}
32 changes: 32 additions & 0 deletions sdk/metric/version_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package metric

import (
"regexp"
"testing"

"github.com/stretchr/testify/assert"
)

// regex taken from https://github.com/Masterminds/semver/tree/v3.1.1
var versionRegex = regexp.MustCompile(`^v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` +
pellared marked this conversation as resolved.
Show resolved Hide resolved
`(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` +
`(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?$`)

func TestVersionSemver(t *testing.T) {
v := version()
assert.NotNil(t, versionRegex.FindStringSubmatch(v), "version is not semver: %s", v)
pellared marked this conversation as resolved.
Show resolved Hide resolved
}
20 changes: 20 additions & 0 deletions sdk/trace/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package trace // import "go.opentelemetry.io/otel/sdk/metric"
ChillOrb marked this conversation as resolved.
Show resolved Hide resolved

// version is the current release version of the metric SDK in use.
func version() string {
return "v1.12.0"
}
31 changes: 31 additions & 0 deletions sdk/trace/version_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package trace

import (
"regexp"
"testing"

"github.com/stretchr/testify/assert"
)

var versionRegex = regexp.MustCompile(`^v?([0-9]+)(\.[0-9]+)?(\.[0-9]+)?` +
`(-([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?` +
`(\+([0-9A-Za-z\-]+(\.[0-9A-Za-z\-]+)*))?$`)

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