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

Improve support to .NET Standard and .NET Framework #3507

Merged

Conversation

lillo42
Copy link
Contributor

@lillo42 lillo42 commented Feb 12, 2025

Many projects can have support for .NET Standard and we haven't added support to it.

I've created 3 variables:

  • BrigtherTargetFrameworks -> This should be the default (netstandard2.0;net8.0;net9.0)
  • BrigtherCoreTargetFrameworks -> Some libs have drop support to .NET Standard & .NET Framework like postgres (net462;net8.0;net9.0)
  • BrigtherFrameworkAndCoreTargetFrameworks -> For projects that have support to target .NET Core & .NET Framework like MsSQL (net462;net8.0;net9.0), I've also add the Microsoft.NETFramework.ReferenceAssemblies to allow the CI build packages for the .NET Framework

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Gates Failed
Prevent hotspot decline (1 hotspot with Code Duplication)
Enforce advisory code health rules (1 file with Code Duplication)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Prevent hotspot decline Violations Code Health Impact
MySqlOutbox.cs 1 rule in this hotspot 9.39 → 9.10 Suppress
Enforce advisory code health rules Violations Code Health Impact
MySqlOutbox.cs 1 advisory rule 9.39 → 9.10 Suppress

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

@lillo42 lillo42 marked this pull request as ready for review February 12, 2025 15:10
Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Gates Failed
Prevent hotspot decline (1 hotspot with Code Duplication)
Enforce advisory code health rules (1 file with Code Duplication)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Prevent hotspot decline Violations Code Health Impact
MySqlOutbox.cs 1 rule in this hotspot 9.39 → 9.10 Suppress
Enforce advisory code health rules Violations Code Health Impact
MySqlOutbox.cs 1 advisory rule 9.39 → 9.10 Suppress

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Gates Failed
Prevent hotspot decline (1 hotspot with Code Duplication)
Enforce advisory code health rules (1 file with Code Duplication)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Prevent hotspot decline Violations Code Health Impact
MySqlOutbox.cs 1 rule in this hotspot 9.39 → 9.10 Suppress
Enforce advisory code health rules Violations Code Health Impact
MySqlOutbox.cs 1 advisory rule 9.39 → 9.10 Suppress

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Improved (1 files improve in Code Health)

Gates Passed
4 Quality Gates Passed

See analysis details in CodeScene

View Improvements
File Code Health Impact Categories Improved
MySqlOutbox.cs 9.39 → 10.00 Code Duplication

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

@@ -159,14 +159,22 @@ protected override async Task<T> ReadFromStoreAsync<T>(

if (connection.State != ConnectionState.Open)
await connection.OpenAsync(cancellationToken);
#if NETSTANDARD2_0

Choose a reason for hiding this comment

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

✅ No longer an issue: Code Duplication
The module no longer contains too many functions with similar structure

Copy link
Member

@iancooper iancooper left a comment

Choose a reason for hiding this comment

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

Guessing the issue here is that we can't get this to compile for netstandard20, so we need to "fake" the nestandard20 version using the underlying sync apis? Approving on that basis

@iancooper
Copy link
Member

@lillo42 Let me know if understand the issue right - build constraints - if so happy to merge

@lillo42
Copy link
Contributor Author

lillo42 commented Feb 13, 2025

Hey @iancooper

Guessing the issue here is that we can't get this to compile for netstandard20, so we need to "fake" the nestandard20 version using the underlying sync apis? Approving on that basis

Depending, on #if for the 99% yes, but there is one case where a method exists on .NET 8/9 and doesn't exist on .NET Standard on SqliteOutbox.cs

About the Microsoft.NETFramework.ReferenceAssemblies I've added it to allow build .NET Framework on non-Windows machine, it's used only for MS SQL packages

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Improved (1 files improve in Code Health)

Gates Passed
4 Quality Gates Passed

See analysis details in CodeScene

View Improvements
File Code Health Impact Categories Improved
MySqlOutbox.cs 9.39 → 10.00 Code Duplication

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Improved (1 files improve in Code Health)

Gates Passed
4 Quality Gates Passed

See analysis details in CodeScene

View Improvements
File Code Health Impact Categories Improved
MySqlOutbox.cs 9.39 → 10.00 Code Duplication

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Improved (1 files improve in Code Health)

Gates Passed
4 Quality Gates Passed

See analysis details in CodeScene

View Improvements
File Code Health Impact Categories Improved
MySqlOutbox.cs 9.39 → 10.00 Code Duplication

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

@iancooper iancooper merged commit ffd0f89 into BrighterCommand:master Feb 14, 2025
16 of 20 checks passed
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.

2 participants