Make WordPress Core

Changeset 51535


Ignore:
Timestamp:
08/03/2021 01:45:02 PM (3 years ago)
Author:
desrosj
Message:

Build/Test Tools: Expand Slack notifications for GitHub Actions.

This expands Slack notifications to include success, cancelled, and “fixed” GitHub Action workflow run outcomes in addition to failures.

A “fixed” outcome occurs when the previous run for a workflow failed and the current one succeeds. This matches the behavior that was native to TravisCI by setting on_success for notifications to change.

The message details and where each outcome is posted is controlled by Slack workflows.

The Slack notification logic has also been pulled into a separate workflow to prevent repeating code in every workflow.

See #52644.

Location:
trunk
Files:
1 added
11 edited

Legend:

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

    r51511 r51535  
    147147      - name: Ensure version-controlled files are not modified or deleted
    148148        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

    r51511 r51535  
    117117      - name: Ensure version-controlled files are not modified or deleted
    118118        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

    r51511 r51535  
    8686      - name: Ensure version-controlled files are not modified or deleted
    8787        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

    r51511 r51535  
    8888      - name: Ensure version-controlled files are not modified or deleted
    8989        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

    r51511 r51535  
    237237          WPT_REPORT_API_KEY: "${{ secrets.WPT_REPORT_API_KEY }}"
    238238        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

    r51511 r51535  
    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

    r51511 r51535  
    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

    r51511 r51535  
    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

    r51511 r51535  
    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

    r51512 r51535  
    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

    r51512 r51535  
    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.