Skip to content

Conversation

@samtrion
Copy link
Member

@samtrion samtrion commented Dec 10, 2025

Summary by CodeRabbit

  • New Features

    • Logging configuration support added via application builder extensions
    • Console and Debug logging providers now available out of the box
  • Chores

    • Added logging framework dependencies for integrated logging support
    • Improved test command initialization with default argument handling

✏️ Tip: You can customize this high-level summary in your review settings.

@samtrion samtrion self-assigned this Dec 10, 2025
@samtrion samtrion added state:ready for merge Indicates that a pull request has been reviewed and approved, and is ready to be merged into the mai type:feature Indicates a new feature or enhancement to be added. labels Dec 10, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 10, 2025

Warning

Rate limit exceeded

@samtrion has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 20 minutes and 6 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between da4ba35 and dcdd113.

📒 Files selected for processing (1)
  • src/NetEvolve.ForgingBlazor/ServiceCollectionExtensions.cs (1 hunks)

Walkthrough

Adds a new logging project and extension methods, registers centralized package versions for logging, adds runtime fallback registration for a null logger, and adjusts test program argument handling.

Changes

Cohort / File(s) Summary
Package configuration
Directory.Packages.props
Added PackageVersion entries for Microsoft.Extensions.Logging and Microsoft.Extensions.Logging.Console (v10.0.1).
New logging project
ForgingBlazor.slnx, src/NetEvolve.ForgingBlazor.Logging/NetEvolve.ForgingBlazor.Logging.csproj
Added new project to solution and created csproj referencing logging packages, Console logger, YamlDotNet, InternalsVisibleTo, and a project reference to the extensibility project.
Logging extensions
src/NetEvolve.ForgingBlazor.Logging/ApplicationBuilderExtensions.cs
Added ApplicationBuilderExtensions with two public WithLogging extension methods to register/configure logging via the application's service collection, including null checks and XML docs.
Framework integration
src/NetEvolve.ForgingBlazor/ForgingBlazorApplicationBuilder.cs, src/NetEvolve.ForgingBlazor/ServiceCollectionExtensions.cs
Added using directives and runtime guard to register NullLoggerFactory and default NullLogger<T> when no ILoggerFactory is present; added internal IsServiceTypeRegistered<T> extension on IServiceCollection.
Tests / runner
tests/NetEvolve.ForgingBlazor.Tests.Console/Program.cs
Defaulted command-line args to "build" when none provided before calling ForgingBlazorApplicationBuilder.CreateDefaultBuilder.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20–30 minutes

  • Pay attention to ApplicationBuilderExtensions: correctness of service-registration timing and null checks.
  • Verify ForgingBlazorApplicationBuilder's fallback logger registration doesn't conflict with existing DI registrations.
  • Confirm project file package versions and InternalsVisibleTo target the correct assembly names/TFMs.
  • Quick review of ServiceCollectionExtensions for accurate detection of registered service types.

Poem

🐇 I hopped through code at break of dawn,

Added logs so silence's gone.
If no logger greets the day,
A gentle null will guard the way.
Hooray — the build command leads the run! 🎉

Pre-merge checks

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Added Logging' is vague and generic, using a non-descriptive verb that doesn't convey the specific functionality or context of the changes. Use a more descriptive title that explains what was added, such as 'feat: Add logging integration extensions and NullLoggerFactory fallback' or 'feat: Implement application logging configuration support'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
tests/NetEvolve.ForgingBlazor.Tests.Console/Program.cs (1)

3-10: Sensible default command handling for empty args

Using a local arguments variable and defaulting to "build" when no args are provided makes the test console more robust and removes the “no command” edge case. The flow into CreateDefaultBuilder(arguments) looks good.

If you prefer a more compact style, this is equivalent:

var arguments = args.Length == 0 ? new[] { "build" } : args;

but the current version is perfectly acceptable.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between cae2132 and d2ba7ac.

📒 Files selected for processing (6)
  • Directory.Packages.props (1 hunks)
  • ForgingBlazor.slnx (1 hunks)
  • src/NetEvolve.ForgingBlazor.Logging/ApplicationBuilderExtensions.cs (1 hunks)
  • src/NetEvolve.ForgingBlazor.Logging/NetEvolve.ForgingBlazor.Logging.csproj (1 hunks)
  • src/NetEvolve.ForgingBlazor/ForgingBlazorApplicationBuilder.cs (2 hunks)
  • tests/NetEvolve.ForgingBlazor.Tests.Console/Program.cs (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
tests/NetEvolve.ForgingBlazor.Tests.Console/Program.cs (1)
src/NetEvolve.ForgingBlazor/ForgingBlazorApplicationBuilder.cs (2)
  • ForgingBlazorApplicationBuilder (33-195)
  • ForgingBlazorApplicationBuilder (70-75)
🪛 GitHub Check: Build & Tests / Run Tests (ubuntu-latest) / Testing .NET solution
src/NetEvolve.ForgingBlazor/ForgingBlazorApplicationBuilder.cs

[failure] 104-104:
'IServiceCollection' does not contain a definition for 'IsServiceTypeRegistered' and no accessible extension method 'IsServiceTypeRegistered' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)


[failure] 104-104:
'IServiceCollection' does not contain a definition for 'IsServiceTypeRegistered' and no accessible extension method 'IsServiceTypeRegistered' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)


