Skip to content

Commit

Permalink
Update schema check tool to include bug fix #3777 in Otel Go (#138)
Browse files Browse the repository at this point in the history
Pinned to specific commit 071d3173944553bed7d05057ecccb177d307978b of
https://github.com/open-telemetry/opentelemetry-go to update the schema check tool
to include the bug fix open-telemetry/opentelemetry-go#3777
(Fix incorrect "all" and "resource" definition for Schema File).
  • Loading branch information
tigrannajaryan committed Feb 27, 2023
1 parent 6baebe9 commit ae3320c
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 12 deletions.
10 changes: 5 additions & 5 deletions schemas/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ module github.com/open-telemetry/build-tools/schemas
go 1.17

require (
github.com/Masterminds/semver/v3 v3.1.1
github.com/stretchr/testify v1.7.1
go.opentelemetry.io/otel/schema v0.0.3-0.20220725153023-1eae91b3b099
github.com/Masterminds/semver/v3 v3.2.0
github.com/stretchr/testify v1.8.2
go.opentelemetry.io/otel/schema v0.0.4-0.20230227163841-071d31739445
)

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
20 changes: 13 additions & 7 deletions schemas/go.sum
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
github.com/Masterminds/semver/v3 v3.1.1 h1:hLg3sBzpNErnxhQtUy/mmLR2I9foDujNK030IGemrRc=
github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g=
github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
go.opentelemetry.io/otel/schema v0.0.3-0.20220725153023-1eae91b3b099 h1:XYbYk+7V0+q/gEY0tklw1wjqmeYwheXLGAHOfjPuC2I=
go.opentelemetry.io/otel/schema v0.0.3-0.20220725153023-1eae91b3b099/go.mod h1:SVJ5rsfaNzJ8JV++F7gwqRNRUCsISldY/YpcWSE+oT0=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
go.opentelemetry.io/otel/schema v0.0.4-0.20230227163841-071d31739445 h1:brgvH2KyQF4eINbYJdJTuOD0GgJsFRqPGLlKh0aGsAg=
go.opentelemetry.io/otel/schema v0.0.4-0.20230227163841-071d31739445/go.mod h1:LBBdyW+43YB5XmeQtH4b2ET5k0hx7dh3yJgRGY4Qw+A=
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.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
3 changes: 3 additions & 0 deletions schemas/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ func TestValidSchema(t *testing.T) {

err = loadSchemaFromFile("testdata/1.13.0-example", "1.13.0")
assert.NoError(t, err)

err = loadSchemaFromFile("testdata/rename-all-and-resource.example.yaml", "1.19.0")
assert.NoError(t, err)
}

func TestInvalidSchemas(t *testing.T) {
Expand Down
14 changes: 14 additions & 0 deletions schemas/testdata/rename-all-and-resource.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
file_format: 1.1.0
schema_url: https://opentelemetry.io/schemas/1.19.0
versions:
1.19.0:
all:
changes:
- rename_attributes:
attribute_map:
foo: bar
resources:
changes:
- rename_attributes:
attribute_map:
browser.user_agent: user_agent.original

0 comments on commit ae3320c

Please sign in to comment.