Skip to content
Open
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
34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,39 @@ jobs:
run-tests: false # Note: No test project
trigger: ${{ github.event_name }}

verify-semanticconventions:
Comment thread
ihopenre-eng marked this conversation as resolved.
name: Verify semantic conventions generation
needs: detect-changes
if: |
contains(needs.detect-changes.outputs.changes, 'semanticconventions')
|| contains(needs.detect-changes.outputs.changes, 'build')
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
show-progress: false

- name: Regenerate semantic conventions
shell: pwsh
run: |
Remove-Item -Recurse -Force ./src/OpenTelemetry.SemanticConventions/Attributes
New-Item -ItemType Directory ./src/OpenTelemetry.SemanticConventions/Attributes
./src/OpenTelemetry.SemanticConventions/scripts/generate.ps1

- name: Verify generated files are up to date
shell: pwsh
run: |
$generatedFiles = git status --short --untracked-files=all -- ./src/OpenTelemetry.SemanticConventions/Attributes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this is writing the output to the wrong place based on the file permission issues. The output path should be constructed using the absolute path with $GITHUB_WORKSPACE instead of using .

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ihopenre-eng, you have resolved this conversatoion, but it seems to be valid. Can you look into this?

if ($generatedFiles) {
$generatedFiles | Write-Output
Write-Output "Run ./src/OpenTelemetry.SemanticConventions/scripts/generate.ps1 and commit the results."
Write-Error "Generated semantic convention files are out of date."
exit 1
}

build-test-contrib-shared-tests:
needs: detect-changes
if: |
Expand Down Expand Up @@ -785,6 +818,7 @@ jobs:
build-test-sampler-aws,
build-test-semanticconventions,
test-pwsh,
verify-semanticconventions,
verify-aot-compat
]
if: always() && !cancelled()
Expand Down
10 changes: 2 additions & 8 deletions src/OpenTelemetry.SemanticConventions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,9 @@ dotnet add package OpenTelemetry.SemanticConventions --prerelease
This project uses
[Weaver](https://github.com/open-telemetry/weaver).
The folder `scripts` at the top level of the project contains the template
and the script files used in the process.
and PowerShell script used in the process.

To generate the code files, run:

```shell
./scripts/generate.sh
```

Or, with PowerShell:
To generate the code files, run the PowerShell script:

```shell
./scripts/generate.ps1
Expand Down
2 changes: 2 additions & 0 deletions src/OpenTelemetry.SemanticConventions/scripts/generate.ps1
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env pwsh

$SCRIPT_DIR = $PSScriptRoot
$ROOT_DIR = "${SCRIPT_DIR}/../"

Expand Down
33 changes: 0 additions & 33 deletions src/OpenTelemetry.SemanticConventions/scripts/generate.sh
Comment thread
martincostello marked this conversation as resolved.

This file was deleted.

Loading