Repository navigation
fix(apphost): disable Wolverine AutoProvision for the Service Bus emulator - #146
Conversation
…lator (local dev) The four Wolverine services (order/payment/shipping/notification) crash-looped on every local AppHost run with: Wolverine.Transports.BrokerInitializationException: Unable to initialize the Broker asb in time Root cause: AutoProvision() (default on) provisions topics/subscriptions via the Service Bus MANAGEMENT API (ServiceBusAdministrationClient.QueueExistsAsync). The Service Bus emulator implements only the AMQP data plane — not the management API — so every check fails, retries 4×, blows the broker-init timeout, and the host dies on startup. Sub-second, deterministic, all four Wolverine services; catalog has no ASB so it survives (which made it look selective and sent the earlier debugging toward a dev-cert red herring). Locally the topology is already declared in AppHost.cs (AddServiceBusTopic / AddServiceBusSubscription write the emulator's config), so provisioning is impossible AND redundant. The integration-test harnesses already discovered this and set Wolverine:AutoProvision=false; the local AppHost run never did. Fix: AppHost injects Wolverine__AutoProvision=false into each Wolverine service. In Publish mode against real Azure the flag stays true (provisioning creates the entities). Encoded the trap in CLAUDE.md next to the existing emulator rules + corrected the now-stale 'test-only' framing in each service's Program.cs comment. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR disables Wolverine Service Bus auto-provisioning in local development by injecting ChangesService Bus Auto-Provision Configuration
Sequence Diagram(s)(omitted — changes are configuration, comments, and per-service wiring without a complex multi-component runtime flow that requires a sequence diagram) Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
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 `@CLAUDE.md`:
- Line 230: The CLAUDE.md reference to the Wolverine AutoProvision guidance is
stale; either add the full rationale and mitigation to docs/architecture.md or
change the CLAUDE.md pointer to the correct doc; specifically, document that
Wolverine's AutoProvision() (Wolverine:AutoProvision) uses
ServiceBusAdministrationClient which the Service Bus emulator lacks (causing
BrokerInitializationException and retries), show the AppHost pattern that
injects Wolverine__AutoProvision=false for local/dev (and that production
Publish mode leaves it enabled), and include the mention of
AddServiceBusTopic/AddServiceBusSubscription being the local topology
declaration so provisioning is redundant.
🪄 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: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 1a04ee2e-915c-4788-ab45-fc14e9c4c44e
📒 Files selected for processing (6)
CLAUDE.mdNextAurora.AppHost/AppHost.csNotificationService/Program.csOrderService/Program.csPaymentService/Program.csShippingService/Program.cs
…Notification Second half of 'local full-stack never actually ran' (companion to the AutoProvision fix in this branch). Order/Payment/Shipping/Notification had NO launchSettings.json — only CatalogService, AppHost, and the two frontends did. Without a launch profile's applicationUrl, Aspire has no HTTP endpoint to assign, injects no ASPNETCORE_URLS, and the service falls back to the framework default http://localhost:5000. All four then collide on 5000 (and with macOS AirPlay Receiver, which squats on *:5000) — only the first to bind survives, the rest die with 'address already in use'. Each service gets an http profile with a distinct base port (5190-5193), mirroring CatalogService's. Aspire reassigns dynamic proxy ports at runtime; the profile just gives it an endpoint to manage so nothing defaults to 5000. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses CodeRabbit on #146: the CLAUDE.md AutoProvision rule pointed at docs/architecture.md Infrastructure section, but the behavior wasn't actually documented there (dangling cross-reference). Adds the subsection so the pointer resolves — why AutoProvision is disabled locally, the emulator's missing management API, and the Publish-mode-keeps-it-on distinction. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
The four Wolverine services (order / payment / shipping / notification) crash-loop on every local AppHost run with:
Root cause
AutoProvision()(default on) provisions topics/subscriptions via the Service Bus management API (ServiceBusAdministrationClient.QueueExistsAsync). The Service Bus emulator implements only the AMQP data plane — not the management API, so every check fails, retries 4×, blows the broker-init timeout, and the host dies on startup. Sub-second, deterministic, all four Wolverine services; catalog has no ASB so it survives (which made it look selective and sent earlier debugging toward a dev-cert red herring).Locally the topology is already declared in
AppHost.cs(AddServiceBusTopic/AddServiceBusSubscriptionwrite the emulator's config), so provisioning is impossible AND redundant. The integration-test harnesses already hit this and setWolverine:AutoProvision=false— the local AppHost run just never did.Fix
AppHost.csinjectsWolverine__AutoProvision=falseinto each Wolverine service. In Publish mode against real Azure the flag staystrue(provisioning creates entities).RunAsEmulator,WithReference≠WaitFor).Program.csAutoProvision comment.Verification
dotnet buildclean (0 warnings, analyzers-as-errors). Booting the AppHost with this change brings all four Wolverine services to Running (verified locally as part of the frontend Phase-2 live walkthrough).Notes
🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
Documentation