Files
Nicolas De Loof 039413cc77 fix(start): still refuse a job when COMPOSE_PROJECT_NAME masks the error
projectOrName falls back to a label-driven, file-less project on any
load failure when COMPOSE_PROJECT_NAME is set -- swallowing the load
error entirely, including "no such service" for a target that's
actually a declared job. Since that branch returns err == nil,
jobTargetErr (gated on err != nil) and rejectScheduledJobs (gated on
project != nil) were both skipped: `docker compose start migrate`
fell through to a label-driven start that finds no container for a
job that was never run, and exited 0 having silently done nothing.

Refuse a named job explicitly on that fallback path too, reusing
unselectedJobs from the previous commit.

Also adds the test coverage this and the previous fix (job-target
error messages on create/start) were entirely missing: create.go and
start.go had no unit tests at all, and pkg/e2e/jobs_test.go only
exercised up/run.

Signed-off-by: Nicolas De Loof <[email protected]>
2026-09-21 16:35:20 +02:00

11 lines
174 B
YAML

services:
web:
image: alpine
command: sleep infinity
jobs:
migrate:
image: alpine
command: sh -c 'echo "migration done"'
triggers:
manual: true