ci: #3616588 Stop the Drupal CMS job republishing the shared build cache
Closes nothing on its own — a CI follow-up to the #3616588 merge, which left the 1.0.x pipeline red.
Problem
After !29 (merged) merged, all 15 🧪 varbase-e2e suites on 1.0.x fail before a single scenario runs:
Error: @cucumber/pretty-formatter does not export a function/class
at resolveImplementation (node_modules/@cucumber/cucumber/lib/formatter/resolve_implementation.js:23:15)The same suites were green on the merge request pipeline for the same tree, and retrying reproduces the failure, so it is not runner variance.
Root cause
📦 (Varbase) Install and 🧩 (Drupal CMS) Install both ran cache: *varbase_cache — the same key educare-build-v2-$CI_COMMIT_REF_SLUG, with the default pull-push policy — in parallel in the same pre-test stage.
Only the Varbase job runs npm install. The Drupal CMS job builds its own cmssite/ codebase and never touches node_modules or testsite/; it merely restores them from the cache and then, on success, uploads them again. Whichever job finishes last wins:
- Varbase job last -> the freshly installed
node_modulesis published. Test jobs pass. - Drupal CMS job last -> the stale restored
node_modulesis published over it. Test jobs pull a tree built beforepackage.jsongained itsoverrides, which resolves@cucumber/cucumber13.2.1 against the pinned@cucumber/pretty-formatter1.0.1 — the pair that throws the error above.
The cache key is per ref, which is why the MR ref and 1.0.x behaved differently on identical code.
Verified locally: a fresh install honours the overrides and yields cucumber 12.9.0 + pretty-formatter 1.0.1, where the formatter resolves correctly; forcing the 13.2.1 + 1.0.1 pair reproduces the error verbatim.
Change
Give the Drupal CMS job its own cache key with composer downloads only, so it can no longer republish node_modules/testsite:
.cms_cache: &cms_cache
key: "educare-cms-v1-$CI_COMMIT_REF_SLUG"
paths:
- .cache/composerOne anchor added, one cache: reference changed. No job logic touched.
Note: the currently stored educare-build-v2-1-0-x cache is already poisoned, so the runner caches should be cleared once (Settings -> CI/CD -> Clear runner caches) so the first pipeline after this merge rebuilds node_modules cleanly.
Testing
gitlab-ci-local on the changed file: config parses and the schema validates, 📐 YAML lint PASS (348 YAML files, 0 invalid), 📦 Composer validate PASS.
AI-Generated: Yes
Checkpoints:
- File an issue
- Addition/Change/Update/Fix
- Testing to ensure no regression
- Automated unit testing coverage
- Automated functional testing coverage
- UX/UI designer responsibilities
- Readability
- Accessibility
- Performance
- Security
- Developer Documentation
- User Guide Documentation
- Reviewed by human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Release notes snippet
- Release