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

Simplify GitHub workflows, and add action to suggest changes instead of requiring manual updates #6764

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
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
39 changes: 0 additions & 39 deletions .github/workflows/verify_app_trimming_changes_are_persisted.yml

This file was deleted.

36 changes: 0 additions & 36 deletions .github/workflows/verify_solution_changes_are_persisted.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
36 changes: 0 additions & 36 deletions .github/workflows/verify_span_metadata_markdown_is_updated.yml

This file was deleted.

11 changes: 11 additions & 0 deletions tracer/src/Datadog.Trace/Tracer.cs
Original file line number Diff line number Diff line change
@@ -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>
Loading
Oops, something went wrong.