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

Framework and runtime info #526

Merged
merged 74 commits into from
Sep 24, 2020
Merged

Framework and runtime info #526

merged 74 commits into from
Sep 24, 2020

Conversation

bruno-garcia
Copy link
Member

No description provided.

bruno-garcia and others added 30 commits April 21, 2018 10:36
* Removed unused nuget function
* Removed unused nuget function
Build on Linux and macOS - run on travis
* Runtime has FrameworkInstallation when compiled to NETFX
* Sample app outputs calls in different targets
* Run sample on Mono
* Execute flag on run.sh
* Add sample output to Console readme
@codecov-commenter
Copy link

codecov-commenter commented Sep 24, 2020

Codecov Report

Merging #526 into main will increase coverage by 25.71%.
The diff coverage is 64.95%.

Impacted file tree graph

@@             Coverage Diff             @@
##             main     #526       +/-   ##
===========================================
+ Coverage   60.30%   86.01%   +25.71%     
===========================================
  Files         112      126       +14     
  Lines        2660     3168      +508     
  Branches      601      726      +125     
===========================================
+ Hits         1604     2725     +1121     
+ Misses        875      249      -626     
- Partials      181      194       +13     
Impacted Files Coverage Δ
...ntry/PlatformAbstractions/FrameworkInstallation.cs 25.00% <25.00%> (ø)
src/Sentry/PlatformAbstractions/Runtime.cs 43.90% <43.90%> (ø)
src/Sentry/PlatformAbstractions/RuntimeInfo.cs 57.89% <57.89%> (ø)
...Sentry/PlatformAbstractions/FrameworkInfo.NetFx.cs 71.23% <71.23%> (ø)
...c/Sentry/PlatformAbstractions/RuntimeExtensions.cs 80.00% <80.00%> (ø)
src/Sentry.NLog/SentryTarget.cs 89.13% <100.00%> (ø)
.../PlatformAbstractions/FrameworkInfo.NetStandard.cs 100.00% <100.00%> (ø)
src/Sentry/PlatformAbstractions/FrameworkInfo.cs 100.00% <100.00%> (ø)
...ntry/PlatformAbstractions/RegistryKeyExtensions.cs 100.00% <100.00%> (ø)
src/Sentry/Internal/AppDomainAdapter.cs 66.66% <0.00%> (ø)
... and 77 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0afcf08...a1d2ca4. Read the comment docs.

Copy link
Contributor

@Tyrrrz Tyrrrz left a comment

Choose a reason for hiding this comment

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

Looks good, some small comments.

Comment on lines 46 to 79
FrameworkInstallation latest = null;
foreach (var installation in GetInstallations())
{
if (latest == null)
{
latest = installation;
}

if (clrVersion == 2)
{
// CLR 2 runs .NET 2 to 3.5
if ((installation.Version.Major == 2 || installation.Version.Major == 3)
&& installation.Version >= latest.Version)
{
latest = installation;
}
else
{
break;
}
}
else if (clrVersion == 4)
{
if (installation.Version.Major == 4
&& installation.Version >= latest.Version)
{
latest = installation;
}
else
{
break;
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this loop be replaced with latest = installations.OrderBy(...).FirstOrDefault() to avoid mutations and to make it simpler?

src/Sentry/PlatformAbstractions/FrameworkInfo.cs Outdated Show resolved Hide resolved
src/Sentry/PlatformAbstractions/RegistryKeyExtensions.cs Outdated Show resolved Hide resolved
src/Sentry/PlatformAbstractions/Runtime.cs Show resolved Hide resolved
src/Sentry/PlatformAbstractions/RuntimeExtensions.cs Outdated Show resolved Hide resolved
src/Sentry/PlatformAbstractions/RuntimeInfo.cs Outdated Show resolved Hide resolved
src/Sentry/PlatformAbstractions/RuntimeInfo.cs Outdated Show resolved Hide resolved
src/Sentry/PlatformAbstractions/RuntimeInfo.cs Outdated Show resolved Hide resolved
@bruno-garcia bruno-garcia merged commit c8e014e into main Sep 24, 2020
@bruno-garcia bruno-garcia deleted the ref/plat-abs branch September 24, 2020 18:16
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.

5 participants