File tree Expand file tree Collapse file tree 4 files changed +64
-4
lines changed
src/OpenTelemetry.SemanticConventions/scripts Expand file tree Collapse file tree 4 files changed +64
-4
lines changed Original file line number Diff line number Diff line change 1+ name : Semantic Conventions - validate
2+
3+ on :
4+ pull_request :
5+ paths :
6+ - " src/OpenTelemetry.SemanticConventions/**"
7+
8+ jobs :
9+ run-dotnet-format :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : check out code
14+ uses : actions/checkout@v4
15+
16+ - name : Check script versions
17+ shell : pwsh
18+ run : .\build\scripts\check-semconv-versions.ps1
19+
20+ - name : Generate semantic conventions
21+ working-directory : src\OpenTelemetry.SemanticConventions
22+ shell : pwsh
23+ run : |
24+ .\scripts\generate.ps1
25+
26+ - name : Verify no changes
27+ working-directory : src\OpenTelemetry.SemanticConventions
28+ run : |
29+ git diff --exit-code '.' || (echo 'Manual changes to Semantic Convention attributes are not allowed. Please re-generate the files and commit.' && exit 1)
Original file line number Diff line number Diff line change 1+
2+ $rootDirectory = Get-Location
3+
4+ $PowerShellScript = " $ ( $rootDirectory ) \src\OpenTelemetry.SemanticConventions\scripts\generate.ps1"
5+ $BashScript = " $ ( $rootDirectory ) \src\OpenTelemetry.SemanticConventions\scripts\generate.sh"
6+
7+ # PS semconv version
8+ $PsSemConvVersion = Select-String - Path $PowerShellScript - Pattern ' \$SEMCONV_VERSION="([^"]+)"' | ForEach-Object { $_.Matches.Groups [1 ].Value }
9+ # PS weaver version
10+ $PsWeaverVersion = Select-String - Path $PowerShellScript - Pattern ' \$GENERATOR_VERSION="([^"]+)"' | ForEach-Object { $_.Matches.Groups [1 ].Value }
11+
12+ # Bash semconv version
13+ $BashSemConvVersion = Select-String - Path $BashScript - Pattern ' SEMCONV_VERSION="([^"]+)"' | ForEach-Object { $_.Matches.Groups [1 ].Value }
14+ # Bash weaver version
15+ $BashWeaverVersion = Select-String - Path $BashScript - Pattern ' SEMCONV_VERSION="([^"]+)"' | ForEach-Object { $_.Matches.Groups [1 ].Value }
16+
17+ # Check if the semconv versions match
18+ if ($PsSemConvVersion -ne $BashSemConvVersion ) {
19+ Write-Host " Semantic Convention version mismatch detected!"
20+ Write-Host " PowerShell version: $PsSemConvVersion "
21+ Write-Host " Bash version: $BashSemConvVersion "
22+ exit 1
23+ }
24+
25+ # Check if the weaver versions match
26+ if ($PsWeaverVersion -ne $BashWeaverVersion ) {
27+ Write-Host " Weaver version mismatch detected!"
28+ Write-Host " PowerShell version: $PsWeaverVersion "
29+ Write-Host " Bash version: $BashWeaverVersion "
30+ exit 1
31+ }
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ $SCRIPT_DIR = $PSScriptRoot
22$ROOT_DIR = " ${SCRIPT_DIR} /../"
33
44# freeze the spec version to make SemanticAttributes generation reproducible
5- $SEMCONV_VERSION = " 1.26.0"
6- $GENERATOR_VERSION = " v0.9.2"
5+ $SEMCONV_VERSION = " 1.26.0"
6+ $GENERATOR_VERSION = " v0.9.2"
77
88Set-Location $SCRIPT_DIR
99
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55ROOT_DIR=" ${SCRIPT_DIR} /../"
66
77# freeze the spec version to make SemanticAttributes generation reproducible
8- SEMCONV_VERSION=1.26.0
9- GENERATOR_VERSION=v0.9.2
8+ SEMCONV_VERSION=" 1.26.0"
9+ GENERATOR_VERSION=" v0.9.2"
1010
1111cd ${SCRIPT_DIR}
1212
You can’t perform that action at this time.
0 commit comments