Skip to content

V5.2.0/add cli context - #35

Merged
gimlichael merged 12 commits into
mainfrom
v5.2.0/add-cli-context
Jul 27, 2026
Merged

V5.2.0/add cli context#35
gimlichael merged 12 commits into
mainfrom
v5.2.0/add-cli-context

Conversation

@gimlichael

Copy link
Copy Markdown
Member

This pull request introduces version 5.2.0 with several improvements, new features, and maintenance updates across the codebase. The most significant changes include the addition of the CommandLineContext class for handling command-line arguments, comprehensive refactoring of the console hosted services for better maintainability and testability, and upgrades to all major dependencies and build configurations. Documentation and release notes have also been updated to reflect these changes.

New Features

  • Added CommandLineContext class in the Codebelt.Bootstrapper namespace to encapsulate and provide consistent access to command-line arguments within the bootstrapper infrastructure. [1] [2]

Service Refactoring and Testability

  • Refactored ConsoleHostedService and MinimalConsoleHostedService to extract nested callback logic into focused private methods (StartRunAsync, RunAsync, ResolveLogger, LogRunAsyncStarted, LogUnableToActivate, LogFatalError) for improved code clarity, testability, and maintainability. [1] [2]
  • Added comprehensive unit test coverage for CommandLineContext, ConsoleHostedService, and MinimalConsoleHostedService. [1] [2]

Dependency and Build System Upgrades

  • Upgraded all NuGet dependencies to the latest stable releases for all supported target frameworks (Codebelt.Extensions.Swashbuckle.AspNetCore, Codebelt.Extensions.Xunit.App, Cuemon.Core, Cuemon.Extensions.Hosting, Microsoft.NET.Test.Sdk, and all Microsoft.AspNetCore and Microsoft.Extensions packages for net9 and net10). [1] [2] [3] [4] [5]
  • Enhanced build analyzer configuration with warning suppressions, enabled code style enforcement, and configured MinVer tag prefix. [1] [2] [3]

Documentation and Release Notes

  • Updated release notes and changelog to document version 5.2.0 and all major changes. [1] [2] [3] [4] [5] [6]
  • Clarified usage of BootstrapperLogMessages in API documentation.

Infrastructure

  • Changed DocFX nginx base image to 1.31-alpine to use the stable release channel for documentation build infrastructure.

gimlichael and others added 10 commits July 26, 2026 21:08
Updated all central NuGet package versions to latest stable releases across all dependency groups: Codebelt.Extensions, Cuemon, Microsoft.NET.Test.Sdk, and targeted framework-specific packages for net9 and net10.
Added analyzer warning suppressions (7035, CA2260, S6618), enabled code style enforcement in build, and configured MinVer tag prefix. Fixed incorrect AnalysisLevel property to AnalysisMode in test and benchmark project configurations.
Adjusted nginx base image from 1.31.2-alpine to 1.31-alpine to use the stable release channel for documentation build infrastructure.
Introduced CommandLineContext class to encapsulate and expose command-line arguments within the bootstrapper infrastructure, providing a consistent interface for accessing args across all project types.
Added comprehensive unit test coverage for CommandLineContext, verifying null-arg handling, empty arrays, populated arrays, and reference preservation across multiple property accesses.
Unit tests for ConsoleHostedService and MinimalConsoleHostedService provide validation of service initialization and lifecycle management. These tests ensure that startup delegates are properly invoked and that logging is correctly handled in both traditional and minimal console application patterns.
Extract nested callback logic into focused private methods: StartRunAsync, RunAsync, ResolveLogger, LogRunAsyncStarted, LogUnableToActivate, and LogFatalError. This improves code clarity, testability, and maintainability by reducing complexity in StartAsync and making error-handling paths explicit.
Add v5.2.0 release notes to all four package release-note files documenting the new CommandLineContext infrastructure, comprehensive test coverage, dependency updates, build analyzer enhancements, and refactored hosted service implementations.
Document v5.2.0 release with new CommandLineContext infrastructure, comprehensive unit test coverage for console hosted services, all dependency upgrades to latest stable releases, build analyzer enhancements with warning suppressions, refactored service implementations for improved code clarity, and DocFX infrastructure updates.
@gimlichael gimlichael self-assigned this Jul 26, 2026
@greptile-apps

greptile-apps Bot commented Jul 26, 2026

Copy link
Copy Markdown

Greptile Summary

This release adds a command-line argument context and refreshes console hosting, dependencies, build settings, documentation, and tests.

  • Adds CommandLineContext with null-safe argument storage and API documentation.
  • Refactors both console hosted services into focused run and logging methods.
  • Adds console-service and command-line-context unit tests to the solution.
  • Updates package versions, release notes, analyzer configuration, and the DocFX nginx image.

Confidence Score: 4/5

The PR appears safe to merge, with only the previously reported release-description mismatch still outstanding.

The implementation and API example present CommandLineContext as a directly constructed argument holder, while the changelog continues to characterize it as bootstrapper infrastructure.

Files Needing Attention: CHANGELOG.md

Important Files Changed

Filename Overview
src/Codebelt.Bootstrapper/CommandLineContext.cs Adds a small public context type that retains supplied command-line arguments and substitutes an empty array for null.
src/Codebelt.Bootstrapper.Console/ConsoleHostedService.cs Extracts startup execution and lifecycle logging from the application-started callback into private methods.
src/Codebelt.Bootstrapper.Console/MinimalConsoleHostedService.cs Extracts program resolution, logger resolution, execution, and lifecycle logging into private methods.
Directory.Packages.props Advances centrally managed framework, Codebelt, Cuemon, and test SDK package versions.
test/Codebelt.Bootstrapper.Console.Tests/ConsoleHostedServiceTest.cs Adds coverage for deferred startup execution, host shutdown, lifecycle logging, and failed startup activation.
test/Codebelt.Bootstrapper.Console.Tests/MinimalConsoleHostedServiceTest.cs Adds coverage for deferred minimal-program execution, host shutdown, lifecycle logging, and failed activation.

Reviews (3): Last reviewed commit: "✨ update commandlinecontext description ..." | Re-trigger Greptile

Comment thread CHANGELOG.md Outdated
@codecov

codecov Bot commented Jul 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e8e1e7f) to head (f3298cf).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #35   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        22    +1     
  Lines          291       308   +17     
  Branches        23        29    +6     
=========================================
+ Hits           291       308   +17     

☔ View full report in Codecov by Harness.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gimlichael
gimlichael merged commit c054ebf into main Jul 27, 2026
24 checks passed
@gimlichael
gimlichael deleted the v5.2.0/add-cli-context branch July 27, 2026 00:35
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