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

[build] Use compiler constant to toggle experimental public apis #4735

Merged
merged 31 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
25c2d25
Attempting to make it easier to have experimental public api in the r…
CodeBlanch Aug 2, 2023
6ac362a
Add condition to ExposeExperimentalFeatures definition.
CodeBlanch Aug 2, 2023
01b9eae
Drop the extra shipped public api files.
CodeBlanch Aug 2, 2023
64f0d85
Upgrade Microsoft.CodeAnalysis.PublicApiAnalyzers to latest beta.
CodeBlanch Aug 2, 2023
3570de0
Tweak.
CodeBlanch Aug 2, 2023
ca84fcf
Added public api definitions that seem to be needed by the new beta.
CodeBlanch Aug 2, 2023
e9ba384
Use an experimental namespace.
CodeBlanch Aug 2, 2023
29cc171
Automatically set ExposeExperimentalFeatures in publish workflow.
CodeBlanch Aug 3, 2023
4654de7
Code review.
CodeBlanch Aug 3, 2023
3a8e562
Revert experimental namespace. Add XML remarks to public versions.
CodeBlanch Aug 7, 2023
9f252c4
Updates to OpenTelemetry.Api.ProviderBuilderExtensions logging api.
CodeBlanch Aug 8, 2023
a8db636
SDK updates moving logging and exemplar artifacts behind EXPOSE_EXPER…
CodeBlanch Aug 8, 2023
284d53f
CHANGELOG updates and fixes.
CodeBlanch Aug 8, 2023
b5dc172
Merge from main.
CodeBlanch Aug 8, 2023
d2638cc
MD lint.
CodeBlanch Aug 8, 2023
e9a42d0
More MD lint.
CodeBlanch Aug 8, 2023
dbe5984
Update ConsoleExporter for experimental features.
CodeBlanch Aug 8, 2023
b66bdd7
Updated in-memory exporter for experimental features.
CodeBlanch Aug 8, 2023
b29d488
CHANGELOG update for in-memory exporter.
CodeBlanch Aug 8, 2023
1339ce0
Update OTLP project for experimental features.
CodeBlanch Aug 8, 2023
8b8d9b1
Updated hosting project for experimental features.
CodeBlanch Aug 8, 2023
5cbf663
Fix for in-memory exporter public api files.
CodeBlanch Aug 8, 2023
d7f53cc
Fixes.
CodeBlanch Aug 8, 2023
7780b98
Merge remote-tracking branch 'upstream/main' into build-experimental-…
CodeBlanch Aug 9, 2023
498467d
Lint fixes.
CodeBlanch Aug 9, 2023
8ef1e58
CI workflow fix.
CodeBlanch Aug 9, 2023
76d5a7c
More lint fixes.
CodeBlanch Aug 9, 2023
88d3273
Use file scoping on AssemblyInfo helpers.
CodeBlanch Aug 9, 2023
463e977
Code review.
CodeBlanch Aug 10, 2023
65637b0
Update StyleCop and fix warnings using "file" or "required" modifiers.
CodeBlanch Aug 10, 2023
a112fc7
Merge branch 'main' into build-experimental-features
CodeBlanch Aug 10, 2023
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
29 changes: 27 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- '**.md'

jobs:
build-test:
build-test-stable:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
Expand All @@ -31,7 +31,32 @@ jobs:
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore
run: dotnet build --configuration Release --no-restore --property:ExposeExperimentalFeatures=false

