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

[repo] Fix conflicts caused by DS upgrade #4967

Merged
merged 8 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
6 changes: 3 additions & 3 deletions .github/workflows/ci-instrumentation-libraries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3

- name: Install dependencies
- name: dotnet restore
run: dotnet restore ./build/InstrumentationLibraries.proj -p:RunningDotNetPack=true

- name: Build
- name: dotnet build
run: dotnet build ./build/InstrumentationLibraries.proj --configuration Release --no-restore -p:RunningDotNetPack=true

- name: Test ${{ matrix.version }}
- name: dotnet test
run: dotnet test **/bin/Release/${{ matrix.version }}/OpenTelemetry.Instrumentation*.Tests.dll --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed"
4 changes: 2 additions & 2 deletions .github/workflows/package-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
uses: actions/setup-dotnet@v3

- name: Pack
run: dotnet pack --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=false
run: dotnet pack OpenTelemetry.proj --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=false

build-test-experimental:
runs-on: windows-latest
Expand All @@ -33,4 +33,4 @@ jobs:
uses: actions/setup-dotnet@v3

- name: Pack
run: dotnet pack --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=true
run: dotnet pack OpenTelemetry.proj --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=true
11 changes: 4 additions & 7 deletions .github/workflows/publish-packages-1.0.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ jobs:
build-pack:
runs-on: windows-latest

env:
RunningDotNetPack: true

steps:
- uses: actions/checkout@v4
with:
Expand All @@ -29,14 +26,14 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v3

- name: Install dependencies
run: dotnet restore OpenTelemetry.proj
- name: dotnet restore
run: dotnet restore OpenTelemetry.proj -p:RunningDotNetPack=true

- name: dotnet build
run: dotnet build OpenTelemetry.proj --configuration Release --no-restore -p:Deterministic=true -p:BuildNumber=${{ github.run_number }}
run: dotnet build OpenTelemetry.proj --configuration Release --no-restore -p:Deterministic=true -p:BuildNumber=${{ github.run_number }} -p:RunningDotNetPack=true

- name: dotnet pack
run: dotnet pack OpenTelemetry.proj --configuration Release --no-build
run: dotnet pack OpenTelemetry.proj --configuration Release --no-build --no-restore

- name: Publish Artifacts
uses: actions/upload-artifact@v3
Expand Down
20 changes: 14 additions & 6 deletions OpenTelemetry.proj
Original file line number Diff line number Diff line change
@@ -1,25 +1,33 @@
<Project>
<ItemGroup>
<SolutionProjects Include="**\*.csproj" />

<PackProjects Include="src\**\*.csproj" />
<TestProjects Include="test\**\*.csproj" />

<!-- Not pack SemanticConventions project for now -->
<SolutionProjects Remove="src\OpenTelemetry.SemanticConventions\OpenTelemetry.SemanticConventions.csproj" />
<PackProjects Remove="src\OpenTelemetry.SemanticConventions\OpenTelemetry.SemanticConventions.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(RunningDotNetPack)' == 'true'">
<!-- Skip building these projects when publish packages workflow runs as these projects need to depend upon instrumentation libraries taking a project reference
instead of package reference on API/SDK-->
<!-- Skip building these projects when publish packages workflow runs as
these projects need to depend upon instrumentation libraries taking a
project reference instead of package reference on API/SDK -->
<SolutionProjects Remove="docs\**\**\*.csproj" />
<SolutionProjects Remove="examples\**\*.csproj" />
<SolutionProjects Remove="test\Benchmarks\Benchmarks.csproj" />
<SolutionProjects Remove="test\OpenTelemetry.Exporter.Zipkin.Tests\OpenTelemetry.Exporter.Zipkin.Tests.csproj" />
<SolutionProjects Remove="@(TestProjects)" />
</ItemGroup>

<Target Name="Build">
<MSBuild Projects="@(SolutionProjects)" Targets="Restore;Build" ContinueOnError="ErrorAndStop" />
<MSBuild Projects="@(SolutionProjects)" Targets="Build" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="Restore">
<MSBuild Projects="@(SolutionProjects)" Targets="Restore" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="Pack">
Expand Down
1 change: 1 addition & 0 deletions build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions build/InstrumentationLibraries.proj
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<Project>
<ItemGroup>
<SolutionProjects Include="..\**\OpenTelemetry.Instrumentation*.csproj" />
<TestProjects Include="..\test\**\OpenTelemetry.Instrumentation*.csproj" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Why add this? Did you mean to update the instrumentation libraries CI workflow to use this InstrumentationLibraries.proj file to run tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated the workflow to call dotnet test InstrumentationLibraries.proj --framework ${{matrix.version}} but then it fails when some projects don't have a specific target (some libraries don't target net462 for example) so I had to revert it. I left the test targets in InstrumentationLibraries.proj & OpenTelemetry.proj though because I thought it was nice to be able to do dotnet test [project_name].proj on the CLI for local things. But I can remove them if you want they aren't officially being called at the moment. My thinking is basically project files should define at least Restore, Build, and VSTest targets (that's what I'm doing over here on contrib).

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine to have them defined.

</ItemGroup>

<Target Name="Build">
Expand All @@ -10,4 +11,8 @@
<Target Name="Restore">
<MSBuild Projects="@(SolutionProjects)" Targets="Restore" ContinueOnError="ErrorAndStop" />
</Target>

<Target Name="VSTest">
<MSBuild Projects="@(TestProjects)" Targets="VSTest" ContinueOnError="ErrorAndStop" />
</Target>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<ItemGroup Condition="'$(RunningDotNetPack)' == 'true'">
<PackageReference Include="OpenTelemetry.Api" />
<PackageReference Include="OpenTelemetry.Exporter.InMemory" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" />
vishweshbankwar marked this conversation as resolved.
Show resolved Hide resolved
</ItemGroup>

<ItemGroup>
Expand Down