Improve HealthCheck in Boilerplate (#12299)#12314
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe PR refactors health check implementation to separate storage validation concerns, improve caching behavior, and centralize health check registration. It introduces dependencies for health-check packages, implements UserProfileImagesStorageHealthCheck with domain-specific messaging, creates a new AddServerApiHealthChecks extension method that conditionally registers checks for external services, and configures a 10-second cache expiry policy while explicitly naming the disk storage health check. ChangesHealth Check Refactoring and Cloudflare Cache Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@src/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cs`:
- Around line 780-785: The readiness URL checks using
healthChecksBuilder.AddUrlGroup for Cloudflare (with
appSettings.Cloudflare.ZoneId and cloudflareApiToken) and for Keycloak should
set an explicit short HttpClient.Timeout to avoid long hangs; update the
configureClient lambda for the Cloudflare AddUrlGroup to also set client.Timeout
= TimeSpan.FromSeconds(2) (or another small sensible value) when adding the
Authorization header, and add a configureClient for the Keycloak AddUrlGroup
that sets client.Timeout = TimeSpan.FromSeconds(2) as well (and any required
headers), so both URL-based health checks have bounded short timeouts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 665c06f6-6c44-4149-9ffb-7940d8fdc9bf
📒 Files selected for processing (5)
src/Templates/Boilerplate/Bit.Boilerplate/src/Directory.Packages.propssrc/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Boilerplate.Server.Api.csprojsrc/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Infrastructure/Services/UserProfileImagesStorageHealthCheck.cssrc/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Api/Program.Services.cssrc/Templates/Boilerplate/Bit.Boilerplate/src/Server/Boilerplate.Server.Shared/Infrastructure/Extensions/WebApplicationBuilderExtensions.cs
closes #12299
Summary by CodeRabbit
Release Notes