-
Notifications
You must be signed in to change notification settings - Fork 304
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
Enable analysers #908
Enable analysers #908
Conversation
Set `AnalysisLevel` to `latest-All`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Contrib.Extensions.AWSXRay`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Contrib.Instrumentation.AWS`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Contrib.Shared`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Exporter.Instana`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Exporter.Stackdriver`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Extensions.Docker`.
ix (or suppress) code analysis warnings for `OpenTelemetry.Extensions.PersistentStorage`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Instrumentation.AspNet`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Instrumentation.AWSLambda`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Instrumentation.ElasticsearchClient`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Instrumentation.EntityFrameworkCore`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Instrumentation.GrpcCore`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Contrib.Extensions.AWSXRay`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Instrumentation.MySqlData`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Contrib.Extensions.AWSXRay`.
Fix (or suppress) code analysis warnings for `OpenTelemetry.Instrumentation.Wcf`.
Use `Guard.ThrowIfNull()` where possible.
- Fix analysis warnings in non-production projects, such as tests and examples. - Fix analysis warnings in production projects missed in the first pass.
Fix CA1725 warning by adjusting the public API.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #908 +/- ##
==========================================
- Coverage 68.48% 68.22% -0.26%
==========================================
Files 183 183
Lines 7002 7018 +16
==========================================
- Hits 4795 4788 -7
- Misses 2207 2230 +23
|
@@ -7,6 +7,7 @@ | |||
<DefineConstants>$(DefineConstants);SIGNED</DefineConstants> | |||
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild> | |||
<NetFrameworkMinimumSupportedVersion>net462</NetFrameworkMinimumSupportedVersion> | |||
<AnalysisLevel>latest-All</AnalysisLevel> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latest-All sound a bit too much, can we use a fixed version here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an agreement to use this approach on SDK repository. I think we could do the same here. See open-telemetry/opentelemetry-dotnet#3958
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense.
@@ -41,19 +41,19 @@ public class AWSEKSResourceDetector : IResourceDetector | |||
public IEnumerable<KeyValuePair<string, object>> Detect() | |||
{ | |||
var credentials = this.GetEKSCredentials(AWSEKSCredentialPath); | |||
var httpClientHandler = Handler.Create(AWSEKSCertificatePath); | |||
using var httpClientHandler = Handler.Create(AWSEKSCertificatePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch
All in all, this PR seems a bit too large. The nontrivial changes should probably go to separate PRs (separately dis/enabled before) |
I think that enabling this feature project by project (including tests) could be easier to review. If you agree, it will be great to create issue to link all changes, similar to #894. @TimothyMothra, fyi as you working on similar issue in SDK repository. |
I was thinking of doing the trivial warnings (such as adding static) in one PR, and for the more involved changes, doing it per warning, or per project, however it clusters better. |
As noted in the description, I'm happy to chunk this up into N commits/PRs (whatever works best for you), but doing all the changes and pushing up a draft as a starting point was the easiest way for me to do the majority of the work in the first instance. The easiest way to fix with it turned on was per-file, per-project. |
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Closed as inactive. Feel free to reopen if this PR is still being worked on. |
Have opened #950 to track doing these changes in a series of separate pull requests. |
Changes
Enable
<AnalysisLevel>latest-All</AnalysisLevel>
as suggested in #900 (comment).Within the production shipping packages there are two changes that change the public API surface. As both packages are still pre-release on NuGet.org I assumed this was fine. These changes can be reverted and suppressed if preferred.
For the test projects I erred on the side of disabling rules rather than fixing them to reduce churn.
I'm leaving this as a draft for now as it touches a lot of files so might ping a lot of different reviewers. I can also split the commits up differently and/or create smaller more targeted PRs if that's preferred.
Let me know if any of these changes warrant a note in the CHANGELOG.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes