Skip to content

Scope CI image pulls to each job's real dependencies#56

Merged
turegjorup merged 3 commits into
developfrom
ci/scope-ci-image-pulls
Jul 8, 2026
Merged

Scope CI image pulls to each job's real dependencies#56
turegjorup merged 3 commits into
developfrom
ci/scope-ci-image-pulls

Conversation

@turegjorup

Copy link
Copy Markdown
Contributor

Every workflow job pulled and started the whole compose stack (mariadb, phpfpm, nginx, mail, rabbit, elasticsearch, markdownlint, prettier) even when it only needed PHP. This scopes each job to what it actually uses.

Changes

  • api-spec export — was task site:update (pull/up everything). Now pulls only phpfpm and runs the export as a one-off docker compose run --rm --no-deps phpfpm … (drops the Task setup).
  • PHPStan and Rector (pr.yaml) — pull only phpfpm, run via run --rm --no-deps (matches the templated composer/php/twig workflows; no lingering container, no healthcheck wait).
  • API test (pr.yaml) — pulls only phpfpm elasticsearch and starts them with up --wait --no-deps (Elasticsearch must be a running service the tests connect to).

--no-deps stops phpfpm's mariadb/rabbit depends_on from starting the rest of the stack.

Validation

  • Full suite (254 tests) passes with mariadb and rabbit stopped → API test needs only phpfpm + elasticsearch.
  • Tests reference no Doctrine/DB and ApiTestCase uses the in-process kernel (not real HTTP), so nginx and mariadb aren't needed.
  • docker compose run --rm --no-deps phpfpm … verified locally; YAML prettier-clean.

Audit note

The templated workflows (composer, php, twigrun --rm phpfpm; markdownmarkdownlint; yamlprettier) and build_release (run --rm phpfpm) were already scoped; changelog and index-mapping-drift use no containers. Only the repo-owned api-spec.yml and pr.yaml over-pulled.

Every job pulled and started the whole compose stack (mariadb, phpfpm,
nginx, mail, rabbit, elasticsearch, …). Scope each to its real deps:

- api-spec export, PHPStan, Rector → phpfpm only, as one-off
  `docker compose run --rm --no-deps phpfpm …` (no lingering container,
  matching the templated composer/php/twig workflows)
- API test → phpfpm + elasticsearch via `up --wait --no-deps` (ES must be
  a running service the tests connect to)

Pull only the needed images; --no-deps stops phpfpm's mariadb/rabbit
dependencies from dragging the rest of the stack in. The api-spec job now
drives docker compose directly, dropping the Task setup that ran
`site:update` (= pull/up everything). Verified: the full suite passes with
mariadb and rabbit stopped; tests reference no Doctrine/DB and ApiTestCase
uses the in-process kernel, so nginx is not needed either.
@turegjorup turegjorup merged commit 2df028e into develop Jul 8, 2026
12 checks passed
@turegjorup turegjorup deleted the ci/scope-ci-image-pulls branch July 8, 2026 15:24
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.89%. Comparing base (191e1ed) to head (d4463c7).
⚠️ Report is 33 commits behind head on develop.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop      #56      +/-   ##
=============================================
- Coverage      72.99%   72.89%   -0.10%     
  Complexity       232      232              
=============================================
  Files             29       29              
  Lines            648      653       +5     
=============================================
+ Hits             473      476       +3     
- Misses           175      177       +2     
Flag Coverage Δ
unittests 72.89% <ø> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants