diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-11-09 11:31:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-09 10:31:49 +0000 |
commit | fe7bdb7e4b3594048682f4727163a3a98b161116 (patch) | |
tree | 5ecff724cebf13d56fb559e3f0ad27d2f1c220a3 /.github | |
parent | c529bfa49e7fa9e3004dacf278b3e90b0be373b4 (diff) | |
download | servo-fe7bdb7e4b3594048682f4727163a3a98b161116.tar.gz servo-fe7bdb7e4b3594048682f4727163a3a98b161116.zip |
Remove support for triggering try from comments (#30712)
Triggering from labels means that we have less actions running and less
false job failures spamming project members. Plus, we have more
flexibility with labels rather than the backward compatibility we have
set up for bors comments.
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/linux-wpt.yml | 10 | ||||
-rw-r--r-- | .github/workflows/linux.yml | 10 | ||||
-rw-r--r-- | .github/workflows/mac-wpt.yml | 10 | ||||
-rw-r--r-- | .github/workflows/mac.yml | 10 | ||||
-rw-r--r-- | .github/workflows/try.yml | 62 | ||||
-rw-r--r-- | .github/workflows/windows.yml | 10 |
6 files changed, 46 insertions, 66 deletions
diff --git a/.github/workflows/linux-wpt.yml b/.github/workflows/linux-wpt.yml index ea526736391..8a880506e1f 100644 --- a/.github/workflows/linux-wpt.yml +++ b/.github/workflows/linux-wpt.yml @@ -30,15 +30,15 @@ jobs: chunk_id: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20] steps: - uses: actions/checkout@v3 - if: github.event_name != 'issue_comment' && github.event_name != 'pull_request_target' + if: github.event_name != 'pull_request_target' with: fetch-depth: 2 - # This is necessary to checkout the pull request if this run was triggered - # via an `issue_comment` action on a pull request. + # This is necessary to checkout the pull request if this run was triggered via a + # `pull_request_target` event. - uses: actions/checkout@v3 - if: github.event_name == 'issue_comment' || github.event_name == 'pull_request_target' + if: github.event_name == 'pull_request_target' with: - ref: refs/pull/${{ github.event.issue.number || github.event.number }}/head + ref: refs/pull/${{ github.event.number }}/head fetch-depth: 2 - uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 679272ae5ac..c5371fe8749 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -65,15 +65,15 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - if: github.event_name != 'issue_comment' && github.event_name != 'pull_request_target' + if: github.event_name != 'pull_request_target' with: fetch-depth: 2 - # This is necessary to checkout the pull request if this run was triggered - # via an `issue_comment` action on a pull request. + # This is necessary to checkout the pull request if this run was triggered via a + # `pull_request_target` event. - uses: actions/checkout@v3 - if: github.event_name == 'issue_comment' || github.event_name == 'pull_request_target' + if: github.event_name == 'pull_request_target' with: - ref: refs/pull/${{ github.event.issue.number || github.event.number }}/head + ref: refs/pull/${{ github.event.number }}/head fetch-depth: 2 - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 diff --git a/.github/workflows/mac-wpt.yml b/.github/workflows/mac-wpt.yml index e1707b8afcd..00b4d9d01cf 100644 --- a/.github/workflows/mac-wpt.yml +++ b/.github/workflows/mac-wpt.yml @@ -28,15 +28,15 @@ jobs: chunk_id: [1, 2, 3, 4, 5] steps: - uses: actions/checkout@v3 - if: github.event_name != 'issue_comment' && github.event_name != 'pull_request_target' + if: github.event_name != 'pull_request_target' with: fetch-depth: 2 - # This is necessary to checkout the pull request if this run was triggered - # via an `issue_comment` action on a pull request. + # This is necessary to checkout the pull request if this run was triggered via a + # `pull_request_target` event. - uses: actions/checkout@v3 - if: github.event_name == 'issue_comment' || github.event_name == 'pull_request_target' + if: github.event_name == 'pull_request_target' with: - ref: refs/pull/${{ github.event.issue.number || github.event.number }}/head + ref: refs/pull/${{ github.event.number }}/head fetch-depth: 2 - uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index cc9c608e198..6d5f619c6b9 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -58,15 +58,15 @@ jobs: runs-on: macos-13 steps: - uses: actions/checkout@v3 - if: github.event_name != 'issue_comment' && github.event_name != 'pull_request_target' + if: github.event_name != 'pull_request_target' with: fetch-depth: 2 - # This is necessary to checkout the pull request if this run was triggered - # via an `issue_comment` action on a pull request. + # This is necessary to checkout the pull request if this run was triggered via a + # `pull_request_target` event. - uses: actions/checkout@v3 - if: github.event_name == 'issue_comment' || github.event_name == 'pull_request_target' + if: github.event_name == 'pull_request_target' with: - ref: refs/pull/${{ github.event.issue.number || github.event.number }}/head + ref: refs/pull/${{ github.event.number }}/head fetch-depth: 2 - name: Run sccache-cache uses: mozilla-actions/sccache-action@v0.0.3 diff --git a/.github/workflows/try.yml b/.github/workflows/try.yml index f6e40cf1b55..9ced3989a99 100644 --- a/.github/workflows/try.yml +++ b/.github/workflows/try.yml @@ -3,13 +3,10 @@ name: Try on: pull_request_target: types: [labeled] - issue_comment: - types: [created] jobs: parse-comment: - name: Trigger Try (${{ github.event.name }}) - if: ${{ github.event_name == 'pull_request_target' || github.event.issue.pull_request }} + name: Trigger Try runs-on: ubuntu-latest outputs: configuration: ${{ steps.configuration.outputs.result }} @@ -87,45 +84,28 @@ jobs: unit_tests: false, }; - if (context.eventName == "pull_request_target") { - let try_labels = []; - for (const label of context.payload.pull_request.labels) { - if (!label.name.startsWith("T-")) { - continue; - } - - // Try to remove the label. If that fails, it's likely that another - // workflow has already processed it or a user has removed it. - try { - await github.rest.issues.removeLabel({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: context.issue.number, - name: label.name, - }); - } catch (exception) { - console.log("Assuming '" + label.name + "' is already removed: " + exception); - continue; - } - - console.log("Found label: " + label.name); - updateConfigurationFromString(label.name, configuration); - } - } else { - let tokens = context.payload.comment.body.split(/\s+/); - let tagIndex = tokens.indexOf("@bors-servo"); - if (tagIndex == -1 || tagIndex + 1 >= tokens.length) { - return { platforms: [] }; + let try_labels = []; + for (const label of context.payload.pull_request.labels) { + if (!label.name.startsWith("T-")) { + continue; } - - let tryString = tokens[tagIndex + 1]; - console.log("Found try string: '" + tryString + "'"); - if (tryString == "try") { - updateConfigurationFromString("full", configuration); - } else { - updateConfigurationFromString(tryString, configuration); + // Try to remove the label. If that fails, it's likely that another + // workflow has already processed it or a user has removed it. + try { + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + name: label.name, + }); + } catch (exception) { + console.log("Assuming '" + label.name + "' is already removed: " + exception); + continue; } + + console.log("Found label: " + label.name); + updateConfigurationFromString(label.name, configuration); } console.log(JSON.stringify(configuration)); @@ -167,7 +147,7 @@ jobs: name: Results needs: ["parse-comment", "run-try"] runs-on: ubuntu-latest - if: ${{ always() && fromJson(needs.parse-comment.outputs.configuration).try}} + if: ${{ always() && fromJson(needs.parse-comment.outputs.configuration).platforms[0] != null }} steps: - name: Success if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d30129e095e..04cfcc51140 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -51,15 +51,15 @@ jobs: runs-on: windows-2019 steps: - uses: actions/checkout@v3 - if: github.event_name != 'issue_comment' && github.event_name != 'pull_request_target' + if: github.event_name != 'pull_request_target' with: fetch-depth: 2 - # This is necessary to checkout the pull request if this run was triggered - # via an `issue_comment` action on a pull request. + # This is necessary to checkout the pull request if this run was triggered via a + # `pull_request_target` event. - uses: actions/checkout@v3 - if: github.event_name == 'issue_comment' || github.event_name == 'pull_request_target' + if: github.event_name == 'pull_request_target' with: - ref: refs/pull/${{ github.event.issue.number || github.event.number }}/head + ref: refs/pull/${{ github.event.number }}/head fetch-depth: 2 - name: ccache uses: hendrikmuhs/ccache-action@v1.2 |