WordPress.org

Make WordPress Core

Changeset 51511


Ignore:
Timestamp:
07/29/2021 07:47:43 PM (2 months ago)
Author:
desrosj
Message:

Build/Test Tools: Post a message to #core in Slack when a workflow fails.

This adds an additional step to each GitHub Action workflow file that posts a message to #core in Slack every time a workflow run fails.

A minor test and spacing change is included in this commit in order to that messages are posted correctly and will be reverted after testing.

See #52644.

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/.github/workflows/coding-standards.yml

    r51355 r51511  
    5757  # - Runs PHPCS on the `tests` directory without warnings suppressed.
    5858  # - Ensures version-controlled files are not modified or deleted.
    59   # - todo: Configure Slack notifications for failing scans.
    6059  phpcs:
    6160    name: PHP coding standards
     
    111110  # - Run the WordPress JSHint checks.
    112111  # - Ensures version-controlled files are not modified or deleted.
    113   # - todo: Configure Slack notifications for failing tests.
    114112  jshint:
    115113    name: JavaScript coding standards
     
    149147      - name: Ensure version-controlled files are not modified or deleted
    150148        run: git diff --exit-code
     149
     150  # Post workflow related status updates to Slack.
     151  #
     152  # When a job in this workflow fails, a message is posted to #core.
     153  #
     154  # This job should always require all other jobs in this workflow to complete before running.
     155  slack-notifications:
     156    name: Slack Notifications
     157    runs-on: ubuntu-latest
     158    needs: [ phpcs, jshint ]
     159    if: ${{ failure() && github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' }}
     160
     161    steps:
     162      - name: Post failure notification to Slack
     163        uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
     164        with:
     165          payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
     166        env:
     167          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
  • trunk/.github/workflows/end-to-end-tests.yml

    r51355 r51511  
    4747  # - Run the E2E tests.
    4848  # - Ensures version-controlled files are not modified or deleted.
    49   # - todo: Configure Slack notifications for failing tests.
    5049  e2e-tests:
    5150    name: E2E Tests
     
    118117      - name: Ensure version-controlled files are not modified or deleted
    119118        run: git diff --exit-code
     119
     120  # Post workflow related status updates to Slack.
     121  #
     122  # When a job in this workflow fails, a message is posted to #core.
     123  #
     124  # This job should always require all other jobs in this workflow to complete before running.
     125  slack-notifications:
     126    name: Slack Notifications
     127    runs-on: ubuntu-latest
     128    needs: [ e2e-tests ]
     129    if: ${{ failure() && github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' }}
     130
     131    steps:
     132      - name: Post failure notification to Slack
     133        uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
     134        with:
     135          payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
     136        env:
     137          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
  • trunk/.github/workflows/javascript-tests.yml

    r51355 r51511  
    5151  # - Run the WordPress QUnit tests.
    5252  # - Ensures version-controlled files are not modified or deleted.
    53   # - todo: Configure Slack notifications for failing tests.
    5453  test-js:
    5554    name: QUnit Tests
     
    8786      - name: Ensure version-controlled files are not modified or deleted
    8887        run: git diff --exit-code
     88
     89  # Post workflow related status updates to Slack.
     90  #
     91  # When a job in this workflow fails, a message is posted to #core.
     92  #
     93  # This job should always require all other jobs in this workflow to complete before running.
     94  slack-notifications:
     95    name: Slack Notifications
     96    runs-on: ubuntu-latest
     97    needs: [ test-js ]
     98    if: ${{ failure() && github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' }}
     99
     100    steps:
     101      - name: Post failure notification to Slack
     102        uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
     103        with:
     104          payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
     105        env:
     106          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
  • trunk/.github/workflows/php-compatibility.yml

    r51355 r51511  
    5151  # - Runs the PHP compatibility tests.
    5252  # - Ensures version-controlled files are not modified or deleted.
    53   # - todo: Configure Slack notifications for failing scans.
    54   php-comatibility:
     53  php-compatibility:
    5554    name: Check PHP compatibility
    5655    runs-on: ubuntu-latest
     
    8988      - name: Ensure version-controlled files are not modified or deleted
    9089        run: git diff --exit-code
     90
     91  # Post workflow related status updates to Slack.
     92  #
     93  # When a job in this workflow fails, a message is posted to #core.
     94  #
     95  # This job should always require all other jobs in this workflow to complete before running.
     96  slack-notifications:
     97    name: Slack Notifications
     98    runs-on: ubuntu-latest
     99    needs: [ php-compatibility ]
     100    if: ${{ failure() && github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' }}
     101
     102    steps:
     103      - name: Post failure notification to Slack
     104        uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
     105        with:
     106          payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
     107        env:
     108          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
  • trunk/.github/workflows/phpunit-tests.yml

    r51355 r51511  
    6060  # - Reconnect the directory to the Git repository.
    6161  # - Submit the test results to the WordPress.org host test results.
    62   # - todo: Configure Slack notifications for failing tests.
    6362  test-php:
    6463    name: ${{ matrix.php }}${{ matrix.multisite && ' multisite' || '' }}${{ matrix.split_slow && ' slow tests' || '' }}${{ matrix.memcached && ' with memcached' || '' }} on ${{ matrix.os }}
     
    238237          WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}"
    239238        run: docker-compose run --rm -e WPT_REPORT_API_KEY -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php
     239
     240  # Post workflow related status updates to Slack.
     241  #
     242  # When a job in this workflow fails, a message is posted to #core.
     243  #
     244  # This job should always require all other jobs in this workflow to complete before running.
     245  slack-notifications:
     246    name: Slack Notifications
     247    runs-on: ubuntu-latest
     248    needs: [ test-php ]
     249    if: ${{ failure() && github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' }}
     250
     251    steps:
     252      - name: Post failure notification to Slack
     253        uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
     254        with:
     255          payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
     256        env:
     257          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
  • trunk/.github/workflows/test-coverage.yml

    r51355 r51511  
    147147          file: wp-code-coverage-multisite-clover-${{ github.sha }}.xml
    148148          flags: multisite,php
     149
     150  # Post workflow related status updates to Slack.
     151  #
     152  # When a job in this workflow fails, a message is posted to #core.
     153  #
     154  # This job should always require all other jobs in this workflow to complete before running.
     155  slack-notifications:
     156    name: Slack Notifications
     157    runs-on: ubuntu-latest
     158    needs: [ test-coverage-report ]
     159    if: ${{ failure() && github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' }}
     160
     161    steps:
     162      - name: Post failure notification to Slack
     163        uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
     164        with:
     165          payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
     166        env:
     167          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
  • trunk/.github/workflows/test-npm.yml

    r51355 r51511  
    155155      - name: Ensure version-controlled files are not modified or deleted during building and cleaning
    156156        run: git diff --exit-code
     157
     158  # Post workflow related status updates to Slack.
     159  #
     160  # When a job in this workflow fails, a message is posted to #core.
     161  #
     162  # This job should always require all other jobs in this workflow to complete before running.
     163  slack-notifications:
     164    name: Slack Notifications
     165    runs-on: ubuntu-latest
     166    needs: [ test-npm, test-npm-macos ]
     167    if: ${{ failure() && github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' }}
     168
     169    steps:
     170      - name: Post failure notification to Slack
     171        uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
     172        with:
     173          payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
     174        env:
     175          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
  • trunk/.github/workflows/test-old-branches.yml

    r51498 r51511  
    7070              ref: '${{ matrix.branch }}'
    7171            });
     72
     73  # Post workflow related status updates to Slack.
     74  #
     75  # When a job in this workflow fails, a message is posted to #core.
     76  #
     77  # This job should always require all other jobs in this workflow to complete before running.
     78  slack-notifications:
     79    name: Slack Notifications
     80    runs-on: ubuntu-latest
     81    needs: [ dispatch-workflows-for-old-branches ]
     82    if: ${{ failure() }}
     83
     84    steps:
     85      - name: Post failure notification to Slack
     86        uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
     87        with:
     88          payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
     89        env:
     90          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
  • trunk/.github/workflows/welcome-new-contributors.yml

    r50486 r51511  
    5858
    5959            The WordPress Project
     60
     61  # Post workflow related status updates to Slack.
     62  #
     63  # When a job in this workflow fails, a message is posted to #core.
     64  #
     65  # This job should always require all other jobs in this workflow to complete before running.
     66  slack-notifications:
     67    name: Slack Notifications
     68    runs-on: ubuntu-latest
     69    needs: [ post-welcome-message ]
     70    if: ${{ failure() }}
     71
     72    steps:
     73      - name: Post failure notification to Slack
     74        uses: slackapi/slack-github-action@d5d276d7ae0f38f29322b80da9baf985cc80f8b1 # v1.15.0
     75        with:
     76          payload: "{\"workflow_name\":\"${{ github.workflow }}\",\"run_url\":\"https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}\"}"
     77        env:
     78          SLACK_WEBHOOK_URL: ${{ secrets.SLACK_GHA_WEBHOOK_URL }}
  • trunk/src/wp-cron.php

    r48695 r51511  
    6161
    6262    $value = 0;
    63     if ( wp_using_ext_object_cache() ) {
     63    if (wp_using_ext_object_cache()) {
    6464        /*
    6565         * Skip local cache and force re-fetch of doing_cron transient
  • trunk/tests/phpunit/tests/functions.php

    r51448 r51511  
    2828        $b = array(
    2929            '_baba' => 5,
    30             'yZ'    => 'baba',
     30            'yZ'    => 'bab',
    3131            'a'     => array( 5, 111, 'x' ),
    3232        );
Note: See TracChangeset for help on using the changeset viewer.