Repository navigation
chore(compose): single-source the FDB port numbers (#189) - #194
Open
IG-ABHINAV wants to merge 1 commit into
Open
IG-ABHINAV wants to merge 1 commit into
IG-ABHINAV wants to merge 1 commit into
Conversation
The five FDB_*_CONTAINER_PORT values in .env are now the only place a port number is written. docker-compose.yml references them for each service FDB_PORT, the host port-mapping target and default, and the coordinator string; the compose file contains no port literals. bin/host-cluster-file.sh builds the host-side cluster file from the same values, and ComposeFdbPortSingleSourceTest fails if a literal returns to docker-compose.yml. Verified: docker compose config -q, full Unit suite (622 tests / 1215 assertions green, 36 env skips), phpstan clean, php-cs-fixer clean on the new test, shellcheck clean on the new script.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Closes the port-number triplication from #189: the five
FDB_*_CONTAINER_PORTvalues in a committed.envare now the only place an FDB port number is written.How
.env(new, committed): the five container ports (4500,4501,4502,4510,4511) asFDB_*_CONTAINER_PORT— the single source of truth.docker-compose.yml: every hardcoded port literal is gone.FDB_PORT, theports:mapping target, the mapping default (${FDB_COORD_1_PORT:-${FDB_COORD_1_CONTAINER_PORT}}) and thex-fdb-cluster-filecoordinator string all read those variables, so changing one value in.envupdates the service env, the host mapping and the cluster string together.bin/host-cluster-file.sh(new): prints the host-side cluster file (127.0.0.1:<mapped port>) from the same values, honouring theFDB_COORD_*_PORThost overrides.tests/Unit/ComposeFdbPortSingleSourceTest.php(new, 5 tests): guards the single source —.envdefines each port exactly once,docker-compose.ymlcontains no port literal, the compose references and the host-cluster script stay in sync.AGENTS.md/CHANGELOG.md: document the new source of truth and the.envvs.env.worktreeprecedence (exported shell env still wins, matching Docker Compose).Verification (local)
docker compose config -q${VAR:-${OTHER}}interpolation)vendor/bin/phpunit --testsuite Unitvendor/bin/phpunit --filter ComposeFdbPortSingleSourceTestvendor/bin/phpstan analyse[OK] No errorsvendor/bin/php-cs-fixer fix --dry-run(new file)Found 0 of 1 filesto fixshellcheck bin/host-cluster-file.shRan in a PHP container with the
gmpextension (unit tests needext-gmpfor the Tuple cases; without it 19 unrelated Tuple tests error — with it the suite is fully green, so there are no pre-existing failures in scope).Judgment calls (please flag if you'd prefer otherwise)
.envas the source rather thanx-…-portanchors (the alternative in the issue):.envalso servesbin/host-cluster-file.shand any host-side client, which anchors alone would not;.envis not gitignored in this repo (only/.env.worktreeis), and the new unit test pins it so it cannot drift. Easy to switch to anchors if you'd rather not commit a.env..github/workflows/ci.ymlnot touched: my tooling cannot push workflow-file changes, so the e2e job still writes its host cluster file inline (ci.yml:185).bin/host-cluster-file.shbuilds the identical file from the same source — calling it from the workflow is a one-line follow-up (documented inAGENTS.md). Because of this I could not run the repo'sbin/lint.shend-to-end locally (it needs the repo's pinned toolchain downloads); its individual PHP steps (phpstan,php-cs-fixer) andshellcheckwere run and are green.No integration/e2e stack was started locally (
docker compose config -qused for compose validation); a fresh-stack health check needs CI.