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

Remove icon service dependency on core #77

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

lizard-boy
Copy link

@lizard-boy lizard-boy commented Oct 19, 2024

Type of change

  • Bug fix
  • New feature development
  • Tech debt (refactoring, code cleanup, dependency upgrades, etc)
  • Build/deploy pipeline (DevOps)
  • Other

Objective

Initial effort to decouple icon service from core, and instead use a SharedKernel which should be versioned as a Nugget package.

image

Remaining work: Remove LoggerFactoryExtension from remaining projects, and document how to configure the different logger sinks.

Code changes

Testing requirements

Before you submit

  • I have checked for formatting errors (dotnet tool run dotnet-format --check) (required)
  • If making database changes - I have also updated Entity Framework queries and/or migrations
  • I have added unit tests where it makes sense to do so (encouraged but not required)
  • This change requires a documentation update (notify the documentation team)
  • This change has particular deployment requirements (notify the DevOps team)

Greptile Summary

This pull request introduces changes to decouple the icon service from the core application by implementing a SharedKernel.

  • Added SharedKernel project to the solution, replacing Core and SharedWeb dependencies in Icons.csproj
  • Updated various InfoControllers to use VersionHelper from SharedKernel instead of CoreHelpers
  • Replaced traditional ASP.NET Core logging with Serilog configuration in multiple projects
  • Removed GetVersion method from CoreHelpers.cs, moving version functionality to SharedKernel
  • Modified Program.cs files to implement improved Serilog logging and error handling

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

30 file(s) reviewed, 7 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -16,7 +16,7 @@ public DateTime GetAlive()
[HttpGet("~/version")]
public JsonResult GetVersion()
{
return Json(CoreHelpers.GetVersion());
return Json(VersionHelper.GetVersion());
Copy link

Choose a reason for hiding this comment

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

logic: VersionHelper.GetVersion() is now used instead of CoreHelpers.GetVersion(). Verify that VersionHelper provides the same functionality and returns the version in the expected format.

@@ -1,9 +1,7 @@
using System;
Copy link

Choose a reason for hiding this comment

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

style: Consider adding XML comments for public methods and classes to maintain documentation standards.

Comment on lines 1 to 7
{
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
},
"Console": {
"IncludeScopes": true,
"LogLevel": {
"Default": "Warning",
"System": "Warning",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
"Serilog": {
"MinimumLevel": {
"Default": "Error"
}
}
}
Copy link

Choose a reason for hiding this comment

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

style: Ensure that this Serilog configuration is consistent with other services and provides sufficient logging information for production troubleshooting.

}
"Serilog": {
"MinimumLevel": {
"Default": "Error",
Copy link

Choose a reason for hiding this comment

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

style: Default log level set to 'Error'. Verify this won't suppress important logs that were previously captured at 'Warning' level.

@@ -90,5 +90,11 @@
},
"IpRateLimitPolicies": {
"IpRules": []
},
"Serilog": {
"Enrich": [ "FromLogContext" ],
Copy link

Choose a reason for hiding this comment

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

style: Consider adding more enrichers like 'WithMachineName' and 'WithThreadId' for more detailed logs

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