From 16521f31a46d1b8fdaf993f29110d333ebfb9414 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Thu, 7 May 2026 11:50:46 -0600 Subject: [PATCH 1/2] fix(ci): enable issue fork jobs on PRs and push to main Both drupal-issue-fork and contrib-issue-fork had github.event_name != 'push' in their if: conditions, so they were skipped on every merge to main. They already ran on PRs from the repo owner, so the push exclusion was inconsistent. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/drupal-contrib-integration-test.yml | 7 ++----- .github/workflows/drupal-integration-test.yml | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/drupal-contrib-integration-test.yml b/.github/workflows/drupal-contrib-integration-test.yml index b7f97c0..a696585 100644 --- a/.github/workflows/drupal-contrib-integration-test.yml +++ b/.github/workflows/drupal-contrib-integration-test.yml @@ -7,7 +7,7 @@ name: Drupal Contrib Integration Tests # contrib-plain — matrix of known modules on D11, runs on every # push to main and nightly # contrib-issue-fork — single workspace using a real drupal.org contrib issue -# fork, runs nightly only +# fork, runs on every push to main, PRs, and nightly # # Repository variables (optional, set in GitHub → Settings → Variables): # CONTRIB_TEST_PROJECT - Module machine name for issue fork test (default: token) @@ -204,10 +204,7 @@ jobs: contrib-issue-fork: name: Contrib ${{ vars.CONTRIB_TEST_PROJECT || 'token' }} issue fork - if: | - vars.CONTRIB_TEST_ISSUE_FORK != '' && - github.event_name != 'push' && - (github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner) + if: ${{ vars.CONTRIB_TEST_ISSUE_FORK != '' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner) }} runs-on: [self-hosted, sysbox] defaults: run: diff --git a/.github/workflows/drupal-integration-test.yml b/.github/workflows/drupal-integration-test.yml index 8bdd3f2..9e469ba 100644 --- a/.github/workflows/drupal-integration-test.yml +++ b/.github/workflows/drupal-integration-test.yml @@ -7,7 +7,7 @@ name: Drupal Integration Tests # drupal-plain — matrix of D11 and D12, no issue fork, runs on every # push to main and nightly # drupal-issue-fork — single workspace using a real drupal.org issue fork, -# runs nightly only +# runs on every push to main, PRs, and nightly # # Repository variable: # DRUPAL_TEST_ISSUE_FORK - drupal.org issue number (bare, e.g. 3585397) or @@ -195,9 +195,7 @@ jobs: drupal-issue-fork: name: Drupal issue fork ${{ vars.DRUPAL_TEST_ISSUE_FORK || '3585397' }} - if: | - github.event_name != 'push' && - (github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner) + if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login == github.repository_owner }} runs-on: [self-hosted, sysbox] defaults: run: From 03afbcca68b89d38b4a9e2e81cccfb09a6b92b34 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Thu, 7 May 2026 12:13:20 -0600 Subject: [PATCH 2/2] fix: handle ddev restart failure and treat module-not-enabled as fatal ddev restart after ddev poser was silently swallowed (|| true), so if restart failed the symlink-project hook never ran, drush en could not discover the module, and the workspace appeared healthy despite the module not being enabled. - ddev restart now retries via stop+start on failure; either path triggers symlink-project - module-not-enabled after drush en now sets SETUP_FAILED=true instead of just logging a warning, so SETUP_STATUS.txt reflects the real state Co-Authored-By: Claude Sonnet 4.6 --- drupal-contrib/template.tf | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index 8f12f09..dbf0ce1 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -684,10 +684,30 @@ COMPOSE_EOF fi if [ "$SETUP_FAILED" = "false" ]; then - # Restart triggers ddev symlink-project automatically + # Restart triggers ddev symlink-project automatically. + # symlink-project creates web/modules/custom/ -> project root. + # Without this symlink drush cannot discover the module. log_setup "Restarting DDEV to trigger symlink-project..." - ddev restart >> "$SETUP_LOG" 2>&1 || true + update_status "⏳ DDEV restart: In progress..." + if ddev restart >> "$SETUP_LOG" 2>&1; then + log_setup "✓ DDEV restarted" + update_status "✓ DDEV restart: Success" + else + log_setup "✗ DDEV restart failed — trying stop + start..." + update_status "⚠ DDEV restart: Retrying..." + ddev stop >> "$SETUP_LOG" 2>&1 || true + if ddev start >> "$SETUP_LOG" 2>&1; then + log_setup "✓ DDEV started (after restart failure)" + update_status "✓ DDEV restart: Success (via stop+start)" + else + log_setup "✗ DDEV start failed after restart failure" + update_status "✗ DDEV restart: Failed" + SETUP_FAILED=true + fi + fi + fi + if [ "$SETUP_FAILED" = "false" ]; then # Install Drupal INSTALL_PROFILE="${data.coder_parameter.install_profile.value}" log_setup "Installing Drupal ($INSTALL_PROFILE profile)..." @@ -717,8 +737,9 @@ COMPOSE_EOF log_setup "✓ $PROJECT_NAME enabled" update_status "✓ $PROJECT_NAME: Enabled" else - log_setup "⚠ Warning: $PROJECT_NAME not found in enabled modules list" - update_status "⚠ $PROJECT_NAME: Not enabled (check /tmp/drupal-setup.log)" + log_setup "✗ $PROJECT_NAME not found in enabled modules — enable failed" + update_status "✗ $PROJECT_NAME: Not enabled (check /tmp/drupal-setup.log)" + SETUP_FAILED=true fi fi fi