V5.1.0/service update#31
Conversation
Greptile SummaryThis PR delivers v5.1.0, adding
Confidence Score: 5/5Safe to merge; all changes are scoped to local development configuration, dependency bumps, and CI improvements with no production logic altered. The core logic change — UseBootstrapperEnvironmentDefaults — only activates in a LocalDevelopment environment, limiting any runtime impact. The incomplete exception catch in HostApplicationBuilderExtensions is a narrow edge case and does not affect non-local environments. Package bumps follow the established minor-version cadence, and the CI quality gate addition strengthens the pipeline. src/Codebelt.Bootstrapper/HostApplicationBuilderExtensions.cs — the Assembly.Load catch block could be broadened to cover FileLoadException and BadImageFormatException. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Program.CreateHostBuilder] --> B[UseBootstrapperLifetime]
B --> C{IHostApplicationBuilder\nor IHostBuilder?}
C -- IHostApplicationBuilder --> D[UseBootstrapperEnvironmentDefaults\nHostApplicationBuilderExtensions]
C -- IHostBuilder --> E[UseBootstrapperEnvironmentDefaults-TStartup\nHostBuilderExtensions]
D --> F{IsLocalDevelopment?}
E --> F
F -- No --> G[Return unchanged]
F -- Yes --> H{ApplicationName\npresent?}
H -- No --> G
H -- Yes --> I[Read hostBuilder:reloadConfigOnChange]
I --> J{IHostApplicationBuilder path?}
J -- Yes --> K[Assembly.Load applicationName]
K --> L{FileNotFoundException?}
L -- Yes --> G
L -- No --> M[AddUserSecrets from assembly]
J -- No --> N[AddUserSecrets-TStartup]
M --> O[Return hostBuilder]
N --> O
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
src/Codebelt.Bootstrapper/HostApplicationBuilderExtensions.cs:44-52
**Incomplete exception handling for `Assembly.Load`**
Only `FileNotFoundException` is caught, but `Assembly.Load` can also throw `FileLoadException` (e.g., version conflict, strong-name validation failure) and `BadImageFormatException` (malformed assembly). Either of these would propagate as an unhandled exception and crash application startup, even though the intent is to silently skip when the assembly cannot be used. While the local-development-only guard limits the blast radius, the pattern is inconsistent with the handling goal described in the catch comment.
### Issue 2 of 2
src/Codebelt.Bootstrapper.Console/ConsoleProgram.cs:19-23
**Inconsistent position of `UseBootstrapperEnvironmentDefaults` across Program classes**
In `ConsoleProgram`, `UseBootstrapperEnvironmentDefaults<TStartup>()` is placed after `UseBootstrapperStartup<TStartup>()`, whereas in `WorkerProgram` it comes before `UseBootstrapperStartup<TStartup>()`. These two extension methods use different builder phases (`ConfigureAppConfiguration` vs `ConfigureServices`), so there is no functional difference in this case. However, the inconsistency may mislead readers about the intended ordering convention and could matter if the position is ever changed to `ConfigureServices` in the future.
Reviews (3): Last reviewed commit: "✨ add UseBootstrapperEnvironmentDefaults..." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #31 +/- ##
============================================
+ Coverage 83.84% 100.00% +16.15%
============================================
Files 20 21 +1
Lines 260 291 +31
Branches 19 23 +4
============================================
+ Hits 218 291 +73
+ Misses 42 0 -42 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Update Microsoft.NET.Test.Sdk from 18.4.0 to 18.6.0, coverlet packages from 10.0.0 to 10.0.1, and framework packages (net9 and net10) to latest available versions.
Update nginx base image from 1.30.0-alpine to 1.31.0-alpine for documentation publishing.
Enable optional macOS test matrix for X64 and ARM64 architectures across Debug and Release configurations. Add test quality gate job to validate all test suites (Linux, Windows, optional macOS) before publishing and security analysis. Decouple test dependencies in sonarcloud, codecov, and codeql jobs.
Document the prohibition against using ExcludeFromCodeCoverage attribute on any code path. Establish that all executable lines should be covered by tests or be genuinely unreachable, and provide alternative approaches for handling untestable code paths.
Add comprehensive test coverage across bootstrapper modules: console, web, and worker application templates. Introduce new unit and functional tests for program creation, startup configuration, hosted service initialization, and lifetime management. Add test assets and factory helpers (NullStartupFactory, TestConsoleProgram, TestWebProgram, TestWorkerProgram) to support test scenarios. Expand ConsoleHostedServiceTest and BootstrapperLifetimeTest with additional test cases.
Add test coverage for bootstrapper log message validation and startup messaging behavior.
Release notes and changelog updated to reflect v5.1.0 as a minor release focused on environment configuration defaults for local development, expanded test coverage to 95 percent, dependency updates across all supported target frameworks, CI pipeline improvements for macOS testing, and code coverage policy documentation.
Introduce new UseBootstrapperEnvironmentDefaults extension methods on HostApplicationBuilderExtensions and HostBuilderExtensions to add conventional environment defaults and user secrets for local development. Add internal HostEnvironmentExtensions helper for environment detection. Integrate the new method into all application templates (console, web, worker) and expand functional test coverage for the new extension methods.
|



This is a service update that focuses on package dependencies.
Automated changes:
Note: Third-party packages (Microsoft.Extensions.*, BenchmarkDotNet, etc.) are not auto-updated.
Use Dependabot or manual updates for those.
Generated by codebelt-aicia
Triggered by: swashbuckle-aspnetcore @ 10.2.1