fix: project rig dolt env into exec-backed controller stores#1767
fix: project rig dolt env into exec-backed controller stores#1767sjarmak merged 3 commits intogastownhall:mainfrom
Conversation
sjarmak
left a comment
There was a problem hiding this comment.
Thanks @azanar — direct parity port of the openStoreAtForCity rig branch into controllerState.openRigStore(). Eliminates the 127.0.0.1:0 divergence on cached/controller rig-store ops without expanding blast radius, and reuses the in-hand cfg instead of loadCityConfig-ing again (small efficiency win over the direct path). The positive case is covered by TestControllerStateOpenRigStoreExecProjectsRigTarget; the negative case (non-bd exec providers don't get the projection) is implicitly covered by the same test's leak check. Good to merge.
Sibling-batch context: complementary to #1766 (which hardens the upstream resolvedRuntimeCityDoltTarget that bdRuntimeEnvForRig resolves through). No conflict; merge order doesn't matter.
Future cleanup (don't block on it): the two rig branches now share ~12 lines of env-projection logic — worth an applyExecRigDoltEnv(...) helper once a third caller appears.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Summary
This fixes rig-scoped exec-backed controller stores so they receive the same projected Dolt environment that one-shot scoped store opens already receive.
What changed
controllerState.openRigStore()to inject scoped Dolt host/port env for exec providers that use the bd store contractexec:gc-beads-bdrig stores opened through the controller pathWhy
openStoreAtForCity()already projects scoped Dolt env forexec:gc-beads-bd, but the controller's long-lived rig store path did not. That let rig-scoped cached/controller store operations diverge from directgc bd --rig ...behavior and still resolve to127.0.0.1:0in later reconcile/order-dispatch paths.This makes the controller path use the same scoped target projection as the direct store-open path.
Tests
go test ./cmd/gc -run 'TestControllerState(OpenRigStoreExecProjectsRigTarget|OpenRigStoreExecBdProjectsRigDoltEnv)|TestOpenStoreAtForCityExecUsesUniversalStoreTargetEnv' -count=1Need help on this PR? Tag
@codesmithwith what you need.