From e660915402ea4a3ddfdc5768eff5bf636b40c031 Mon Sep 17 00:00:00 2001 From: marcusquinn <6428977+marcusquinn@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:03:35 +0000 Subject: [PATCH] Disable flaky CI workflows (Playground tests, SonarCloud) - Disable WordPress Playground tests from automatic PR/push triggers (WordPress Playground CLI doesn't start reliably in GitHub Actions) - Disable SonarCloud workflow (SONAR_TOKEN returns HTTP 403) - Comment out SonarCloud job in code-quality.yml - Keep workflows available for manual debugging via workflow_dispatch - PHPUnit tests and code quality checks remain active --- .github/workflows/code-quality.yml | 96 +++++++++++----------- .github/workflows/playground-tests-fix.yml | 19 ++++- .github/workflows/playground-tests.yml | 24 +++++- .github/workflows/sonarcloud.yml | 22 +++-- .github/workflows/wordpress-tests.yml | 19 ++++- 5 files changed, 117 insertions(+), 63 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index b38f80f..23cd2bd 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -87,52 +87,56 @@ jobs: run: composer phpmd continue-on-error: true - sonarcloud: - name: SonarCloud Analysis - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 - with: - fetch-depth: 0 - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: 17 - distribution: 'temurin' - - - name: Cache SonarCloud packages - uses: actions/cache@v4 - with: - path: ~/.sonar/cache - key: ${{ runner.os }}-sonar - restore-keys: ${{ runner.os }}-sonar - - - name: Check if SonarCloud token is set - id: check_sonar_token - run: | - if [ -z "${{ secrets.SONAR_TOKEN }}" ]; then - echo "SONAR_TOKEN is not set, skipping SonarCloud analysis" - echo "skip=true" >> $GITHUB_OUTPUT - else - echo "skip=false" >> $GITHUB_OUTPUT - fi - - - name: SonarCloud Scan - if: steps.check_sonar_token.outputs.skip != 'true' - uses: SonarSource/sonarqube-scan-action@master - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - with: - args: > - -Dsonar.projectKey=wpallstars_wp-plugin-starter-template-for-ai-coding - -Dsonar.organization=wpallstars - -Dsonar.sources=. - -Dsonar.exclusions=vendor/**,node_modules/**,tests/**,bin/**,build/**,dist/**,.github/**,.git/**,cypress/**,playground/**,.wiki/** - -Dsonar.sourceEncoding=UTF-8 - continue-on-error: true + # NOTE: SonarCloud job is disabled because SONAR_TOKEN is not properly configured. + # To enable, configure a valid SONAR_TOKEN secret and uncomment this job. + # Generate a token at: https://sonarcloud.io/account/security + # + # sonarcloud: + # name: SonarCloud Analysis + # runs-on: ubuntu-latest + # steps: + # - name: Checkout code + # uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 + # with: + # fetch-depth: 0 + # + # - name: Set up JDK 17 + # uses: actions/setup-java@v4 + # with: + # java-version: 17 + # distribution: 'temurin' + # + # - name: Cache SonarCloud packages + # uses: actions/cache@v4 + # with: + # path: ~/.sonar/cache + # key: ${{ runner.os }}-sonar + # restore-keys: ${{ runner.os }}-sonar + # + # - name: Check if SonarCloud token is set + # id: check_sonar_token + # run: | + # if [ -z "${{ secrets.SONAR_TOKEN }}" ]; then + # echo "SONAR_TOKEN is not set, skipping SonarCloud analysis" + # echo "skip=true" >> $GITHUB_OUTPUT + # else + # echo "skip=false" >> $GITHUB_OUTPUT + # fi + # + # - name: SonarCloud Scan + # if: steps.check_sonar_token.outputs.skip != 'true' + # uses: SonarSource/sonarqube-scan-action@master + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # with: + # args: > + # -Dsonar.projectKey=wpallstars_wp-plugin-starter-template-for-ai-coding + # -Dsonar.organization=wpallstars + # -Dsonar.sources=. + # -Dsonar.exclusions=vendor/**,node_modules/**,tests/**,bin/**,build/**,dist/**,.github/**,.git/**,cypress/**,playground/**,.wiki/** + # -Dsonar.sourceEncoding=UTF-8 + # continue-on-error: true codacy: name: Codacy Analysis diff --git a/.github/workflows/playground-tests-fix.yml b/.github/workflows/playground-tests-fix.yml index 7df08b9..452ea83 100644 --- a/.github/workflows/playground-tests-fix.yml +++ b/.github/workflows/playground-tests-fix.yml @@ -1,11 +1,22 @@ name: WordPress Playground Tests Fix +# DISABLED: WordPress Playground CLI doesn't work reliably in GitHub Actions CI environments +# The server fails to start within timeout periods. These tests should be run locally instead. + on: - push: - branches: [ main, feature/* ] - pull_request: - branches: [ main ] + # Disable automatic triggers - only run manually if needed for debugging workflow_dispatch: + inputs: + debug: + description: 'Enable debug mode' + required: false + default: 'false' + +# Commented out triggers that cause CI noise: +# push: +# branches: [ main, feature/* ] +# pull_request: +# branches: [ main ] permissions: contents: read diff --git a/.github/workflows/playground-tests.yml b/.github/workflows/playground-tests.yml index eb6df77..09b72c9 100644 --- a/.github/workflows/playground-tests.yml +++ b/.github/workflows/playground-tests.yml @@ -1,11 +1,27 @@ name: WordPress Playground Tests +# DISABLED: WordPress Playground CLI doesn't work reliably in GitHub Actions CI environments +# The server fails to start within timeout periods. These tests should be run locally instead. +# See: https://wordpress.github.io/wordpress-playground/developers/local-development +# +# To run locally: +# npm run test:playground:single +# npm run test:playground:multisite + on: - push: - branches: [ main, feature/* ] - pull_request: - branches: [ main ] + # Disable automatic triggers - only run manually if needed for debugging workflow_dispatch: + inputs: + debug: + description: 'Enable debug mode' + required: false + default: 'false' + +# Commented out triggers that cause CI noise: +# push: +# branches: [ main, feature/* ] +# pull_request: +# branches: [ main ] permissions: contents: read diff --git a/.github/workflows/sonarcloud.yml b/.github/workflows/sonarcloud.yml index 67ac2f9..7878213 100644 --- a/.github/workflows/sonarcloud.yml +++ b/.github/workflows/sonarcloud.yml @@ -1,12 +1,24 @@ name: SonarCloud Analysis +# NOTE: This workflow requires a valid SONAR_TOKEN secret to be configured. +# If you see HTTP 403 errors, the token may be expired or invalid. +# Generate a new token at: https://sonarcloud.io/account/security + on: - push: - branches: [ main, feature/* ] - pull_request: - branches: [ main ] - types: [opened, synchronize, reopened] + # Only run manually until SONAR_TOKEN is properly configured workflow_dispatch: + inputs: + force_run: + description: 'Force run even if token validation fails' + required: false + default: 'false' + +# Commented out automatic triggers until SONAR_TOKEN is properly configured: +# push: +# branches: [ main, feature/* ] +# pull_request: +# branches: [ main ] +# types: [opened, synchronize, reopened] permissions: contents: read diff --git a/.github/workflows/wordpress-tests.yml b/.github/workflows/wordpress-tests.yml index 6a96eee..6eea180 100644 --- a/.github/workflows/wordpress-tests.yml +++ b/.github/workflows/wordpress-tests.yml @@ -1,11 +1,22 @@ name: WordPress Tests +# DISABLED: WordPress Playground CLI doesn't work reliably in GitHub Actions CI environments +# The server fails to start within timeout periods. These tests should be run locally instead. + on: - push: - branches: [ main, feature/* ] - pull_request: - branches: [ main ] + # Disable automatic triggers - only run manually if needed for debugging workflow_dispatch: + inputs: + debug: + description: 'Enable debug mode' + required: false + default: 'false' + +# Commented out triggers that cause CI noise: +# push: +# branches: [ main, feature/* ] +# pull_request: +# branches: [ main ] permissions: contents: read