diff --git a/.github/workflows/verify_app_trimming_changes_are_persisted.yml b/.github/workflows/verify_app_trimming_changes_are_persisted.yml deleted file mode 100644 index 32e5662ef219..000000000000 --- a/.github/workflows/verify_app_trimming_changes_are_persisted.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Verify app trimming xml file changes have been persisted - -on: - pull_request: - workflow_dispatch: - -jobs: - verify_app_trimming_descriptor_generator: - runs-on: windows-latest - permissions: - contents: read - - steps: - - name: Support longpaths - run: git config --system core.longpaths true - - - name: Checkout - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 - - - uses: actions/setup-dotnet@71a4fd9b27383962fc5df13a9c871636b43199b4 # v1.10.0 - with: - dotnet-version: '9.0.102' - - - name: "Removing existing Datadog.Trace.Trimming.xml" - run: Get-ChildItem –Path ".\tracer\src\Datadog.Trace.Trimming\build\Datadog.Trace.Trimming.xml" -Recurse -File | Remove-Item - - - name: "Regenerating Datadog.Trace.Trimming.xml" - run: .\tracer\build.ps1 BuildTracerHome CreateTrimmingFile - - - name: "Verify no changes in Datadog.Trace.Trimming.xml" - run: | - git diff --quiet -- .\tracer\src\Datadog.Trace.Trimming\build - if ($LASTEXITCODE -eq 1) { - git diff -- .\tracer\src\Datadog.Trace.Trimming\build - Write-Error "Found changes in Datadog.Trace.Trimming.xml. Build the solution locally and ensure you have committed the Datadog.Trace.Trimming.xml changes." - Exit 1 - } else { - echo "No changes found to generated files" - } diff --git a/.github/workflows/verify_solution_changes_are_persisted.yml b/.github/workflows/verify_solution_changes_are_persisted.yml deleted file mode 100644 index 71ae37704740..000000000000 --- a/.github/workflows/verify_solution_changes_are_persisted.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Verify Sample solution changes have been persisted - -on: - pull_request: - workflow_dispatch: - -jobs: - verify_solution_changes_are_persisted: - runs-on: windows-latest - permissions: - contents: read - - steps: - - name: Support longpaths - run: git config --system core.longpaths true - - - name: Checkout - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 - - - uses: actions/setup-dotnet@71a4fd9b27383962fc5df13a9c871636b43199b4 # v1.10.0 - with: - dotnet-version: '9.0.102' - - - name: "Regenerating Solutions" - run: .\tracer\build.ps1 RegenerateSolutions - - - name: "Verify no changes in generated solutions" - run: | - git diff --quiet - if ($LASTEXITCODE -eq 1) { - git diff - Write-Error "Found changes in generated solutions. Did you add a new sample? Regenerate the build solution locally by running the target 'RegenerateSolutions', and ensure the changed files are committed to git." - Exit 1 - } else { - echo "No changes found to generated files" - } diff --git a/.github/workflows/verify_source_generated_changes_are_persisted.yml b/.github/workflows/verify_source_generated_changes_are_persisted.yml index 0e9d2c2ef041..a5da7c2a6679 100644 --- a/.github/workflows/verify_source_generated_changes_are_persisted.yml +++ b/.github/workflows/verify_source_generated_changes_are_persisted.yml @@ -1,4 +1,4 @@ -name: Verify source generator changes have been persisted +name: Verify generated changes have been persisted on: pull_request: @@ -9,6 +9,7 @@ jobs: runs-on: windows-latest permissions: contents: read + pull-requests: write # create review comments with suggest-changes steps: - name: Support longpaths @@ -21,10 +22,19 @@ jobs: with: dotnet-version: '9.0.102' - - name: "Regenerating package versions" - run: .\tracer\build.ps1 Restore CompileManagedSrc + - name: "Removing existing Datadog.Trace.Trimming.xml" + run: Get-ChildItem –Path ".\tracer\src\Datadog.Trace.Trimming\build\Datadog.Trace.Trimming.xml" -Recurse -File | Remove-Item - - name: "Verify no changes in generated files" + - name: "Regenerating Datadog.Trace.Trimming.xml" + run: .\tracer\build.ps1 Restore CompileManagedSrc CompileManagedLoader CreateTrimmingFile + + - name: "Regenerating Solutions" + run: .\tracer\build.ps1 RegenerateSolutions + + - name: "Regenerate docs/span_metadata.md" + run: .\tracer\build.ps1 GenerateSpanDocumentation + + - name: "Verify no changes in source generator files" run: | git diff --quiet -- .\tracer\src\Datadog.Trace\Generated .\tracer\src\Datadog.Tracer.Native\Generated .\tracer\build\supported_calltargets.g.json if ($LASTEXITCODE -eq 1) { @@ -34,3 +44,47 @@ jobs: } else { echo "No changes found to generated files" } + + - name: "Verify no changes in Datadog.Trace.Trimming.xml" + if: ${{ !cancelled() }} # make sure this runs even if the previous step failed + run: | + git diff --quiet -- .\tracer\src\Datadog.Trace.Trimming\build + if ($LASTEXITCODE -eq 1) { + git diff -- .\tracer\src\Datadog.Trace.Trimming\build + Write-Error "Found changes in Datadog.Trace.Trimming.xml. Build the solution locally and ensure you have committed the Datadog.Trace.Trimming.xml changes, or accept the suggestions from the bot." + Exit 1 + } else { + echo "No changes found to generated files" + } + + - name: "Verify no changes in generated solutions" + if: ${{ !cancelled() }} # make sure this runs even if a previous step failed + run: | + git diff --quiet -- *.g.sln + if ($LASTEXITCODE -eq 1) { + git diff -- *.g.sln + Write-Error "Found changes in generated solutions. Did you add a new sample? Regenerate the build solution locally by running the target 'RegenerateSolutions', and ensure the changed files are committed to git." + Exit 1 + } else { + echo "No changes found to generated files" + } + + - name: "Verify no changes in docs/span_metadata.md" + if: ${{ !cancelled() }} # make sure this runs even if a previous step failed + run: | + git diff --quiet -- .\docs\span_metadata.md + if ($LASTEXITCODE -eq 1) { + git diff -- .\docs\span_metadata.md + Write-Error "Found changes in docs/span_metadata.md file. Run build task GenerateSpanDocumentation to regenerate the file with the latest C# rules." + Exit 1 + } else { + echo "No changes found to docs/span_metadata.md file" + } + + - uses: parkerbxyz/suggest-changes@459712ee6d904111222530ad28ff6cd8a4218e56 #v2.0.0 + if: ${{ failure() }} # only post a comment with suggestions if we found any changes + with: + comment: 'Please commit the suggested auto-generated changes' + event: 'REQUEST_CHANGES' + env: + ACTIONS_STEP_DEBUG: true \ No newline at end of file diff --git a/.github/workflows/verify_span_metadata_markdown_is_updated.yml b/.github/workflows/verify_span_metadata_markdown_is_updated.yml deleted file mode 100644 index 615f2c7e0bfa..000000000000 --- a/.github/workflows/verify_span_metadata_markdown_is_updated.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Verify docs/span_metadata.md is updated - -on: - pull_request: - workflow_dispatch: - -jobs: - verify_span_metadata: - runs-on: windows-latest - permissions: - contents: read - - steps: - - name: Support longpaths - run: git config --system core.longpaths true - - - name: Checkout - uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 - - - uses: actions/setup-dotnet@71a4fd9b27383962fc5df13a9c871636b43199b4 # v1.10.0 - with: - dotnet-version: '9.0.102' - - - name: "Regenerate docs/span_metadata.md" - run: .\tracer\build.ps1 GenerateSpanDocumentation - - - name: "Verify no changes in docs/span_metadata.md" - run: | - git diff --quiet -- .\docs\span_metadata.md - if ($LASTEXITCODE -eq 1) { - git diff -- .\docs\span_metadata.md - Write-Error "Found changes in docs/span_metadata.md file. Run build task GenerateSpanDocumentation to regenerate the file with the latest C# rules." - Exit 1 - } else { - echo "No changes found to docs/span_metadata.md file" - } diff --git a/tracer/src/Datadog.Trace/Tracer.cs b/tracer/src/Datadog.Trace/Tracer.cs index c846b06d9f7a..844603d30407 100644 --- a/tracer/src/Datadog.Trace/Tracer.cs +++ b/tracer/src/Datadog.Trace/Tracer.cs @@ -290,6 +290,17 @@ internal static void UnsafeSetTracerInstance(Tracer instance) instance?.TracerManager.Start(); } +#if NETCOREAPP3_1_OR_GREATER + /// <summary> + /// TEMP for testing trimming + /// </summary> + public void Testing() + { + var x = new Microsoft.AspNetCore.Http.CookieBuilder(); + x.Name = "test"; + } +#endif + /// <summary> /// This creates a new span with the given parameters and makes it active. /// </summary>