fix: #3622114 Clear the restored cmssite directory before composer create-project
Problem
The pipeline on 1.0.x is red. Pipeline 955433 on 1.0.x (commit 78af4e7f) fails the 🧩 Drupal CMS - Horizon Aid job before any Drupal command runs:
In CreateProjectCommand.php line 394:
Project directory "/builds/project/horizonaid/cmssite" is not empty.Cause
#3622094 moved the build cache from testsite/ to cmssite/, so .build_cache now restores the built site into $SITE_DIR, and composer create-project refuses a non-empty target.
The deleted varbase_project job carried exactly this guard, with the comment "The build cache may restore a stale testsite/; composer create-project refuses a non-empty target, so start from a clean dir on every run", and it was lost together with that job. The Drupal CMS job never needed it before, because its own .cms_cache held only .cache/composer.
Effect: the FIRST pipeline on a fresh ref passes (there is no cache yet) and every later one fails. Pipeline 955281 on the #3622094 issue fork reached drush site:install; pipeline 955433 on 1.0.x died at create-project.
Proposed resolution
Three lines added immediately before composer create-project in the install job:
# The build cache restores cmssite/, and composer create-project refuses a
# non-empty target, so start from a clean directory on every run.
- rm -rf "$SITE_DIR".gitlab-ci.yml only, +3 lines.
Worth knowing for reviewers
Because of this failure the login fix from #3622112 has never actually executed in CI, so whether the functional suite goes green is still unverified. This MR unblocks that.
Verification
The rewritten pipeline is accepted by the GitLab CI lint API (valid: true). A green install job on this MR's own pipeline is the remaining proof.
AI-Generated: Yes
Assisted by Claude Code (Claude Opus 5). The change was verified against the failing CI job log and the GitLab CI lint API.
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