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

Introduce IncludeSharedGuardSource property #1430

Closed
wants to merge 1 commit into from

Conversation

Kielek
Copy link
Contributor

@Kielek Kielek commented Nov 9, 2023

Changes

Introduce IncludeSharedGuardSource property to define source file only once.

For significant contributions please make sure you have completed the following items:

  • [ ] Appropriate CHANGELOG.md updated for non-trivial changes
  • [ ] Design discussion issue #
  • [ ] Changes in public API reviewed

Copy link

codecov bot commented Nov 9, 2023

Codecov Report

Merging #1430 (785a2ad) into main (71655ce) will decrease coverage by 0.99%.
Report is 52 commits behind head on main.
The diff coverage is 62.98%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1430      +/-   ##
==========================================
- Coverage   73.91%   72.92%   -0.99%     
==========================================
  Files         267      262       -5     
  Lines        9615     9682      +67     
==========================================
- Hits         7107     7061      -46     
- Misses       2508     2621     +113     
Flag Coverage Δ
unittests-Exporter.Geneva 57.92% <27.45%> (?)
unittests-Exporter.OneCollector 89.71% <ø> (?)
unittests-Extensions 81.73% <ø> (?)
unittests-Instrumentation.AspNet 72.91% <94.44%> (?)
unittests-Instrumentation.EventCounters 75.92% <ø> (?)
unittests-Instrumentation.Owin 85.71% <100.00%> (?)
unittests-Instrumentation.Process 100.00% <ø> (?)
unittests-Instrumentation.Runtime 100.00% <ø> (?)
unittests-Instrumentation.StackExchangeRedis 71.37% <6.45%> (?)
unittests-Instrumentation.Wcf 78.47% <81.59%> (?)
unittests-PersistentStorage 58.80% <ø> (?)
unittests-ResourceDetectors.Azure 80.73% <50.00%> (?)
unittests-Solution 78.94% <39.02%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...orter.Geneva/MsgPackExporter/MsgPackLogExporter.cs 95.10% <100.00%> (+1.76%) ⬆️
...ter.Geneva/MsgPackExporter/MsgPackTraceExporter.cs 94.52% <100.00%> (+2.10%) ⬆️
...ry.Exporter.InfluxDB/InfluxDBExporterExtensions.cs 100.00% <100.00%> (ø)
...ation.AspNet.TelemetryHttpModule/ActivityHelper.cs 85.71% <100.00%> (+0.46%) ⬆️
...nTelemetry.Instrumentation.AspNet/AspNetMetrics.cs 100.00% <100.00%> (ø)
...tion.AspNet/AspNetMetricsInstrumentationOptions.cs 100.00% <100.00%> (ø)
...ion.AspNet/Implementation/HttpInMetricsListener.cs 100.00% <100.00%> (ø)
...searchClient/ElasticsearchClientInstrumentation.cs 100.00% <100.00%> (ø)
.../ElasticsearchRequestPipelineDiagnosticListener.cs 82.35% <100.00%> (+0.14%) ⬆️
...ityFrameworkCore/EntityFrameworkInstrumentation.cs 80.00% <100.00%> (-20.00%) ⬇️
... and 47 more

... and 33 files with indirect coverage changes

@@ -54,6 +54,10 @@
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersPkgVer)" Condition="'$(SkipAnalysis)'!='true'" PrivateAssets="All" />
</ItemGroup>

<ItemGroup Condition="'$(IncludeSharedGuardSource)'=='true'">
<Compile Include="$(RepoRoot)\src\Shared\Guard.cs" Link="Includes\Guard.cs" />
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see much value in extracting this into a variable. It's a single compile include item. I think extracting it into a variable is adding another layer of indirection to figure out what the project needs.

Copy link
Member

Choose a reason for hiding this comment

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

Seems like most project use it what if we made it included by default and only opted-out where a project didn't want to use it?

Copy link
Contributor

@utpilla utpilla Nov 9, 2023

Choose a reason for hiding this comment

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

My only issue with that would be that anytime someone contributes a new project to repo they would now have to be aware of this. We would probably have to update Contributing,md file for new contributors to look out for these "magically" added file(s).

I wouldn't want to surprise them 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IMO we are in the worst place right now.
One part of the shared files is included by properties, the other part by direct Compile calls.

We should move all projects in one direction. When we have agreement, I am fine to extend contribution guide :) .

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we are in the worst place right now.
One part of the shared files is included by properties, the other part by direct Compile calls.

I see value in extracting multiple Compile includes into a property. There are a bunch of projects that use a common set of Compile includes. But extracting a single compile include into a property doesn't make sense to me. If that's what we want to do then, where do we stop? Why don't we create a property for every single PackageReference and ProjectReference as well?

We should move all projects in one direction. When we have agreement, I am fine to extend contribution guide :) .

If we want to be consistent, I would be in favor of removing these properties altogether and have each project explicitly add the individual Compile Include they need.

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 7 days.

@github-actions github-actions bot added the Stale label Nov 18, 2023
Copy link
Contributor

Closed as inactive. Feel free to reopen if this PR is still being worked on.

@github-actions github-actions bot closed this Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants