From ddcdbe39da7fdbf7ad383d0f018a9525a145f697 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 20:25:52 +0100 Subject: [PATCH 01/24] Use pull_request workflow instead of pull_request_target --- .github/workflows/pull-request-comments.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index 5f1c2ef245d76..e5b04bae0980e 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -2,8 +2,7 @@ name: Pull Request Comments on: - pull_request_target: - types: [ 'opened' ] + pull_request: workflow_dispatch: inputs: pr_number: @@ -15,8 +14,7 @@ on: concurrency: # The concurrency group contains the workflow name and the branch name for pull requests # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'workflow_dispatch' && inputs.pr_number || github.sha }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.event_name == 'workflow_dispatch' && inputs.pr_number || github.sha }} # Disable permissions for all available scopes by default. # Any needed permissions should be configured at the job level. @@ -30,8 +28,7 @@ jobs: issues: write pull-requests: write timeout-minutes: 5 - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request_target' }} - + if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} steps: - uses: wow-actions/welcome@72817eb31cda1de60f51893d80e2e82ce57f7e76 # v1.3.0 with: From e2b1b1089a243f883992d1ff1accfbafba9785cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 20:27:44 +0100 Subject: [PATCH 02/24] Post on pull_request_opened --- .github/workflows/pull-request-comments.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index e5b04bae0980e..caa42f25f563f 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -3,6 +3,7 @@ name: Pull Request Comments on: pull_request: + types: [ 'opened' ] workflow_dispatch: inputs: pr_number: From a32a3496ecc13123b80abc6391a01335b1c01389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 20:33:51 +0100 Subject: [PATCH 03/24] Remove the repo check --- .github/workflows/pull-request-comments.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index caa42f25f563f..715c508b9a31c 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -29,7 +29,7 @@ jobs: issues: write pull-requests: write timeout-minutes: 5 - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} + # if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} steps: - uses: wow-actions/welcome@72817eb31cda1de60f51893d80e2e82ce57f7e76 # v1.3.0 with: @@ -85,7 +85,7 @@ jobs: permissions: issues: write pull-requests: write - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'workflow_dispatch' }} + # if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'workflow_dispatch' }} steps: - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: From 6a33adb0c82b29d41a0ff8947f2e772b660fe8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 20:42:08 +0100 Subject: [PATCH 04/24] Run Pull Request Comments on pull_request.opened, not via the run workflow method called in test-build-processes.yml --- .github/workflows/pull-request-comments.yml | 12 +++------ .github/workflows/test-build-processes.yml | 29 +-------------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index 715c508b9a31c..f387075b2e1bb 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -4,18 +4,12 @@ name: Pull Request Comments on: pull_request: types: [ 'opened' ] - workflow_dispatch: - inputs: - pr_number: - description: 'The pull request number to process.' - required: true - type: string # Cancels all previous workflow runs for pull requests that have not completed. concurrency: # The concurrency group contains the workflow name and the branch name for pull requests # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.event_name == 'workflow_dispatch' && inputs.pr_number || github.sha }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.event_name == 'workflow_dispatch' && github.event.number || github.sha }} # Disable permissions for all available scopes by default. # Any needed permissions should be configured at the job level. @@ -94,7 +88,7 @@ jobs: const commentInfo = { owner: context.repo.owner, repo: context.repo.repo, - issue_number: context.payload.inputs.pr_number + issue_number: context.payload.event.number }; const comments = ( await github.rest.issues.listComments( commentInfo ) ).data; @@ -120,7 +114,7 @@ jobs: For more details about these limitations and more, check out the [Limitations page](https://wordpress.github.io/wordpress-playground/limitations/) in the WordPress Playground documentation. - [Test this pull request with WordPress Playground](https://playground.wordpress.net/wordpress.html?pr=${ context.payload.inputs.pr_number }). + [Test this pull request with WordPress Playground](https://playground.wordpress.net/wordpress.html?pr=${ context.payload.event.number }). `; github.rest.issues.createComment( commentInfo ); diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index fd32f3101478f..ff351f27f796b 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -106,32 +106,6 @@ jobs: os: ${{ matrix.os }} directory: ${{ matrix.directory }} - # Calls the Pull Request Commenting workflow to leave a comment detailing how to test the PR within WordPress Playground. - playground-comment: - name: Leave WordPress Playground details - runs-on: ubuntu-latest - permissions: - actions: write - continue-on-error: true - needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} - - steps: - - name: Dispatch workflow run - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 - with: - retries: 2 - retry-exempt-status-codes: 418 - script: | - github.rest.actions.createWorkflowDispatch({ - owner: context.repo.owner, - repo: context.repo.repo, - workflow_id: 'pull-request-comments.yml', - ref: 'trunk', - inputs: { - pr_number: '${{ github.event.number }}' - } - }); slack-notifications: name: Slack Notifications @@ -139,7 +113,7 @@ jobs: permissions: actions: read contents: read - needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos, playground-comment ] + needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} with: calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} @@ -154,7 +128,6 @@ jobs: runs-on: ubuntu-latest permissions: actions: write - needs: [ playground-comment ] if: | always() && github.repository == 'WordPress/wordpress-develop' && From 92a151e655f6c59e4dc82ab1b07a7c0cad060f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 20:58:48 +0100 Subject: [PATCH 05/24] Run jobs on pull_request.edited --- .github/workflows/pull-request-comments.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index f387075b2e1bb..8d039e7615541 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -3,7 +3,7 @@ name: Pull Request Comments on: pull_request: - types: [ 'opened' ] + types: [ 'opened', 'edited' ] # Cancels all previous workflow runs for pull requests that have not completed. concurrency: From 29b4aa9a6490a56971f38fce7bb260c076f4557b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 21:00:41 +0100 Subject: [PATCH 06/24] Try listing branches to run this job on --- .github/workflows/pull-request-comments.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index 8d039e7615541..62f0f7ab16866 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -3,7 +3,8 @@ name: Pull Request Comments on: pull_request: - types: [ 'opened', 'edited' ] + branches: + - trunk # Cancels all previous workflow runs for pull requests that have not completed. concurrency: From 913ec968d6aafa79dc7b9fe4ba3caed1ea4ebaea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 21:01:48 +0100 Subject: [PATCH 07/24] Use ${{ github.event.number }} --- .github/workflows/pull-request-comments.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index 62f0f7ab16866..62bb09428c8a1 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -89,7 +89,7 @@ jobs: const commentInfo = { owner: context.repo.owner, repo: context.repo.repo, - issue_number: context.payload.event.number + issue_number: ${{ github.event.number }} }; const comments = ( await github.rest.issues.listComments( commentInfo ) ).data; @@ -115,7 +115,7 @@ jobs: For more details about these limitations and more, check out the [Limitations page](https://wordpress.github.io/wordpress-playground/limitations/) in the WordPress Playground documentation. - [Test this pull request with WordPress Playground](https://playground.wordpress.net/wordpress.html?pr=${ context.payload.event.number }). + [Test this pull request with WordPress Playground](https://playground.wordpress.net/wordpress.html?pr=${{ github.event.number }}). `; github.rest.issues.createComment( commentInfo ); From 35b3ba3ce68320b944f493e341115f1ca7520b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 21:04:30 +0100 Subject: [PATCH 08/24] Filter by both opened and branches --- .github/workflows/pull-request-comments.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index 62bb09428c8a1..c0609ca3aadc3 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -3,8 +3,10 @@ name: Pull Request Comments on: pull_request: + types: [opened] branches: - trunk + # Cancels all previous workflow runs for pull requests that have not completed. concurrency: From fbe398f9abb56370c96e37e0dfe4a1bd9d366a83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 21:17:04 +0100 Subject: [PATCH 09/24] Restore the repository check, compare with adam/wordpress-develop for the purposes of this fork --- .github/workflows/pull-request-comments.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index c0609ca3aadc3..a7f9632013faf 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -26,7 +26,7 @@ jobs: issues: write pull-requests: write timeout-minutes: 5 - # if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} + if: ${{ github.repository == 'adam/wordpress-develop' && github.event_name == 'pull_request' }} steps: - uses: wow-actions/welcome@72817eb31cda1de60f51893d80e2e82ce57f7e76 # v1.3.0 with: @@ -82,7 +82,7 @@ jobs: permissions: issues: write pull-requests: write - # if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'workflow_dispatch' }} + if: ${{ github.repository == 'adam/wordpress-develop' && github.event_name == 'pull_request' }} steps: - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: From 5ed78c3b692a0cdb99250b8d927467a72c5ebef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 21:25:44 +0100 Subject: [PATCH 10/24] Update repo name from adam to adamziel --- .github/workflows/pull-request-comments.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index a7f9632013faf..a4f9e10bc554c 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -26,7 +26,7 @@ jobs: issues: write pull-requests: write timeout-minutes: 5 - if: ${{ github.repository == 'adam/wordpress-develop' && github.event_name == 'pull_request' }} + if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request' }} steps: - uses: wow-actions/welcome@72817eb31cda1de60f51893d80e2e82ce57f7e76 # v1.3.0 with: @@ -82,7 +82,7 @@ jobs: permissions: issues: write pull-requests: write - if: ${{ github.repository == 'adam/wordpress-develop' && github.event_name == 'pull_request' }} + if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request' }} steps: - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: From 409830b240fdf4290e210d5972502fdf3e5f22ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 7 Dec 2023 21:46:40 +0100 Subject: [PATCH 11/24] Update the workflow --- .github/workflows/pull-request-comments.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index a4f9e10bc554c..3d47c26638450 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -2,8 +2,8 @@ name: Pull Request Comments on: - pull_request: - types: [opened] + pull_request_target: + types: [ 'opened' ] branches: - trunk @@ -12,7 +12,7 @@ on: concurrency: # The concurrency group contains the workflow name and the branch name for pull requests # or the commit hash for any other events. - group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.event_name == 'workflow_dispatch' && github.event.number || github.sha }} + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'workflow_dispatch' && github.event.number || github.sha }} # Disable permissions for all available scopes by default. # Any needed permissions should be configured at the job level. @@ -26,7 +26,7 @@ jobs: issues: write pull-requests: write timeout-minutes: 5 - if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request' }} + if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request_target' }} steps: - uses: wow-actions/welcome@72817eb31cda1de60f51893d80e2e82ce57f7e76 # v1.3.0 with: @@ -82,7 +82,7 @@ jobs: permissions: issues: write pull-requests: write - if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request' }} + if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request_target' }} steps: - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: From b0d45333ad6a82580da9806f0bb7e7e8eb5d3daa Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Thu, 7 Dec 2023 23:02:24 +0100 Subject: [PATCH 12/24] Leave PR comments without `workflow_dispatch` --- .github/workflows/pull-request-comments.yml | 45 +++++++++++++++++++-- .github/workflows/test-build-processes.yml | 20 +++++++++ 2 files changed, 62 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index 3d47c26638450..7720f7a3b6436 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -4,9 +4,10 @@ name: Pull Request Comments on: pull_request_target: types: [ 'opened' ] - branches: - - trunk - + workflow_run: + workflows: ["Test Build Processes"] + types: + - completed # Cancels all previous workflow runs for pull requests that have not completed. concurrency: @@ -82,17 +83,55 @@ jobs: permissions: issues: write pull-requests: write +<<<<<<< HEAD if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request_target' }} +======= + if: > + github.repository == 'WordPress/wordpress-develop' && + github.event_name == 'workflow_run' && + github.event.workflow_run.event == 'pull_request' && + github.event.workflow_run.conclusion == 'success' +>>>>>>> 07d277a3f9 (Leave PR comments without `workflow_dispatch`) steps: + - name: 'Download artifact' + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 + with: + script: | + var artifacts = await github.actions.listWorkflowRunArtifacts({ + owner: context.repo.owner, + repo: context.repo.repo, + run_id: ${{github.event.workflow_run.id }}, + }); + var matchArtifact = artifacts.data.artifacts.filter((artifact) => { + return artifact.name == "pr" + })[0]; + var download = await github.actions.downloadArtifact({ + owner: context.repo.owner, + repo: context.repo.repo, + artifact_id: matchArtifact.id, + archive_format: 'zip', + }); + var fs = require('fs'); + fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data)); + + - run: unzip pr.zip + - uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 with: script: | + const issue_number = Number(fs.readFileSync('./NR')); + // Comments are only added after the first successful build. Check for the presence of a comment and bail early. const commentInfo = { owner: context.repo.owner, repo: context.repo.repo, +<<<<<<< HEAD issue_number: ${{ github.event.number }} +======= + issue_number, +>>>>>>> 07d277a3f9 (Leave PR comments without `workflow_dispatch`) }; + const comments = ( await github.rest.issues.listComments( commentInfo ) ).data; for ( const currentComment of comments ) { diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index ff351f27f796b..2cd32022fe29a 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -106,6 +106,26 @@ jobs: os: ${{ matrix.os }} directory: ${{ matrix.directory }} + # Uploads the PR number as an artifact for the Pull Request Commenting workflow to download and then + # leave a comment detailing how to test the PR within WordPress Playground. + playground-comment: + name: Leave WordPress Playground details + runs-on: ubuntu-latest + permissions: + actions: write + continue-on-error: true + needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] + if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} + + steps: + - name: Save PR number + run: | + mkdir -p ./pr + echo ${{ github.event.number }} > ./pr/NR + - uses: actions/upload-artifact@v2 + with: + name: pr + path: pr/ slack-notifications: name: Slack Notifications From 2753f914c56b54fa914c52d372c48789f763652d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 8 Dec 2023 12:18:40 +0100 Subject: [PATCH 13/24] Resolve merge conflicts --- .github/workflows/pull-request-comments.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index 7720f7a3b6436..6b0a81d09a49e 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -83,15 +83,11 @@ jobs: permissions: issues: write pull-requests: write -<<<<<<< HEAD - if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request_target' }} -======= if: > github.repository == 'WordPress/wordpress-develop' && github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' ->>>>>>> 07d277a3f9 (Leave PR comments without `workflow_dispatch`) steps: - name: 'Download artifact' uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6.4.1 @@ -125,11 +121,7 @@ jobs: const commentInfo = { owner: context.repo.owner, repo: context.repo.repo, -<<<<<<< HEAD issue_number: ${{ github.event.number }} -======= - issue_number, ->>>>>>> 07d277a3f9 (Leave PR comments without `workflow_dispatch`) }; const comments = ( await github.rest.issues.listComments( commentInfo ) ).data; From 411071e39b14eb22ee553582df0da91b421739a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 8 Dec 2023 12:35:36 +0100 Subject: [PATCH 14/24] Post the comment in the adamziel repo --- .github/workflows/pull-request-comments.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index 4a0c856f592a6..b078f2b7a27d4 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -84,7 +84,7 @@ jobs: issues: write pull-requests: write if: > - github.repository == 'WordPress/wordpress-develop' && + github.repository == 'adamziel/wordpress-develop' && github.event_name == 'workflow_run' && github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' From 8bcd2c059f9dfec8aa897fcc8a6a137685f93603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 8 Dec 2023 12:36:43 +0100 Subject: [PATCH 15/24] Make the zip file before cleaning --- .github/workflows/callable-test-core-build-process.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/callable-test-core-build-process.yml b/.github/workflows/callable-test-core-build-process.yml index 4f97881bdd85d..60d97be95811e 100644 --- a/.github/workflows/callable-test-core-build-process.yml +++ b/.github/workflows/callable-test-core-build-process.yml @@ -68,16 +68,16 @@ jobs: - name: Ensure version-controlled files are not modified or deleted during building run: git diff --exit-code + - name: Create ZIP of built files + if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }} + run: zip -r wordpress.zip build/. + - name: Clean after building to run from ${{ inputs.directory }} run: npm run grunt clean${{ inputs.directory == 'src' && ' -- --dev' || '' }} - name: Ensure version-controlled files are not modified or deleted during cleaning run: git diff --exit-code - - name: Create ZIP of built files - if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }} - run: zip -r wordpress.zip build/. - - name: Upload ZIP as a GitHub Actions artifact uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 if: ${{ inputs.directory == 'build' && 'ubuntu-latest' == inputs.os }} From 45c216f4835b22ff88d53277ef909ab681f2bd0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 8 Dec 2023 12:50:00 +0100 Subject: [PATCH 16/24] Adjust to adamziel repo --- .github/workflows/test-build-processes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index 2cd32022fe29a..220bcc1283fbf 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -115,7 +115,7 @@ jobs: actions: write continue-on-error: true needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name == 'pull_request' }} + if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request' }} steps: - name: Save PR number From 2bfc828323ee091fe7364725e6fc5230fdab75d0 Mon Sep 17 00:00:00 2001 From: Adam Zielinski Date: Fri, 8 Dec 2023 15:45:13 +0100 Subject: [PATCH 17/24] Update test-build-processes.yml --- .github/workflows/test-build-processes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index 220bcc1283fbf..d69874fbcbcd0 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -31,7 +31,7 @@ jobs: # Tests the WordPress Core build process on multiple operating systems. test-core-build-process: name: Core running from ${{ matrix.directory }} - uses: WordPress/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@trunk + uses: adamziel/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@trunk permissions: contents: read if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} From aa92cfcfd1259e1980662b3af33f998b7e62aff6 Mon Sep 17 00:00:00 2001 From: bernhard-reiter Date: Fri, 8 Dec 2023 11:44:54 +0000 Subject: [PATCH 18/24] Block Hooks: Fix `@ticket` references in tests, add missing ones. Some tests that were added in [57157] erroneously set their `@ticket` reference to #59646, rather than #60008. This changeset rectifies that mistake. Additionally, it adds ticket references to #60008 to tests that were modified by [57157]. Follow-up to [57157]. See #60008. git-svn-id: https://develop.svn.wordpress.org/trunk@57172 602fd350-edb4-49c9-b593-d223f7449a82 --- tests/phpunit/tests/blocks/getHookedBlockMarkup.php | 6 +++--- tests/phpunit/tests/blocks/getHookedBlocks.php | 3 +++ tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/phpunit/tests/blocks/getHookedBlockMarkup.php b/tests/phpunit/tests/blocks/getHookedBlockMarkup.php index 918ad97031e2e..2ea151f213f05 100644 --- a/tests/phpunit/tests/blocks/getHookedBlockMarkup.php +++ b/tests/phpunit/tests/blocks/getHookedBlockMarkup.php @@ -12,7 +12,7 @@ */ class Tests_Blocks_GetHookedBlockMarkup extends WP_UnitTestCase { /** - * @ticket 59646 + * @ticket 60008 * * @covers ::get_hooked_block_markup */ @@ -27,7 +27,7 @@ public function test_get_hooked_block_markup_adds_metadata() { } /** - * @ticket 59646 + * @ticket 60008 * * @covers ::get_hooked_block_markup */ @@ -47,7 +47,7 @@ public function test_get_hooked_block_markup_if_block_is_already_hooked() { } /** - * @ticket 59646 + * @ticket 60008 * * @covers ::get_hooked_block_markup */ diff --git a/tests/phpunit/tests/blocks/getHookedBlocks.php b/tests/phpunit/tests/blocks/getHookedBlocks.php index 66a9e00efea69..526b2e494f1a2 100644 --- a/tests/phpunit/tests/blocks/getHookedBlocks.php +++ b/tests/phpunit/tests/blocks/getHookedBlocks.php @@ -135,6 +135,7 @@ public function test_get_hooked_blocks_matches_found() { /** * @ticket 59313 + * @ticket 60008 * * @covers ::get_hooked_blocks * @covers ::get_block_file_template @@ -165,6 +166,7 @@ public function test_loading_template_with_hooked_blocks() { /** * @ticket 59313 + * @ticket 60008 * * @covers ::get_hooked_blocks * @covers ::get_block_file_template @@ -195,6 +197,7 @@ public function test_loading_template_part_with_hooked_blocks() { /** * @ticket 59313 + * @ticket 60008 * * @covers ::get_hooked_blocks * @covers WP_Block_Patterns_Registry::get_registered diff --git a/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php b/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php index 1cc0f472bcdab..500f9f93d0049 100644 --- a/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php +++ b/tests/phpunit/tests/blocks/wpBlockPatternsRegistry.php @@ -343,6 +343,7 @@ public function test_get_all_registered_includes_theme_attribute() { * Should insert hooked blocks into registered patterns. * * @ticket 59476 + * @ticket 60008 * * @covers WP_Block_Patterns_Registry::register * @covers WP_Block_Patterns_Registry::get_all_registered @@ -416,6 +417,7 @@ public function test_get_registered_includes_theme_attribute() { * Should insert hooked blocks into registered patterns. * * @ticket 59476 + * @ticket 60008 * * @covers WP_Block_Patterns_Registry::register * @covers WP_Block_Patterns_Registry::get_registered From 5b2b7f29613849f882b68b0f995221efdb958e20 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Fri, 8 Dec 2023 14:11:11 +0000 Subject: [PATCH 19/24] Database: Raise the minimum required version of MySQL. This raises the minimum version of MySQL required to run WordPress from 5.0 to 5.5.5. MySQL 5.0 and 5.1 have long been unsupported and both reached end of life over 10 years ago. Combined usage for both versions sits at 0.4% of all WordPress sites. Because 5.5 sits at just under 15% usage, 5.5 cannot be trimmed off at this time. Of all sites running 5.5.x, 85% are running 5.5.5, and 100% are running 5.5.5 or higher. This makes it the logical landing spot. Props johnbillion, sergeybiryukov, jorbin. Fixes #60036. git-svn-id: https://develop.svn.wordpress.org/trunk@57173 602fd350-edb4-49c9-b593-d223f7449a82 --- src/readme.html | 2 +- src/wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/readme.html b/src/readme.html index 4c76fd4c17eb4..f0309df1e94b8 100644 --- a/src/readme.html +++ b/src/readme.html @@ -52,7 +52,7 @@

Migrating from other systems

System Requirements

  • PHP version 7.0 or greater.
  • -
  • MySQL version 5.0 or greater.
  • +
  • MySQL version 5.5.5 or greater.

Recommendations

diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php index ecd665df63648..fca28144f5cb0 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -44,4 +44,4 @@ * * @global string $required_mysql_version */ -$required_mysql_version = '5.0'; +$required_mysql_version = '5.5.5'; From 50c9bcd6644d2336b9b388696b7a90e768a41c51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 8 Dec 2023 16:06:19 +0100 Subject: [PATCH 20/24] Try to add "Leave WordPress Playground details" to the workflows list --- .github/workflows/pull-request-comments.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pull-request-comments.yml b/.github/workflows/pull-request-comments.yml index b078f2b7a27d4..c41d725300154 100644 --- a/.github/workflows/pull-request-comments.yml +++ b/.github/workflows/pull-request-comments.yml @@ -5,7 +5,7 @@ on: pull_request_target: types: [ 'opened' ] workflow_run: - workflows: ["Test Build Processes"] + workflows: ["Test Build Processes", "Leave WordPress Playground details"] types: - completed From 0256eb5b63d542a48f81d24b91838b5bba789233 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 8 Dec 2023 16:06:36 +0100 Subject: [PATCH 21/24] Comment out the "needs" --- .github/workflows/test-build-processes.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index d69874fbcbcd0..f931718132f83 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -114,7 +114,7 @@ jobs: permissions: actions: write continue-on-error: true - needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] + # needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] if: ${{ github.repository == 'adamziel/wordpress-develop' && github.event_name == 'pull_request' }} steps: From b4426f4fbec893098cbd5f9984f7493f4df7f76a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 8 Dec 2023 16:21:15 +0100 Subject: [PATCH 22/24] Disable extra workflows --- .github/workflows/phpunit-tests.yml | 7 -- .github/workflows/test-build-processes.yml | 114 ++++++++++----------- 2 files changed, 57 insertions(+), 64 deletions(-) diff --git a/.github/workflows/phpunit-tests.yml b/.github/workflows/phpunit-tests.yml index d9bc028b8e2b5..eea36c397017e 100644 --- a/.github/workflows/phpunit-tests.yml +++ b/.github/workflows/phpunit-tests.yml @@ -3,17 +3,10 @@ name: PHPUnit Tests on: push: branches: - - trunk - - '3.[7-9]' - '[4-9].[0-9]' tags: - '[0-9]+.[0-9]' - '[0-9]+.[0-9].[0-9]+' - pull_request: - branches: - - trunk - - '3.[7-9]' - - '[4-9].[0-9]' workflow_dispatch: # Once weekly On Sundays at 00:00 UTC. schedule: diff --git a/.github/workflows/test-build-processes.yml b/.github/workflows/test-build-processes.yml index f931718132f83..09eb86ac6a593 100644 --- a/.github/workflows/test-build-processes.yml +++ b/.github/workflows/test-build-processes.yml @@ -52,36 +52,36 @@ jobs: # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is # currently no way to determine the OS being used on a given job. # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. - test-core-build-process-macos: - name: Core running from ${{ matrix.directory }} - uses: WordPress/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@trunk - permissions: - contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' }} - strategy: - fail-fast: false - matrix: - os: [ macos-latest ] - directory: [ 'src', 'build' ] - with: - os: ${{ matrix.os }} - directory: ${{ matrix.directory }} + # test-core-build-process-macos: + # name: Core running from ${{ matrix.directory }} + # uses: WordPress/wordpress-develop/.github/workflows/callable-test-core-build-process.yml@trunk + # permissions: + # contents: read + # if: ${{ github.repository == 'WordPress/wordpress-develop' }} + # strategy: + # fail-fast: false + # matrix: + # os: [ macos-latest ] + # directory: [ 'src', 'build' ] + # with: + # os: ${{ matrix.os }} + # directory: ${{ matrix.directory }} # Tests the Gutenberg plugin build process on multiple operating systems when run within a wordpress-develop checkout. - test-gutenberg-build-process: - name: Gutenberg running from ${{ matrix.directory }} - uses: WordPress/wordpress-develop/.github/workflows/callable-test-gutenberg-build-process.yml@trunk - permissions: - contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} - strategy: - fail-fast: false - matrix: - os: [ ubuntu-latest, windows-latest ] - directory: [ 'src', 'build' ] - with: - os: ${{ matrix.os }} - directory: ${{ matrix.directory }} + # test-gutenberg-build-process: + # name: Gutenberg running from ${{ matrix.directory }} + # uses: WordPress/wordpress-develop/.github/workflows/callable-test-gutenberg-build-process.yml@trunk + # permissions: + # contents: read + # if: ${{ github.repository == 'WordPress/wordpress-develop' || github.event_name == 'pull_request' }} + # strategy: + # fail-fast: false + # matrix: + # os: [ ubuntu-latest, windows-latest ] + # directory: [ 'src', 'build' ] + # with: + # os: ${{ matrix.os }} + # directory: ${{ matrix.directory }} # Tests the Gutenberg plugin build process on MacOS when run within a wordpress-develop checkout. # @@ -91,20 +91,20 @@ jobs: # The `matrix` and `runner` contexts are not available for use within `if` expressions. So there is # currently no way to determine the OS being used on a given job. # See https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability. - test-gutenberg-build-process-macos: - name: Gutenberg running from ${{ matrix.directory }} - uses: WordPress/wordpress-develop/.github/workflows/callable-test-gutenberg-build-process.yml@trunk - permissions: - contents: read - if: ${{ github.repository == 'WordPress/wordpress-develop' }} - strategy: - fail-fast: false - matrix: - os: [ macos-latest ] - directory: [ 'src', 'build' ] - with: - os: ${{ matrix.os }} - directory: ${{ matrix.directory }} + # test-gutenberg-build-process-macos: + # name: Gutenberg running from ${{ matrix.directory }} + # uses: WordPress/wordpress-develop/.github/workflows/callable-test-gutenberg-build-process.yml@trunk + # permissions: + # contents: read + # if: ${{ github.repository == 'WordPress/wordpress-develop' }} + # strategy: + # fail-fast: false + # matrix: + # os: [ macos-latest ] + # directory: [ 'src', 'build' ] + # with: + # os: ${{ matrix.os }} + # directory: ${{ matrix.directory }} # Uploads the PR number as an artifact for the Pull Request Commenting workflow to download and then # leave a comment detailing how to test the PR within WordPress Playground. @@ -127,21 +127,21 @@ jobs: name: pr path: pr/ - slack-notifications: - name: Slack Notifications - uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk - permissions: - actions: read - contents: read - needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] - if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} - with: - calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} - secrets: - SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} - SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} - SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} - SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} + # slack-notifications: + # name: Slack Notifications + # uses: WordPress/wordpress-develop/.github/workflows/slack-notifications.yml@trunk + # permissions: + # actions: read + # contents: read + # needs: [ test-core-build-process, test-core-build-process-macos, test-gutenberg-build-process, test-gutenberg-build-process-macos ] + # if: ${{ github.repository == 'WordPress/wordpress-develop' && github.event_name != 'pull_request' && always() }} + # with: + # calling_status: ${{ contains( needs.*.result, 'cancelled' ) && 'cancelled' || contains( needs.*.result, 'failure' ) && 'failure' || 'success' }} + # secrets: + # SLACK_GHA_SUCCESS_WEBHOOK: ${{ secrets.SLACK_GHA_SUCCESS_WEBHOOK }} + # SLACK_GHA_CANCELLED_WEBHOOK: ${{ secrets.SLACK_GHA_CANCELLED_WEBHOOK }} + # SLACK_GHA_FIXED_WEBHOOK: ${{ secrets.SLACK_GHA_FIXED_WEBHOOK }} + # SLACK_GHA_FAILURE_WEBHOOK: ${{ secrets.SLACK_GHA_FAILURE_WEBHOOK }} failed-workflow: name: Failed workflow tasks From 1d818437d6d2cb6482cd0b3a6a243a520ffceef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 8 Dec 2023 16:06:59 +0100 Subject: [PATCH 23/24] Try test --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 8e7411241f839..12093192a6e34 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +testd # WordPress Welcome to the WordPress development repository! Please check out the [contributor handbook](https://make.wordpress.org/core/handbook/) for information about how to open bug reports, contribute patches, test changes, write documentation, or get involved in any way you can. From e4c0e2ec92df89235902ee1afb386c9f83eaabb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Fri, 8 Dec 2023 16:26:51 +0100 Subject: [PATCH 24/24] testd test --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 12093192a6e34..8afa9e47c8d16 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -testd +testd test # WordPress Welcome to the WordPress development repository! Please check out the [contributor handbook](https://make.wordpress.org/core/handbook/) for information about how to open bug reports, contribute patches, test changes, write documentation, or get involved in any way you can.