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

Adding conditional check for PublicApiAnalyzers. #3497

Closed

Conversation

Yun-Ting
Copy link
Contributor

Changes

Not all projects under src/ are meant for releasing.
The OpenTelemetry.Exporter.Prometheus.Shared project in this PR https://github.com/open-telemetry/opentelemetry-dotnet/pull/3430/files is one example.

PublicApi documents are not required for projects not for release.
Thus, adding conditional check for PublicApiAnalyzers for the projects not meant for releasing to utilize it.

@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Merging #3497 (054e9d7) into main (44ac86c) will increase coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3497      +/-   ##
==========================================
+ Coverage   86.28%   86.34%   +0.06%     
==========================================
  Files         270      270              
  Lines        9865     9865              
==========================================
+ Hits         8512     8518       +6     
+ Misses       1353     1347       -6     
Impacted Files Coverage Δ
...metryProtocol/Implementation/ActivityExtensions.cs 95.60% <0.00%> (+1.09%) ⬆️
src/OpenTelemetry/Logs/OpenTelemetryLogger.cs 91.11% <0.00%> (+4.44%) ⬆️
src/OpenTelemetry.Api/BaseProvider.cs 100.00% <0.00%> (+33.33%) ⬆️

@@ -1,7 +1,7 @@
<Project>
<Import Project=".\Common.props" />

<ItemGroup>
<ItemGroup Condition="'$(ForRelease)' == 'true'">
Copy link
Member

Choose a reason for hiding this comment

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

where is this defined?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It will be referenced in the Prometheus shared project.
See #3430 (comment)

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can shove the shared files under the Prometheus HttpListener project, and have the ASP.NET Core binding stealing from it?

It looks like we have a problem that is not generic, and here we try to solve it by abstraction and generalization (which doesn't seem to pay off IMHO) 😸

Copy link
Contributor

Choose a reason for hiding this comment

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

would Condition="$(MSBuildProjectName.EndsWith('.Shared'))" work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TimothyMothra, it works!

Copy link
Member

@reyang reyang left a comment

Choose a reason for hiding this comment

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

Seems to be a very uncommon case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants