From d4e4d72794413df29bb4b6fa6fcc3eb29ccd2eee Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 15 Feb 2026 15:19:09 +0200 Subject: [PATCH 1/4] Redirect from wiki.python.org/moin/X to wiki.python.org/python/X.html --- .github/workflows/wiki-redirects.yml | 46 +++++++++++++++++++ salt/moin/configs/wiki-redirects.conf | 13 ++++++ salt/moin/configs/wiki-static.conf | 7 ++- salt/moin/init.sls | 10 ++++ tests/wiki-redirects/nginx.conf | 5 ++ .../wiki-redirects/specs/moin-redirects.hurl | 24 ++++++++++ tests/wiki-redirects/test.sh | 19 ++++++++ 7 files changed, 120 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/wiki-redirects.yml create mode 100644 salt/moin/configs/wiki-redirects.conf create mode 100644 tests/wiki-redirects/nginx.conf create mode 100644 tests/wiki-redirects/specs/moin-redirects.hurl create mode 100755 tests/wiki-redirects/test.sh diff --git a/.github/workflows/wiki-redirects.yml b/.github/workflows/wiki-redirects.yml new file mode 100644 index 00000000..044ca7e5 --- /dev/null +++ b/.github/workflows/wiki-redirects.yml @@ -0,0 +1,46 @@ +name: Test wiki redirects + +on: + push: + paths: + - ".github/workflows/wiki-redirects.yml" + - "salt/moin/**" + - "tests/wiki-redirects/**" + pull_request: + paths: + - ".github/workflows/wiki-redirects.yml" + - "salt/moin/**" + - "tests/wiki-redirects/**" + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + FORCE_COLOR: "1" + +jobs: + wiki-redirects: + name: Hurl + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Download Hurl ${{ env.HURL_VERSION }} + run: > + curl --no-progress-meter --location --fail + --proto '=https' --tlsv1.2 + --output '/tmp/hurl.deb' + "https://github.com/Orange-OpenSource/hurl/releases/download/${{ env.HURL_VERSION }}/hurl_${{ env.HURL_VERSION }}_amd64.deb" + env: + HURL_VERSION: "5.0.1" + + - name: Install Hurl + run: sudo apt install --yes /tmp/hurl.deb + + - name: Run tests + run: bash tests/wiki-redirects/test.sh diff --git a/salt/moin/configs/wiki-redirects.conf b/salt/moin/configs/wiki-redirects.conf new file mode 100644 index 00000000..d20f4e2e --- /dev/null +++ b/salt/moin/configs/wiki-redirects.conf @@ -0,0 +1,13 @@ +# This file contains redirect configuration for wiki.python.org. +# It is included by ``wiki-static.conf``, +# and tested in ``tests/wiki-redirects/``. + +location /moin/ { + rewrite ^/moin/(.+)$ $scheme://$host/python/$1.html permanent; + return 301 $scheme://$host/python/; +} + +location / { + index index.html; + try_files $uri $uri/ =404; +} diff --git a/salt/moin/configs/wiki-static.conf b/salt/moin/configs/wiki-static.conf index a032d68b..019f0be2 100644 --- a/salt/moin/configs/wiki-static.conf +++ b/salt/moin/configs/wiki-static.conf @@ -12,8 +12,7 @@ server { root /data/www/wiki-static; - location / { - index index.html; - try_files $uri $uri/ =404; - } + # The redirect config is in a separate file + # to allow automatic testing via Hurl (https://hurl.dev/) + include sites.d/wiki-redirects.conf; } diff --git a/salt/moin/init.sls b/salt/moin/init.sls index 638be25f..d603a184 100644 --- a/salt/moin/init.sls +++ b/salt/moin/init.sls @@ -22,6 +22,16 @@ moin: - file: /etc/nginx/sites.d/ - pkg: nginx +/etc/nginx/sites.d/wiki-redirects.conf: + file.managed: + - source: salt://moin/configs/wiki-redirects.conf + - user: root + - group: root + - mode: "0644" + - require: + - file: /etc/nginx/sites.d/ + - pkg: nginx + /etc/consul.d/service-moin.json: file.managed: - source: salt://consul/etc/service.jinja diff --git a/tests/wiki-redirects/nginx.conf b/tests/wiki-redirects/nginx.conf new file mode 100644 index 00000000..55614c2b --- /dev/null +++ b/tests/wiki-redirects/nginx.conf @@ -0,0 +1,5 @@ +server { + listen 10001; + root /var/empty; + include wiki-redirects.conf; +} diff --git a/tests/wiki-redirects/specs/moin-redirects.hurl b/tests/wiki-redirects/specs/moin-redirects.hurl new file mode 100644 index 00000000..a51e3192 --- /dev/null +++ b/tests/wiki-redirects/specs/moin-redirects.hurl @@ -0,0 +1,24 @@ +# Assert that old /moin/ URLs redirect to the static archive. + +GET {{host}}/moin/BeginnersGuide +HTTP 301 +[Asserts] +header "Location" == "http://localhost/python/BeginnersGuide.html" + +GET {{host}}/moin/PythonBooks +HTTP 301 +[Asserts] +header "Location" == "http://localhost/python/PythonBooks.html" + +GET {{host}}/moin/FrontPage +HTTP 301 +[Asserts] +header "Location" == "http://localhost/python/FrontPage.html" + + +# Assert that /moin/ root redirects to /python/. + +GET {{host}}/moin/ +HTTP 301 +[Asserts] +header "Location" == "http://localhost/python/" diff --git a/tests/wiki-redirects/test.sh b/tests/wiki-redirects/test.sh new file mode 100755 index 00000000..dfb75ae3 --- /dev/null +++ b/tests/wiki-redirects/test.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -euxo pipefail + +# Test the wiki redirects. This script must be run from the repository root. + +docker stop wiki-redirects-nginx || true + +docker run --name wiki-redirects-nginx --detach --quiet --rm --tty \ + --mount type=bind,source=./tests/wiki-redirects/nginx.conf,target=/etc/nginx/conf.d/wiki.conf,readonly \ + --mount type=bind,source=./salt/moin/configs/wiki-redirects.conf,target=/etc/nginx/wiki-redirects.conf,readonly \ + -p 10001:10001 \ + nginx:1.26.1-alpine + +# Wait for the nginx container to start… +sleep 1 + +hurl --color --continue-on-error --variable host=http://localhost:10001 --test ./tests/wiki-redirects/specs/*.hurl + +docker stop wiki-redirects-nginx From addf1ebb51215b31ad98158b5389fb732e458319 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 15 Feb 2026 15:25:11 +0200 Subject: [PATCH 2/4] Combine redirect workflows --- .github/workflows/docs-redirects.yml | 46 ------------------- .../{wiki-redirects.yml => redirects.yml} | 23 +++++++--- 2 files changed, 17 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/docs-redirects.yml rename .github/workflows/{wiki-redirects.yml => redirects.yml} (66%) diff --git a/.github/workflows/docs-redirects.yml b/.github/workflows/docs-redirects.yml deleted file mode 100644 index d8ae59f9..00000000 --- a/.github/workflows/docs-redirects.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Test d.p.o redirects - -on: - push: - paths: - - ".github/workflows/docs-redirects.yml" - - "salt/docs/**" - - "tests/docs-redirects/**" - pull_request: - paths: - - ".github/workflows/docs-redirects.yml" - - "salt/docs/**" - - "tests/docs-redirects/**" - workflow_dispatch: - -permissions: - contents: read - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} - cancel-in-progress: true - -env: - FORCE_COLOR: "1" - -jobs: - docs-redirects: - name: Hurl - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Download Hurl ${{ env.HURL_VERSION }} - run: > - curl --no-progress-meter --location --fail - --proto '=https' --tlsv1.2 - --output '/tmp/hurl.deb' - "https://github.com/Orange-OpenSource/hurl/releases/download/${{ env.HURL_VERSION }}/hurl_${{ env.HURL_VERSION }}_amd64.deb" - env: - HURL_VERSION: "5.0.1" - - - name: Install Hurl - run: sudo apt install --yes /tmp/hurl.deb - - - name: Run tests - run: bash tests/docs-redirects/test.sh diff --git a/.github/workflows/wiki-redirects.yml b/.github/workflows/redirects.yml similarity index 66% rename from .github/workflows/wiki-redirects.yml rename to .github/workflows/redirects.yml index 044ca7e5..5e37283c 100644 --- a/.github/workflows/wiki-redirects.yml +++ b/.github/workflows/redirects.yml @@ -1,15 +1,19 @@ -name: Test wiki redirects +name: Test redirects on: push: paths: - - ".github/workflows/wiki-redirects.yml" + - ".github/workflows/redirects.yml" + - "salt/docs/**" - "salt/moin/**" + - "tests/docs-redirects/**" - "tests/wiki-redirects/**" pull_request: paths: - - ".github/workflows/wiki-redirects.yml" + - ".github/workflows/redirects.yml" + - "salt/docs/**" - "salt/moin/**" + - "tests/docs-redirects/**" - "tests/wiki-redirects/**" workflow_dispatch: @@ -24,10 +28,17 @@ env: FORCE_COLOR: "1" jobs: - wiki-redirects: - name: Hurl + redirects: + name: Hurl (${{ matrix.suite }}) runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + suite: + - docs-redirects + - wiki-redirects + steps: - uses: actions/checkout@v4 - name: Download Hurl ${{ env.HURL_VERSION }} @@ -43,4 +54,4 @@ jobs: run: sudo apt install --yes /tmp/hurl.deb - name: Run tests - run: bash tests/wiki-redirects/test.sh + run: bash tests/${{ matrix.suite }}/test.sh From 8a8a7c154cba32ec28e16291c65cf95ca619a614 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 15 Feb 2026 15:26:05 +0200 Subject: [PATCH 3/4] Bump GitHub Actions --- .github/workflows/lint.yml | 4 ++-- .github/workflows/redirects.yml | 2 +- .github/workflows/server-list.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 395c6c66..f274274f 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,10 +15,10 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v6 - name: Setup Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v6 with: python-version: "3.10" diff --git a/.github/workflows/redirects.yml b/.github/workflows/redirects.yml index 5e37283c..fcb41291 100644 --- a/.github/workflows/redirects.yml +++ b/.github/workflows/redirects.yml @@ -40,7 +40,7 @@ jobs: - wiki-redirects steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Download Hurl ${{ env.HURL_VERSION }} run: > curl --no-progress-meter --location --fail diff --git a/.github/workflows/server-list.yml b/.github/workflows/server-list.yml index dc7a4d3f..ebd3f6c7 100644 --- a/.github/workflows/server-list.yml +++ b/.github/workflows/server-list.yml @@ -14,14 +14,14 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Update salt-server-list.rst run: | wget --quiet -O docs/salt-server-list.rst https://salt-public.psf.io/salt-server-list.rst - name: Create Pull Request - uses: peter-evans/create-pull-request@v5 + uses: peter-evans/create-pull-request@v8 with: commit-message: Update docs/salt-server-list.rst branch: salt-server-list From 9c48f77b3df10e8a4a2fdf5a0194736578559eab Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 15 Feb 2026 15:28:49 +0200 Subject: [PATCH 4/4] Bump Hurl to 7.1.0 --- .github/workflows/redirects.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/redirects.yml b/.github/workflows/redirects.yml index fcb41291..9c85ec4b 100644 --- a/.github/workflows/redirects.yml +++ b/.github/workflows/redirects.yml @@ -48,7 +48,7 @@ jobs: --output '/tmp/hurl.deb' "https://github.com/Orange-OpenSource/hurl/releases/download/${{ env.HURL_VERSION }}/hurl_${{ env.HURL_VERSION }}_amd64.deb" env: - HURL_VERSION: "5.0.1" + HURL_VERSION: "7.1.0" - name: Install Hurl run: sudo apt install --yes /tmp/hurl.deb