Fix prod/CI Makefile targets and run image build on PRs#818
Draft
malberts wants to merge 7 commits into
Draft
Conversation
alistair3149
added a commit
that referenced
this pull request
May 12, 2026
Establishes Docker/tests/ as the home for shell-script tests at the Docker layer, keeping the top-level tests/ subtree PHP-only. * Docker/test.sh -> Docker/tests/smoke.sh. Renamed to a descriptive name (was ambiguous "test.sh"), and now resolves Docker/.env relative to its own script directory so it can be invoked from anywhere. * Docker/tests/test-set-port.sh added. Locks in the coverage matrix from the previous commit as an executable regression suite, catching the Morne fresh-clone bug and the three new behaviours of the fix: idempotent re-run, explicit-port-validation, and out-of-range override protection. Uses python3 to hold contested ports (backlog 128 + accept-and-close loop to avoid kernel SYN drops once the accept queue fills). Allocates into a high MW range (38484-38499) so a busy 8484-8499 on the host does not perturb assertions. * New `make test-scripts` target runs the regression suite. Kept out of `make test` / `make ci` so it does not become a CI gate on the first iteration. Promote to CI after a few sprints once stability is confirmed. Note: PR #818's draft `smoke-test` target needs to point at `Docker/tests/smoke.sh` after this lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
Member
|
Heads-up — PR #820 renames
|
malberts
pushed a commit
that referenced
this pull request
May 13, 2026
Establishes Docker/tests/ as the home for shell-script tests at the Docker layer, keeping the top-level tests/ subtree PHP-only. * Docker/test.sh -> Docker/tests/smoke.sh. Renamed to a descriptive name (was ambiguous "test.sh"), and now resolves Docker/.env relative to its own script directory so it can be invoked from anywhere. * Docker/tests/test-set-port.sh added. Locks in the coverage matrix from the previous commit as an executable regression suite, catching the Morne fresh-clone bug and the three new behaviours of the fix: idempotent re-run, explicit-port-validation, and out-of-range override protection. Uses python3 to hold contested ports (backlog 128 + accept-and-close loop to avoid kernel SYN drops once the accept queue fills). Allocates into a high MW range (38484-38499) so a busy 8484-8499 on the host does not perturb assertions. * New `make test-scripts` target runs the regression suite. Kept out of `make test` / `make ci` so it does not become a CI gate on the first iteration. Promote to CI after a few sprints once stability is confirmed. Note: PR #818's draft `smoke-test` target needs to point at `Docker/tests/smoke.sh` after this lands. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e00ca44 to
2fa17a6
Compare
PR #811 made install-db, load-neo4j-users, and wait-for-neo4j depend on test_neo, which is profile-gated to dev. Both CI (against docker-compose.ci.yml) and the VPS upgrade flow (against docker-compose.yml) now fail at the 60s test_neo wait. CI on master has been red since the merge. Decouple test_neo from the shared targets: - wait-for-neo4j and load-neo4j-users now wait/configure only `neo`. - A new dev-only setup-test-neo target waits for and seeds test_neo. It is explicitly chained by _first-run-seed and reset (the only dev call sites). - EXEC_MW_ROOT/EXEC_MW switch from $(DC_DEV) to $(DC). docker compose exec attaches by project+service to the already-running mediawiki container, so this works in both dev and prod without overlay coupling. Add two new targets: - `update` for VPS upgrades: pull, up -d with --profile server, update.php. - `smoke-test` wrapping Docker/test.sh for CI. Update build-docker.yml: drop working-directory: Docker from the make steps so they pick up the top-level Makefile, switch the start step to `make up` so the docker compose project name matches subsequent make invocations, rename the test step to `make smoke-test`. Add pull_request trigger and concurrency cancellation so the build runs (without ghcr push) on every PR and catches regressions like this one before merge. Verified locally: full `make dev` cycle succeeds (including setup-test-neo); `make up && make install-db && make load-neo4j-users && make smoke-test` succeeds end-to-end against the prod stack. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GitHub Actions defaults to 360 min per job. Successful runs of this workflow take ~5 min, and the internal wait-for-it.sh / docker healthcheck timeouts already bound runtime, so an explicit 20-min cap added nothing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
docker compose up -d returns when containers are started, not when they are ready. update.php would race the db on the first invocation after a recreate and fail with "Connection refused (db:3306)". Add the same wait-for-it.sh pattern install-db uses. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The repo is public, so GitHub Actions minutes are effectively unlimited and the stale-run savings are symbolic. No other workflow in the repo uses concurrency, so introducing it just here was inconsistent for no real gain. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replaces the complicated `docker compose --profile server -p neowiki-neowiki --project-directory Docker up -d` invocation in Docker/README.md. The explicit project name was needed so that subsequent `make install-db` etc. would attach to the same containers; wrapping it in a target keeps the project-name plumbing out of the docs. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The script moved from Docker/test.sh to Docker/tests/smoke.sh and now resolves Docker/.env relative to its own location, so it can be invoked from any directory. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2fa17a6 to
99769ad
Compare
PR #829 (88a1121) dropped `--project-directory Docker` from the DC line to unblock podman-compose, but only DC_DEV carried the compensating `-f Docker/docker-compose.yml`. Bare $(DC) (used by `up`, `server-up`, `load-neo4j-users`, EXEC_MW_ROOT) was left with no way to locate the compose file when invoked from the repo root, so the CI "Start containers" step (`make up`) failed with "no configuration file provided: not found". Move `-f Docker/docker-compose.yml` onto the DC line and drop the now-duplicate flag from DC_DEV. DC_DEV/DC_TOOLS render identically to before (verified via `make -n`); bare $(DC) now resolves from root, podman-safe (no --project-directory). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
PR #811 made
install-db,load-neo4j-users, andwait-for-neo4jdepend ontest_neo, which is profile-gated to dev. Both CI (againstdocker-compose.ci.yml)and the VPS upgrade flow (against
docker-compose.yml) now fail at the 60stest_neowait. CI on master has been red since the merge.Decouple
test_neofrom the shared targets:wait-for-neo4jandload-neo4j-usersnow wait/configure onlyneo.setup-test-neotarget waits for and seedstest_neo. It isexplicitly chained by
_first-run-seedandreset(the only dev call sites).EXEC_MW_ROOT/EXEC_MWswitch from$(DC_DEV)to$(DC).docker compose execattaches by project+service to the already-running
mediawikicontainer, sothis works in both dev and prod without overlay coupling.
Add two new targets:
updatefor VPS upgrades: pull, up -d with--profile server, wait for dband neo readiness, then update.php.
smoke-testwrappingDocker/test.shfor CI.Update
build-docker.yml: dropworking-directory: Dockerfrom the make stepsso they pick up the top-level Makefile, switch the start step to
make upsothe docker compose project name matches subsequent make invocations, rename
the test step to
make smoke-test. Addpull_requesttrigger so the buildruns (without ghcr push) on every PR and catches regressions like this one
before merge.
Test plan
make devcycle from a fresh/tmpcheckout (port 8500). Wikiresponds 200;
setup-test-neoseeded test_neo./tmpcheckout (port 8501):make up && make install-db && make load-neo4j-users && make smoke-test && make import-demo-data. Wiki responds 200.make resetafter a dev setup. Chain completes including the newsetup-test-neostep.make updateend-to-end against a fresh prod stack (with Caddy portsremapped to 8080/8443 to avoid host conflicts on a dev machine).
Pull + up + db/neo readiness wait + update.php all succeed.