From 09f8c592af80bff4a07cdeac9e4bf39064636422 Mon Sep 17 00:00:00 2001 From: Alex <93376818+sashashura@users.noreply.github.com> Date: Fri, 2 Sep 2022 18:01:37 +0100 Subject: [PATCH 01/11] Update test.yaml Signed-off-by: sashashura <93376818+sashashura@users.noreply.github.com> --- .github/workflows/test.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5e463f8a9ed..a2be34e7a50 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -22,6 +22,9 @@ on: required: false default: false +permissions: + contents: read + # Only have a run a single parallel for each branch. # Runs for trunk are queues. # Older runs for non-trunk branches are cancelled and the jobs are executed @@ -339,6 +342,8 @@ jobs: # process late in the release cycle, # The files are published only when a tag is created. release-publish: + permissions: + contents: write name: Check release and publish on twisted-* tag runs-on: 'ubuntu-20.04' steps: From cd5d000fb5c677b535a29aff4b760b64aad3a6f9 Mon Sep 17 00:00:00 2001 From: Alex <93376818+sashashura@users.noreply.github.com> Date: Fri, 2 Sep 2022 18:20:13 +0100 Subject: [PATCH 02/11] Create 11631.bugfix --- src/twisted/newsfragments/11631.bugfix | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/twisted/newsfragments/11631.bugfix diff --git a/src/twisted/newsfragments/11631.bugfix b/src/twisted/newsfragments/11631.bugfix new file mode 100644 index 00000000000..9610f747d81 --- /dev/null +++ b/src/twisted/newsfragments/11631.bugfix @@ -0,0 +1 @@ +test.yaml workflow permissions restricted. From 2f474f904887e447b3e31841ddf89327ea978337 Mon Sep 17 00:00:00 2001 From: Alex <93376818+sashashura@users.noreply.github.com> Date: Fri, 2 Sep 2022 18:37:42 +0100 Subject: [PATCH 03/11] Update 11631.bugfix --- src/twisted/newsfragments/11631.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/twisted/newsfragments/11631.bugfix b/src/twisted/newsfragments/11631.bugfix index 9610f747d81..d6fd5f74974 100644 --- a/src/twisted/newsfragments/11631.bugfix +++ b/src/twisted/newsfragments/11631.bugfix @@ -1 +1 @@ -test.yaml workflow permissions restricted. +'test.yaml' workflow permissions restricted. From 8ba7520e85610a29a2c5cf658648bc5cb9866785 Mon Sep 17 00:00:00 2001 From: Alex <93376818+sashashura@users.noreply.github.com> Date: Fri, 2 Sep 2022 19:06:33 +0100 Subject: [PATCH 04/11] Update 11631.bugfix --- src/twisted/newsfragments/11631.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/twisted/newsfragments/11631.bugfix b/src/twisted/newsfragments/11631.bugfix index d6fd5f74974..9610f747d81 100644 --- a/src/twisted/newsfragments/11631.bugfix +++ b/src/twisted/newsfragments/11631.bugfix @@ -1 +1 @@ -'test.yaml' workflow permissions restricted. +test.yaml workflow permissions restricted. From 1b77dc9895138cd26cfe01812d4c8af56ff08311 Mon Sep 17 00:00:00 2001 From: Alex <93376818+sashashura@users.noreply.github.com> Date: Fri, 2 Sep 2022 19:36:41 +0100 Subject: [PATCH 05/11] Update 11631.bugfix --- src/twisted/newsfragments/11631.bugfix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/twisted/newsfragments/11631.bugfix b/src/twisted/newsfragments/11631.bugfix index 9610f747d81..efd8fcf59fd 100644 --- a/src/twisted/newsfragments/11631.bugfix +++ b/src/twisted/newsfragments/11631.bugfix @@ -1 +1 @@ -test.yaml workflow permissions restricted. +`test.yaml` workflow permissions restricted. From 34dbb28aa33e7257a0259701009eeadec28af613 Mon Sep 17 00:00:00 2001 From: Alex <93376818+sashashura@users.noreply.github.com> Date: Sat, 3 Sep 2022 06:26:14 +0100 Subject: [PATCH 06/11] Update test.yaml --- .github/workflows/test.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index a2be34e7a50..de4100afa8b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -342,8 +342,6 @@ jobs: # process late in the release cycle, # The files are published only when a tag is created. release-publish: - permissions: - contents: write name: Check release and publish on twisted-* tag runs-on: 'ubuntu-20.04' steps: @@ -376,8 +374,15 @@ jobs: with: password: ${{ secrets.PYPI_UPLOAD_TOKEN }} + update-stable-branch: + permissions: + contents: write + name: Update stable branch - on stable tag + runs-on: 'ubuntu-20.04' + needs: [release-publish] + if: startsWith(github.ref, 'refs/tags/twisted-') + steps: - name: Update stable branch - on stable tag - if: startsWith(github.ref, 'refs/tags/twisted-') env: STABLE_BRANCH: 'stable' STABLE_REF_RE: '.*twisted-[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$' @@ -399,7 +404,7 @@ jobs: else echo "Branch not updated for not stable releases: $GITUB_REF" fi - + # We have this job so that the PR can be blocked on a single job. # In this way, each time a job is modified, From f584a33da067ea07c793b4280d7f7c1895855523 Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Sat, 3 Sep 2022 09:53:17 +0100 Subject: [PATCH 07/11] Add comment to document the job. Also make it a dependency for the general job success. --- .github/workflows/test.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index de4100afa8b..8601097783b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -374,6 +374,10 @@ jobs: with: password: ${{ secrets.PYPI_UPLOAD_TOKEN }} + # Read the Docs has no support for our "twisted-1.2.3" numbering convention + # and can't detect which tag is the stable one. + # A workaournd is to manually push to a "stable" branch to inform RTD + # that this is what we want at the "/en/stable" link. update-stable-branch: permissions: contents: write @@ -423,6 +427,7 @@ jobs: - apidocs - static-checks - release-publish + - update-stable-branch steps: - name: Require all successes shell: python From 595b2a550423f2f3cb9d2de599f9a671ca1076af Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Sat, 3 Sep 2022 09:54:01 +0100 Subject: [PATCH 08/11] Remove extra space --- .github/workflows/test.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8601097783b..062c232e35b 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -408,7 +408,6 @@ jobs: else echo "Branch not updated for not stable releases: $GITUB_REF" fi - # We have this job so that the PR can be blocked on a single job. # In this way, each time a job is modified, From a195a54d958107633c1606781785c59c67fa05a0 Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Sat, 3 Sep 2022 09:56:08 +0100 Subject: [PATCH 09/11] Update job name. --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 062c232e35b..f15607c5964 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -381,7 +381,7 @@ jobs: update-stable-branch: permissions: contents: write - name: Update stable branch - on stable tag + name: Update stable branch for RTD - on tag runs-on: 'ubuntu-20.04' needs: [release-publish] if: startsWith(github.ref, 'refs/tags/twisted-') From 47fe355e777027b386f3f935bef321d1ac18b437 Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Sat, 3 Sep 2022 15:02:03 +0100 Subject: [PATCH 10/11] Don't fail on skipped jobs --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f15607c5964..e5693d4825f 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -437,4 +437,4 @@ jobs: import os import sys results = json.loads(os.environ["RESULTS"]) - sys.exit(0 if all(result == "success" for result in results) else 1) + sys.exit(0 if all(result in ["success", "skipped"] for result in results) else 1) From a8cd91405855d60d5a562a92b14f523cbffd1be7 Mon Sep 17 00:00:00 2001 From: Adi Roiban Date: Sat, 3 Sep 2022 21:44:47 +0100 Subject: [PATCH 11/11] Make update stable branch optional --- .github/workflows/test.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index e5693d4825f..b5e5a78f221 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -426,7 +426,6 @@ jobs: - apidocs - static-checks - release-publish - - update-stable-branch steps: - name: Require all successes shell: python @@ -437,4 +436,4 @@ jobs: import os import sys results = json.loads(os.environ["RESULTS"]) - sys.exit(0 if all(result in ["success", "skipped"] for result in results) else 1) + sys.exit(0 if all(result == "success" for result in results) else 1)