Repository navigation
fix: take the verdict from the test service instead of up - #39
Merged
Merged
Conversation
The exit code of `up` comes from whichever container stops first, so app and db shut down after successful tests turned a green run red. `run --rm test` returns the test container's own exit code and still waits for depends_on with condition: service_healthy. Both commands now pass -f docker-compose.yml: the project image also carries docker-compose.override.yml, which switches app to its dev command. On failure the dependencies' logs are dumped, since `run` attaches to the test container only and server projects would otherwise lose their only clue. The test fixture moves to hexletprojects/hexlet-project-source-ci_en:latest — the bare tag is frozen at 2022 and has no test service. Hexlet ticket: FEEDBACK-299 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2 tasks
An unconditional `run --rm test` would be a flag day: the action is pinned by every student workflow as `hexlet/project-action@release`, and a project whose published image has no `test` service answers `no such service: test` with exit code 1 — indistinguishable from failing tests. Those projects still carry `command: make test` on `app`, so `up` reports their verdict correctly today. Detecting the service keeps them on `up` and moves only the projects that already have `test` — the ones falsely accepting right now, since their `app` has no command, exits 0 first and aborts the run before the tests finish. The same bridge is already live in the sibling runner (hexlethq/hexlet-project-source-ci, `gitlab-ci-template.yml` on `release`). The `up` branch goes away once every published image carries `test`. Hexlet ticket: DEVELOPMENT-432 (FEEDBACK-299)
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.
Hexlet ticket: DEVELOPMENT-432 (FEEDBACK-299)
What
Plus: dependencies' logs are dumped when the test run fails, and the test fixture moves to
hexletprojects/hexlet-project-source-ci_en:latest.Why
Projects are being accepted with failing tests right now. The rollout of the
testservice (FEEDBACK-299) movedcommand: make testoffapp, so a console project'sapphas no command, falls back to the base imageCMD, exits 0 within a second and triggers the abort. Without--exit-code-from,upreports the exit code of whichever container stopped the run — so the verdict is 0 while the tests are killed mid-flight. Reproduced onru/js_l2_differ3_project:runreturns the test container's own exit code and still waits fordepends_onwithcondition: service_healthy.--exit-code-fromis not the answer: it implies--abort-on-container-exit, which kills any service that exits before the tests, so a console project would have to keepappalive artificially.-f docker-compose.ymlon both commands. The setup step lacked it, which is already a bug:docker-compose.override.ymlships inside the project image and switchesappto its dev command. Withrun --rm testthe price goes up —appcomes up as a dependency, and its healthcheck may never pass under the dev command.Logs on failure.
up --abort-on-container-exitinterleavedapp/db/caddyoutput into the Actions log;run --rm testattaches to the test container only. That is exactly the diagnostics the server projects need.The fallback, and why it is not the reverted variant B
The action is pinned by every student workflow as
hexlet/project-action@release, and the monolith validates that literal string (app/schemas/github_action_project_check.json). Merging tomasterrebuildsreleaseand switches everyone at once — there is no gradual rollout and no per-project revert.An unconditional
run --rm testwould therefore be a flag day: a project whose published image has notestservice answersno such service: testwith exit code 1, indistinguishable from failing tests. Those projects still carrycommand: make testonapp, soupreports their verdict correctly today. Detecting the service keeps them where they are and moves only the projects that are broken:testtesttestupupThe check reads
docker compose config --servicesfrom the compose file unpacked out of the image, i.e. the same sourcerunwill use — so image-vs-git divergence cannot fool it.This is not variant B, reversed on 2026-08-17: that proposed auto-detect as the permanent contract, feeding
--exit-code-from. This is a temporary bridge with its removal condition written next to it, and the sibling runner already ships exactly this shape —hexlethq/hexlet-project-source-ci,gitlab-ci-template.ymlonrelease, merged 2026-08-24 (!9). Theupbranch goes away once every published image carriestest.State of the rollout (2026-08-25)
hexlethq/hexlet-project-source-ci!9merged;hexlet-project-source-ci_en:latestrepublished 2026-08-24, verified to carry thetestservice — the fixture here is green again.bin/agent/image-sweep.tsinhexlet-exercise-kit): 0 projects with an image older than the rollout commit.origin/HEAD:testpresent in 166 of 178 project repos; missing in 3esclones parked on branches with open MRs (data_analytics_charts,devops_bulletin_board_observability,php_testing_page_downloader); 8 have nodocker-compose.ymlat all.es) — those already fail atdocker pull, before any of this.With the fallback, none of the above blocks the merge: it is a strict improvement over the current behaviour for every project.
Campaign state lives in
hexlet-exercise-kit,docs/project-test-service.md. Supersedes #36.