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

Upgrades Piggy to net7.0, updates all .nupkgs to latest, and removes custom Npgsql to Serilog logging bridge... #26

Conversation

todthomson
Copy link
Contributor

@todthomson todthomson commented Apr 20, 2023

  • Upgrades Piggy to net7.0.
  • Updates all .nupkgs to latest.
  • Removes custom Npgsql to Serilog logging bridge.
  • Rather, uses Microsoft.Extensions.Logging bridge via NpgsqlLoggingConfiguration.InitializeLogging(new SerilogLoggerFactory());
  • Because we already use /p:PublishTrimmed=true, we have to set TrimMode=partial and SuppressTrimAnalysisWarnings=true to get back to the net5.0 and net6.0 behaviour.
  • This is because net7.0 now defaults to "trim everything that doesn't explicitly opt-out of trimming" where as net6.0 and earlier defaulted to "trim only things that have explicitly opted-in to trimming.
  • Also, fixes a bug (applies to datalust.co) where Piggy reports it's connecting to host=null, which obviously isn't true.

Tod Thomson added 3 commits April 20, 2023 08:34
- use standard mapping of Microsoft.Extensions.Logging
- to Serilog (via SerilogLoggerFactory) from Serilog.Extensions.Logging
- tested outputting log messages at INF level ok
todthomson

This comment was marked as outdated.

Tod Thomson added 8 commits April 20, 2023 10:34
- to <TrimMode>full</TrimMode> by default
- add <TrimMode>partial</TrimMode> to get old net5.0 / net6.0 behaviour
- and <SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
- to only suppress IL2104 warnings
- e.g. error IL2104: Assembly 'Autofac' produced trim warnings
- which otherwise would be treated as errors
- as we set <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
- see: https://stackoverflow.com/questions/74151256/c-sharp-publishtrimmed-how-to-deal-with-il2104-trim-warnings-in-dependencies
- "you can suppress these warnings, but essentially, ..
- there's no way for you to solve the problem".
@todthomson todthomson changed the title upgrades Piggy to net7.0, updates all .nupkgs to latest, and removes custom Npgsql to Serilog logging bridge... (draft only) upgrades Piggy to net7.0, updates all .nupkgs to latest, and removes custom Npgsql to Serilog logging bridge... Apr 20, 2023
@todthomson todthomson changed the title (draft only) upgrades Piggy to net7.0, updates all .nupkgs to latest, and removes custom Npgsql to Serilog logging bridge... Upgrades Piggy to net7.0, updates all .nupkgs to latest, and removes custom Npgsql to Serilog logging bridge... Apr 20, 2023
Copy link
Contributor Author

@todthomson todthomson left a comment

Choose a reason for hiding this comment

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

(self review) looks good! :)

@todthomson todthomson marked this pull request as ready for review April 20, 2023 23:11
Copy link
Member

@nblumhardt nblumhardt left a comment

Choose a reason for hiding this comment

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

Just some minor trivia you might consider 👍

src/Datalust.Piggy/Database/ConnectionStringParser.cs Outdated Show resolved Hide resolved
src/Datalust.Piggy/Database/ConnectionStringParser.cs Outdated Show resolved Hide resolved
src/Datalust.Piggy/PiggyModule.cs Outdated Show resolved Hide resolved
Tod Thomson added 2 commits April 21, 2023 10:43
- handle duplicate keys
- by dropping subsequent items with same key
@todthomson todthomson merged commit 775ecdb into datalust:dev Apr 21, 2023
@todthomson todthomson deleted the fix/upgrade-to-net70-and-update-nupkgs-and-remove-custom-serilog-logger branch April 21, 2023 01:02
@nblumhardt nblumhardt mentioned this pull request May 22, 2024
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