From c45cb9b76b25917b3c120da1cc0f6a06bd73f81e Mon Sep 17 00:00:00 2001 From: Nikolay Gagarinov Date: Wed, 26 Aug 2026 00:24:24 +0500 Subject: [PATCH] =?UTF-8?q?chore:=20DEVELOPMENT-432=20=D1=81=D0=BD=D1=8F?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B2=D0=B5=D1=82=D0=BA=D1=83=20up,=20=D1=81?= =?UTF-8?q?=D0=B5=D1=80=D0=B2=D0=B8=D1=81=20test=20=D0=B5=D1=81=D1=82?= =?UTF-8?q?=D1=8C=20=D0=B2=D0=BE=20=D0=B2=D1=81=D0=B5=D1=85=20=D0=BE=D0=B1?= =?UTF-8?q?=D1=80=D0=B0=D0=B7=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ветка отката существовала, пока сервис был не во всех опубликованных образах. Сверка 26.08.2026: сервис test несут все 106 образов, которые вообще опубликованы, и он есть в git у всех 169 проектов, где есть docker-compose.yml. Остальные девять не доживают до выбора команды — падают на разборе compose. Откат оставлять вредно: проект, потерявший сервис test, тихо уезжал бы обратно на up, а это тот самый путь, на котором красные тесты зачитываются. --- src/index.js | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/src/index.js b/src/index.js index 5341600..9d893cc 100644 --- a/src/index.js +++ b/src/index.js @@ -151,26 +151,12 @@ const check = async ({ projectSourcePath, codePath, projectMember }) => { // NOTE: The verdict is the exit code of the test service. up would report the // exit code of whichever container stopped first, so app and db shut down // after successful tests turned a green run red. - // - // The service is not in every project image yet, so the step falls back to up. - // Without the fallback the merge would be a flag day: run --rm test on a - // project without the service exits 1, and "no such service" is - // indistinguishable from failing tests. The up branch goes away once every - // published image carries test. Mirrors hexlet-project-source-ci's template. - const { stdout: serviceList } = await exec.getExecOutput( - 'docker compose', - [...composeFile, 'config', '--services'], - options, - ); - const hasTestService = serviceList - .split('\n') - .map((name) => name.trim()) - .includes('test'); - const verdictArgs = hasTestService - ? [...composeFile, 'run', '--rm', 'test'] - : [...composeFile, 'up', '--abort-on-container-exit']; try { - await exec.exec('docker compose', verdictArgs, options); + await exec.exec( + 'docker compose', + [...composeFile, 'run', '--rm', 'test'], + options, + ); } catch (err) { // NOTE: run attaches to the test container only, so logs of the services it // waited for are the only clue left for a failing server project.