- name: Test ${{ matrix.version }}
run: dotnet test **/bin/**/${{ matrix.version }}/*.Tests.dll --logger:"console;verbosity=detailed"

build-test-experimental:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
version: [ net462, net6.0, net7.0 ]
exclude:
- os: ubuntu-latest
version: net462

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetching all

- name: Install dependencies
run: dotnet restore

- name: Build
run: dotnet build --configuration Release --no-restore --property:ExposeExperimentalFeatures=true
utpilla marked this conversation as resolved.
Show resolved Hide resolved

- name: Test ${{ matrix.version }}
run: dotnet test **/bin/**/${{ matrix.version }}/*.Tests.dll --logger:"console;verbosity=detailed"
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageVersion Include="Grpc.Tools" Version="[2.44.0,3.0)" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="[2.1.1,6.0)" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Features" Version="[2.1.1,6.0)" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="[3.3.3]" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="[3.11.0-beta1.23402.2]" />
<PackageVersion Include="Microsoft.CodeCoverage" Version="[17.4.1]" />
<PackageVersion Include="Microsoft.CSharp" Version="[4.7.0]" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="[3.1.0,)" />
Expand Down
9 changes: 5 additions & 4 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<!--
<add key="dotnet6" value="https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet6/nuget/v3/index.json" />
-->
<add key="dotnet8" value="https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet8/nuget/v3/index.json" />
<add key=".Net Core Tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
</packageSources>

Expand All @@ -16,6 +14,9 @@
<packageSource key="NuGet">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet8">
<package pattern="*.PublicApiAnalyzers" />
</packageSource>
CodeBlanch marked this conversation as resolved.
Show resolved Hide resolved
<packageSource key=".Net Core Tools">
<package pattern="*.ApiCompat" />
</packageSource>
Expand Down
13 changes: 8 additions & 5 deletions build/Common.prod.props
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,17 @@
<NoWarn>$(NoWarn),1573,1712</NoWarn>
<PackageOutputPath Condition="$(Build_ArtifactStagingDirectory) != ''">$(Build_ArtifactStagingDirectory)</PackageOutputPath>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<!--<MinVerVerbosity>detailed</MinVerVerbosity>-->
<ApiCompatExcludeAttributeList>$(RepoRoot)\build\GlobalAttrExclusions.txt</ApiCompatExcludeAttributeList>
</PropertyGroup>

<Target Name="AssemblyVersionTarget" AfterTargets="MinVer" Condition="'$(MinVerVersion)'!='' AND '$(BuildNumber)' != ''">
<PropertyGroup>
<FileVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch).$(BuildNumber)</FileVersion>
<ExposeExperimentalFeatures Condition="'$(MinVerPreRelease)' != ''">true</ExposeExperimentalFeatures>
<ExposeExperimentalFeatures Condition="'$(MinVerPreRelease)' == ''">false</ExposeExperimentalFeatures>
Comment on lines +55 to +56
Copy link
Member Author

Choose a reason for hiding this comment

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

@utpilla I'll need to verify once this is all done and building, but this change should automatically toggle ExposeExperimentalFeatures in the publish workflow.

Copy link
Contributor

@utpilla utpilla Aug 3, 2023

Choose a reason for hiding this comment

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

You could probably also look at updating the publish-packages workflow by making use of the release event activity types:

https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release

</PropertyGroup>

<Message Importance="high" Text="**AssemblyVersionDebug** TargetFramework: $(TargetFramework), MinVerVersion: $(MinVerVersion), MinVerMajor: $(MinVerMajor), MinVerMinor: $(MinVerMinor), MinVerPatch: $(MinVerPatch), MinVerPreRelease: $(MinVerPreRelease), BuildNumber: $(BuildNumber), FileVersion: $(FileVersion), ExposeExperimentalFeatures: $(ExposeExperimentalFeatures)" />
</Target>

<PropertyGroup>
Expand Down Expand Up @@ -92,10 +95,10 @@

<!--PublicApi Analyzer-->
<ItemGroup>
<AdditionalFiles Include=".publicApi\$(TargetFramework)\PublicAPI.Shipped.txt" />
<AdditionalFiles Include=".publicApi\$(TargetFramework)\PublicAPI.Unshipped.txt" />
<None Include=".publicApi\*\PublicAPI.Shipped.txt" />
<None Include=".publicApi\*\PublicAPI.Unshipped.txt" />
<AdditionalFiles Include=".publicApi\Stable\$(TargetFramework)\PublicAPI.*.txt" />
<AdditionalFiles Include=".publicApi\Experimental\$(TargetFramework)\PublicAPI.*.txt" Condition="'$(ExposeExperimentalFeatures)' == 'true'" />
<AdditionalFiles Include=".publicApi\$(TargetFramework)\PublicAPI.*.txt" />
<None Include=".publicApi\**\PublicAPI.*.txt" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions build/Common.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@
<ImplicitUsings>enable</ImplicitUsings>
<!--temporarily disable. See 3958-->
<!--<AnalysisLevel>latest-All</AnalysisLevel>-->
<ExposeExperimentalFeatures Condition="'$(ExposeExperimentalFeatures)' == ''">true</ExposeExperimentalFeatures>
utpilla marked this conversation as resolved.
Show resolved Hide resolved
utpilla marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>

<PropertyGroup Condition="'$(ExposeExperimentalFeatures)' == 'true'">
<DefineConstants>$(DefineConstants);EXPOSE_EXPERIMENTAL_FEATURES</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Debug'">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
abstract OpenTelemetry.Logs.Experimental.Logger.EmitLog(in OpenTelemetry.Logs.Experimental.LogRecordData data, in OpenTelemetry.Logs.Experimental.LogRecordAttributeList attributes) -> void
abstract OpenTelemetry.Logs.Experimental.LoggerProviderBuilder.AddInstrumentation<TInstrumentation>(System.Func<TInstrumentation!>! instrumentationFactory) -> OpenTelemetry.Logs.Experimental.LoggerProviderBuilder!
OpenTelemetry.Logs.Experimental.IDeferredLoggerProviderBuilder
OpenTelemetry.Logs.Experimental.IDeferredLoggerProviderBuilder.Configure(System.Action<System.IServiceProvider!, OpenTelemetry.Logs.Experimental.LoggerProviderBuilder!>! configure) -> OpenTelemetry.Logs.Experimental.LoggerProviderBuilder!
OpenTelemetry.Logs.Experimental.Logger
OpenTelemetry.Logs.Experimental.Logger.EmitLog(in OpenTelemetry.Logs.Experimental.LogRecordData data) -> void
OpenTelemetry.Logs.Experimental.Logger.Logger(string? name) -> void
OpenTelemetry.Logs.Experimental.Logger.Name.get -> string!
OpenTelemetry.Logs.Experimental.Logger.Version.get -> string?
OpenTelemetry.Logs.Experimental.LoggerProvider
OpenTelemetry.Logs.Experimental.LoggerProvider.GetLogger() -> OpenTelemetry.Logs.Experimental.Logger!
OpenTelemetry.Logs.Experimental.LoggerProvider.GetLogger(string? name) -> OpenTelemetry.Logs.Experimental.Logger!
OpenTelemetry.Logs.Experimental.LoggerProvider.GetLogger(string? name, string? version) -> OpenTelemetry.Logs.Experimental.Logger!
OpenTelemetry.Logs.Experimental.LoggerProvider.LoggerProvider() -> void
OpenTelemetry.Logs.Experimental.LoggerProviderBuilder
OpenTelemetry.Logs.Experimental.LoggerProviderBuilder.LoggerProviderBuilder() -> void
OpenTelemetry.Logs.Experimental.LogRecordAttributeList
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.Add(string! key, object? value) -> void
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.Add(System.Collections.Generic.KeyValuePair<string!, object?> attribute) -> void
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.Clear() -> void
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.Count.get -> int
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.Enumerator
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.Enumerator.Current.get -> System.Collections.Generic.KeyValuePair<string!, object?>
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.Enumerator.Dispose() -> void
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.Enumerator.Enumerator() -> void
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.Enumerator.MoveNext() -> bool
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.GetEnumerator() -> OpenTelemetry.Logs.Experimental.LogRecordAttributeList.Enumerator
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.LogRecordAttributeList() -> void
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.RecordException(System.Exception! exception) -> void
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.this[int index].get -> System.Collections.Generic.KeyValuePair<string!, object?>
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.this[int index].set -> void
OpenTelemetry.Logs.Experimental.LogRecordAttributeList.this[string! key].set -> void
OpenTelemetry.Logs.Experimental.LogRecordData
OpenTelemetry.Logs.Experimental.LogRecordData.Body.get -> string?
OpenTelemetry.Logs.Experimental.LogRecordData.Body.set -> void
OpenTelemetry.Logs.Experimental.LogRecordData.LogRecordData() -> void
OpenTelemetry.Logs.Experimental.LogRecordData.LogRecordData(in System.Diagnostics.ActivityContext activityContext) -> void
OpenTelemetry.Logs.Experimental.LogRecordData.LogRecordData(System.Diagnostics.Activity? activity) -> void
OpenTelemetry.Logs.Experimental.LogRecordData.Severity.get -> OpenTelemetry.Logs.Experimental.LogRecordSeverity?
OpenTelemetry.Logs.Experimental.LogRecordData.Severity.set -> void
OpenTelemetry.Logs.Experimental.LogRecordData.SeverityText.get -> string?
OpenTelemetry.Logs.Experimental.LogRecordData.SeverityText.set -> void
OpenTelemetry.Logs.Experimental.LogRecordData.SpanId.get -> System.Diagnostics.ActivitySpanId
OpenTelemetry.Logs.Experimental.LogRecordData.SpanId.set -> void
OpenTelemetry.Logs.Experimental.LogRecordData.Timestamp.get -> System.DateTime
OpenTelemetry.Logs.Experimental.LogRecordData.Timestamp.set -> void
OpenTelemetry.Logs.Experimental.LogRecordData.TraceFlags.get -> System.Diagnostics.ActivityTraceFlags
OpenTelemetry.Logs.Experimental.LogRecordData.TraceFlags.set -> void
OpenTelemetry.Logs.Experimental.LogRecordData.TraceId.get -> System.Diagnostics.ActivityTraceId
OpenTelemetry.Logs.Experimental.LogRecordData.TraceId.set -> void
OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Debug = 5 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Debug2 = 6 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Debug3 = 7 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Debug4 = 8 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Error = 17 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Error2 = 18 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Error3 = 19 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Error4 = 20 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Fatal = 21 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Fatal2 = 22 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Fatal3 = 23 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Fatal4 = 24 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Info = 9 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Info2 = 10 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Info3 = 11 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Info4 = 12 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Trace = 1 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Trace2 = 2 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Trace3 = 3 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Trace4 = 4 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Unspecified = 0 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Warn = 13 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Warn2 = 14 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Warn3 = 15 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverity.Warn4 = 16 -> OpenTelemetry.Logs.Experimental.LogRecordSeverity
OpenTelemetry.Logs.Experimental.LogRecordSeverityExtensions
static OpenTelemetry.Logs.Experimental.LogRecordAttributeList.CreateFromEnumerable(System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string!, object?>>! attributes) -> OpenTelemetry.Logs.Experimental.LogRecordAttributeList
static OpenTelemetry.Logs.Experimental.LogRecordSeverityExtensions.ToShortName(this OpenTelemetry.Logs.Experimental.LogRecordSeverity logRecordSeverity) -> string!
virtual OpenTelemetry.Logs.Experimental.LoggerProvider.TryCreateLogger(string? name, out OpenTelemetry.Logs.Experimental.Logger? logger) -> bool
Loading
Loading