Skip to content

feat(Service Registration): Rename pipeline logger and expand docs and test coverage #breaking#8

Merged
cbcrouse merged 1 commit into
mainfrom
feature/rename-startup-logger
Feb 22, 2026
Merged

feat(Service Registration): Rename pipeline logger and expand docs and test coverage #breaking#8
cbcrouse merged 1 commit into
mainfrom
feature/rename-startup-logger

Conversation

@cbcrouse

@cbcrouse cbcrouse commented Feb 21, 2026

Copy link
Copy Markdown
Owner

Refined the service registration pipeline for clarity, consistency, and reliability.

Pipeline:

  • Renamed StartupLogger to Logger in ServiceRegistrationPipeline for clearer abstraction and naming consistency while preserving startup-safe logging semantics (no DI dependency required)

Validation:

  • Refactored expression validation logic to reduce duplication and improve internal reuse (no behavioral changes)

Documentation:

  • Expanded and clarified XML documentation for expression validation invariants, canonical expression normalization, and execution semantics including ordering guarantees
  • Added README guidance for configuring the pipeline logger, environment-aware logging, and controlled opt-out scenarios

Testing:

  • Increased unit test coverage for invocation expressions, instance methods, invalid extension targets, expression lifting behavior, and expression string formatting (including method call and type binary arguments)
  • Strengthened log message assertions to verify formatted output explicitly

BREAKING CHANGE:

  • StartupLogger property renamed to Logger in ServiceRegistrationPipeline

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This pull request introduces a breaking change by renaming the StartupLogger property to Logger in the ServiceRegistrationPipeline class for improved naming clarity. The PR also significantly enhances test coverage, refactors expression validation logic to reduce duplication, and expands documentation throughout the codebase and README.

Changes:

  • Renamed StartupLogger to Logger in ServiceRegistrationPipeline and updated all references
  • Refactored expression validation logic to use shared ValidateCore and EnsureValidServiceCollectionExtension methods, making IsExtensionMethod internal for reuse
  • Added comprehensive test coverage for ServiceRegistrationExpressionCollection with a new test file covering expression lifting, ordering guarantees, and validation behavior
  • Expanded XML documentation across all affected classes with detailed remarks sections, exception documentation, and usage examples
  • Enhanced README with detailed guidance on configuring the pipeline logger, environment-aware logging patterns, and controlled opt-out scenarios

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/ServiceComposition.NET/ServiceRegistrationPipeline.cs Renamed StartupLogger property to Logger with enhanced documentation; refactored GetExpressionAsString to reuse IsExtensionMethod
src/ServiceComposition.NET/ServiceRegistrationExpressionCollection.cs Enhanced XML documentation for all methods; added explicit null checks to AddRegistrations methods to match nullable parameters
src/ServiceComposition.NET/ExpressionExtensions.cs Refactored validation logic into shared ValidateCore and EnsureValidServiceCollectionExtension methods; made IsExtensionMethod internal for reuse; improved documentation
tst/ServiceComposition.NET.UnitTests/TestClasses/TestServiceRegistrationPipelineWithLogger.cs Updated override to use Logger property
tst/ServiceComposition.NET.UnitTests/TestClasses/TestServiceRegistrationPipeline.cs Updated override to use Logger property
tst/ServiceComposition.NET.UnitTests/ServiceRegistrationPipelineTests.cs Renamed test methods to reflect property rename; added tests for method call and type binary expression formatting
tst/ServiceComposition.NET.UnitTests/ServiceRegistrationExpressionCollectionTests.cs New comprehensive test file covering expression lifting, validation, ordering, and null handling
tst/ServiceComposition.NET.UnitTests/ExpressionExtensionTests.cs Enhanced tests for null handling, instance methods, and invocation expressions; corrected exception types from ArgumentException to ArgumentNullException
tst/ServiceComposition.NET.IntegrationTests/TestClasses/TestServiceRegistrationPipeline.cs Updated override to use Logger property
README.md Renamed examples from CoreServiceRegistrationPipeline to AppServiceRegistrationPipeline; added extensive sections on configuring the pipeline logger with Serilog examples and opt-out guidance

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

[Fact]
public void ValidateServiceRegistration_WithoutConfiguration__Throws_WhenMethodIsInstanceMethod()

Copilot AI Feb 21, 2026

Copy link

Choose a reason for hiding this comment

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

The test method name contains a double underscore ("WithoutConfiguration__Throws"). This should be a single underscore to match the naming convention used by other test methods in this file.

Suggested change
public void ValidateServiceRegistration_WithoutConfiguration__Throws_WhenMethodIsInstanceMethod()
public void ValidateServiceRegistration_WithoutConfiguration_Throws_WhenMethodIsInstanceMethod()

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed

@cbcrouse cbcrouse force-pushed the feature/rename-startup-logger branch from 522ce85 to 36fdc8e Compare February 21, 2026 23:52
…d test coverage #breaking

Refined the service registration pipeline for clarity, consistency, and reliability.

Pipeline:
- Renamed StartupLogger to Logger in ServiceRegistrationPipeline for clearer abstraction and naming consistency while preserving startup-safe logging semantics (no DI dependency required)

Validation:
- Refactored expression validation logic to reduce duplication and improve internal reuse (no behavioral changes)

Documentation:
- Expanded and clarified XML documentation for expression validation invariants, canonical expression normalization, and execution semantics including ordering guarantees
- Added README guidance for configuring the pipeline logger, environment-aware logging, and controlled opt-out scenarios

Testing:
- Increased unit test coverage for invocation expressions, instance methods, invalid extension targets, expression lifting behavior, and expression string formatting (including method call and type binary arguments)
- Strengthened log message assertions to verify formatted output explicitly

BREAKING CHANGE:
- `StartupLogger` property renamed to `Logger` in `ServiceRegistrationPipeline`
@cbcrouse cbcrouse force-pushed the feature/rename-startup-logger branch from 36fdc8e to a5a8505 Compare February 21, 2026 23:54
@cbcrouse cbcrouse closed this Feb 22, 2026
@cbcrouse cbcrouse reopened this Feb 22, 2026
@cbcrouse cbcrouse merged commit 3c1653d into main Feb 22, 2026
6 checks passed
@cbcrouse cbcrouse deleted the feature/rename-startup-logger branch February 22, 2026 00:32
@sonarqubecloud

Copy link
Copy Markdown

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