[failure] 104-104:
'IServiceCollection' does not contain a definition for 'IsServiceTypeRegistered' and no accessible extension method 'IsServiceTypeRegistered' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)


[failure] 104-104:
'IServiceCollection' does not contain a definition for 'IsServiceTypeRegistered' and no accessible extension method 'IsServiceTypeRegistered' accepting a first argument of type 'IServiceCollection' could be found (are you missing a using directive or an assembly reference?)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build & Tests / Run Tests (windows-latest) / Testing .NET solution
  • GitHub Check: Build & Tests / Run Tests (macos-latest) / Testing .NET solution
🔇 Additional comments (4)
ForgingBlazor.slnx (1)

26-26: Logging project correctly wired into solution

The new NetEvolve.ForgingBlazor.Logging project is added under /src/ consistently with existing entries; no issues from a solution-structure perspective.

src/NetEvolve.ForgingBlazor.Logging/NetEvolve.ForgingBlazor.Logging.csproj (1)

1-16: Logging project configuration is consistent with the existing solution setup

The new logging project:

  • Targets the shared $( _ProjectTargetFrameworks ).
  • Correctly relies on central package version management for logging and YamlDotNet.
  • Exposes internals to NetEvolve.ForgingBlazor and references the extensibility project.

All of this looks coherent with the rest of the solution.

Directory.Packages.props (1)

21-24: Central logging package versions align with new logging project

Adding central versions for Microsoft.Extensions.Logging and .Console matches the new logging project’s PackageReferences and keeps versioning consistent across the solution.

Please just confirm these versions are compatible with your target frameworks and other dependencies in this repo.

src/NetEvolve.ForgingBlazor.Logging/ApplicationBuilderExtensions.cs (1)

15-114: Logging extension methods look well‑structured and DI‑friendly

The WithLogging overloads integrate cleanly with IApplicationBuilder:

  • WithLogging(this IApplicationBuilder builder) provides a sensible default (AddConsole().AddDebug()).
  • The configurable overload null‑checks builder, wires logging via builder.Services.AddLogging(configure), and preserves fluent chaining by returning the same builder instance.

This matches typical Microsoft.Extensions.Logging usage patterns and should compose nicely with the ForgingBlazorApplicationBuilder.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/NetEvolve.ForgingBlazor/ServiceCollectionExtensions.cs (1)

3-4: Consider removing unused imports.

The following imports are not referenced in this file:

  • System.CommandLine (line 3)
  • System.Diagnostics.CodeAnalysis (line 4)
  • NetEvolve.ForgingBlazor.Commands (line 6)
  • NetEvolve.ForgingBlazor.Core.Models (line 7)
  • NetEvolve.ForgingBlazor.Extensibility.Abstractions (line 8)
  • NetEvolve.ForgingBlazor.Extensibility.Models (line 9)

Apply this diff to remove unused imports:

-using System.CommandLine;
-using System.Diagnostics.CodeAnalysis;
 using Microsoft.Extensions.DependencyInjection;
-using NetEvolve.ForgingBlazor.Commands;
-using NetEvolve.ForgingBlazor.Core.Models;
-using NetEvolve.ForgingBlazor.Extensibility.Abstractions;
-using NetEvolve.ForgingBlazor.Extensibility.Models;
-using NetEvolve.ForgingBlazor.Services;

Also applies to: 6-9

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between d2ba7ac and da4ba35.

📒 Files selected for processing (1)
  • src/NetEvolve.ForgingBlazor/ServiceCollectionExtensions.cs (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI
src/NetEvolve.ForgingBlazor/ServiceCollectionExtensions.cs

[error] 10-10: dotnet build failed: CS0234 The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)

🪛 GitHub Check: Build & Tests / Run Tests (macos-latest) / Testing .NET solution
src/NetEvolve.ForgingBlazor/ServiceCollectionExtensions.cs

[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)


[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)


[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)


[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)

🪛 GitHub Check: Build & Tests / Run Tests (ubuntu-latest) / Testing .NET solution
src/NetEvolve.ForgingBlazor/ServiceCollectionExtensions.cs

[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)


[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)


[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)


[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)

🪛 GitHub Check: Build & Tests / Run Tests (windows-latest) / Testing .NET solution
src/NetEvolve.ForgingBlazor/ServiceCollectionExtensions.cs

[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)


[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)


[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)


[failure] 10-10:
The type or namespace name 'Services' does not exist in the namespace 'NetEvolve.ForgingBlazor' (are you missing an assembly reference?)

🔇 Additional comments (1)
src/NetEvolve.ForgingBlazor/ServiceCollectionExtensions.cs (1)

14-15: LGTM!

The implementation correctly checks if a service type is registered in the collection. The use of LINQ's Any method with a type comparison is appropriate and efficient.

@samtrion samtrion merged commit 5a01cad into main Dec 10, 2025
8 checks passed
@samtrion samtrion deleted the feature/logging branch December 10, 2025 21:48
@codecov
Copy link

codecov bot commented Dec 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.26%. Comparing base (cae2132) to head (dcdd113).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #21      +/-   ##
==========================================
+ Coverage   89.81%   90.26%   +0.45%     
==========================================
  Files          10       11       +1     
  Lines         108      113       +5     
  Branches        4        6       +2     
==========================================
+ Hits           97      102       +5     
  Misses         11       11              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:ready for merge Indicates that a pull request has been reviewed and approved, and is ready to be merged into the mai type:feature Indicates a new feature or enhancement to be added.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants