fix: serve crash with --publisher-http-enabled (TS-456)#1419
Conversation
go-libs v5.3.2's authnfx.JWTModule (loaded unconditionally by serve) and
messagingfx.HTTPModule both supply an unnamed *http.Client at the parent
fx scope. uber/fx rejects the duplicate provider, so ledger serve
crashes at startup with:
cannot provide *http.Client from [0]: already provided by "reflect".makeFuncStub
Pull in the go-libs fix (formancehq/go-libs#651) via a `replace`
directive on a v5.3.2-based cherry-pick of the fix. Drop the replace
and bump to v5.3.3 (or v5.4.x) once tagged.
Adds an e2e regression test that boots ledger serve with
--publisher-http-enabled and asserts startup succeeds.
Refs: TS-456
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (6)
📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughA new integration test file is added under ChangesHTTP Publisher Boot Regression Test
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" 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 |
NumaryBot
left a comment
There was a problem hiding this comment.
✅ Approve — automated review
The dependency replacement and regression test are consistent with the described startup conflict fix, and I did not find any introduced issues that would break existing behavior.
No findings.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1419 +/- ##
==========================================
+ Coverage 80.55% 80.66% +0.11%
==========================================
Files 206 206
Lines 11293 11257 -36
==========================================
- Hits 9097 9081 -16
+ Misses 1645 1622 -23
- Partials 551 554 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
go-libs#651 is merged and v5.5.0 is tagged. Drop the temporary `replace` directive and bump to the released version.
|
go-libs#651 merged + tagged as v5.5.0. |
NumaryBot
left a comment
There was a problem hiding this comment.
✅ Approve — automated review
The dependency bump includes the upstream fx scoping fix and the added e2e test exercises startup with the HTTP publisher enabled. I did not find a discrete regression introduced by these changes.
No findings.
NumaryBot
left a comment
There was a problem hiding this comment.
✅ Approve — automated review
The change bumps go-libs to a version containing the fx scoping fix and adds a targeted integration regression test. I did not identify any discrete issue introduced by the diff that would break existing behavior.
No findings.
NumaryBot
left a comment
There was a problem hiding this comment.
✅ Approve — automated review
The dependency bump and regression test align with the reported fx provider conflict, and I did not identify a discrete regression introduced by these changes.
No findings.
Summary
Same fix as #1418 (
release/v2.4) and #1417 (release/v2.3), now onmain.ledger servecrashes at startup whenever--publisher-http-enabled(orPUBLISHER_HTTP_ENABLED=true) is set, with the error `cannot provide *http.Client from [0]: already provided by "reflect".makeFuncStub`.cmd.NewServeCommandloadsauthnfx.JWTModuleFromFlagsunconditionally (which always supplies a*http.Client);messagingfx.HTTPModulesupplies another one as soon as the HTTP publisher is enabled; uber/fx rejects the duplicate.replacedirective on a v5.3.2-based cherry-pick of the fix commit (minimal diff vsv5.3.2).test/e2e/app_publisher_http_jwt_test.go) that boots ledger with--publisher-http-enabledand asserts startup succeeds.Follow-up (before / after merge)
v5.3.3(orv5.4.x) on go-libs.replacedirective ingo.modwith a regular bump to the released version. The// TS-456comment ingo.modflags it.Customer impact
Reported by Mews on TS-456.
Test plan
test/e2e/app_publisher_http_jwt_test.go(-tags=it) fails onmainhead with the exact provider-conflict error.replacedirective applied.go build ./...clean.replaceforrequire v5.3.3once go-libs releases.Related PRs