From 3bfdecb3d96ba7201c0ef9f96a0ef8133387d1c7 Mon Sep 17 00:00:00 2001 From: konstin Date: Mon, 20 Apr 2026 15:34:42 -0400 Subject: [PATCH 1/7] Don't block PRs on linkcheck Fixes https://github.com/pypa/packaging.python.org/issues/1998 Currently, linkcheck is blocking PRs if any link in the project isn't accessible. Due to the high number of links, this regularly blocks unrelated PRs (see https://github.com/pypa/packaging.python.org/pull/2018 for a recent example). This PR moves linkcheck to a separate, non-blocking check. It will still run on PRs and report a failure if a newly added link 404s (https://github.com/pypa/packaging.python.org/issues/1998#issuecomment-4002461573), but an unrelated failure won't block PRs anymore. We also run the check on a daily cron, so that links going away is surfaced separately from PRs. --- .github/workflows/linkcheck.yml | 51 +++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 1 - 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linkcheck.yml diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml new file mode 100644 index 000000000..363aa5331 --- /dev/null +++ b/.github/workflows/linkcheck.yml @@ -0,0 +1,51 @@ +name: Test + +on: + push: + branches-ignore: + - gh-readonly-queue/** # Temporary merge queue-related GH-made branches + pull_request: + types: + - opened # default + - synchronize # default + - reopened # default + - ready_for_review # used in PRs created from GitHub Actions workflows + schedule: + - cron: '0 0 * * *' # Run daily at midnight UTC + workflow_call: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +permissions: {} + +jobs: + build: + name: linkcheck + if: ${{ github.repository_owner == 'pypa' }} + runs-on: ubuntu-latest + timeout-minutes: 20 + + steps: + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + + - name: Set up Python + uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + with: + python-version: "3.11" + cache: 'pip' + cache-dependency-path: 'requirements.txt' + + - name: Install dependencies + run: | + python -m pip install --upgrade nox virtualenv + + - name: Nox linkcheck + env: + # Authenticate github.com requests during linkcheck to avoid rate limits. + GITHUB_TOKEN: ${{ github.token }} + run: | + python -m nox -s linkcheck diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8d230d6ba..60de1cb52 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,7 +29,6 @@ jobs: matrix: noxenv: - build - - linkcheck steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 From 3dcce6830e8a523dd6316d8c35d3438042d9e565 Mon Sep 17 00:00:00 2001 From: konstin Date: Mon, 20 Apr 2026 15:42:51 -0400 Subject: [PATCH 2/7] Separate cancel group --- .github/workflows/linkcheck.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml index 363aa5331..9d14b3938 100644 --- a/.github/workflows/linkcheck.yml +++ b/.github/workflows/linkcheck.yml @@ -15,7 +15,7 @@ on: workflow_call: concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-linkcheck cancel-in-progress: true permissions: {} From efca0b63dfd2ee95786bc68b4c6f80a6324f32a3 Mon Sep 17 00:00:00 2001 From: konstin Date: Tue, 21 Apr 2026 09:54:10 -0400 Subject: [PATCH 3/7] Remove unused github token from test.yml --- .github/workflows/test.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 60de1cb52..5f018615e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -47,9 +47,6 @@ jobs: python -m pip install --upgrade nox virtualenv - name: Nox ${{ matrix.noxenv }} - env: - # Authenticate github.com requests during linkcheck to avoid rate limits. - GITHUB_TOKEN: ${{ github.token }} run: | python -m nox -s ${{ matrix.noxenv }} From 0f9103fec8611f0271cde379ee838ff673330dde Mon Sep 17 00:00:00 2001 From: konstin Date: Sun, 3 May 2026 22:09:06 +0200 Subject: [PATCH 4/7] Review --- .github/workflows/linkcheck.yml | 51 --------------------------------- .github/workflows/test.yml | 12 ++++++++ 2 files changed, 12 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/linkcheck.yml diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml deleted file mode 100644 index 9d14b3938..000000000 --- a/.github/workflows/linkcheck.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Test - -on: - push: - branches-ignore: - - gh-readonly-queue/** # Temporary merge queue-related GH-made branches - pull_request: - types: - - opened # default - - synchronize # default - - reopened # default - - ready_for_review # used in PRs created from GitHub Actions workflows - schedule: - - cron: '0 0 * * *' # Run daily at midnight UTC - workflow_call: - -concurrency: - group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-linkcheck - cancel-in-progress: true - -permissions: {} - -jobs: - build: - name: linkcheck - if: ${{ github.repository_owner == 'pypa' }} - runs-on: ubuntu-latest - timeout-minutes: 20 - - steps: - - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - with: - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 - with: - python-version: "3.11" - cache: 'pip' - cache-dependency-path: 'requirements.txt' - - - name: Install dependencies - run: | - python -m pip install --upgrade nox virtualenv - - - name: Nox linkcheck - env: - # Authenticate github.com requests during linkcheck to avoid rate limits. - GITHUB_TOKEN: ${{ github.token }} - run: | - python -m nox -s linkcheck diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5f018615e..4ce8a7b73 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,6 +11,8 @@ on: - synchronize # default - reopened # default - ready_for_review # used in PRs created from GitHub Actions workflows + schedule: + - cron: '0 0 * * *' # Run the linkcheck daily to surface failures independent of PRs workflow_call: concurrency: @@ -25,10 +27,17 @@ jobs: if: ${{ github.repository_owner == 'pypa' || github.event_name != 'schedule' }} runs-on: ubuntu-latest timeout-minutes: 20 + # Don't block PRs on linkcheck unrelated failures. + continue-on-error: ${{ matrix.ignore-errors || false }} strategy: + fail-fast: false matrix: noxenv: - build + - linkcheck + include: + - noxenv: linkcheck + ignore-errors: true steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -47,6 +56,9 @@ jobs: python -m pip install --upgrade nox virtualenv - name: Nox ${{ matrix.noxenv }} + env: + # Authenticate github.com requests during linkcheck to avoid rate limits. + GITHUB_TOKEN: ${{ matrix.noxenv == 'linkcheck' && github.token || '' }} run: | python -m nox -s ${{ matrix.noxenv }} From de82dfd66683f7cc7d03096eb3996890e021fd3f Mon Sep 17 00:00:00 2001 From: konstin Date: Sun, 3 May 2026 22:09:32 +0200 Subject: [PATCH 5/7] typo --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4ce8a7b73..1c98ddefc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,7 +27,7 @@ jobs: if: ${{ github.repository_owner == 'pypa' || github.event_name != 'schedule' }} runs-on: ubuntu-latest timeout-minutes: 20 - # Don't block PRs on linkcheck unrelated failures. + # Don't block PRs on linkcheck unrelated failures continue-on-error: ${{ matrix.ignore-errors || false }} strategy: fail-fast: false From b5c65a863088d26f9e0e259b7a26aca8fe746ac1 Mon Sep 17 00:00:00 2001 From: konsti Date: Sun, 3 May 2026 22:36:15 +0200 Subject: [PATCH 6/7] Update .github/workflows/test.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c98ddefc..973d46a93 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -11,8 +11,6 @@ on: - synchronize # default - reopened # default - ready_for_review # used in PRs created from GitHub Actions workflows - schedule: - - cron: '0 0 * * *' # Run the linkcheck daily to surface failures independent of PRs workflow_call: concurrency: From 0cb306149e1453c1bb8d407475ae87f9a6fab93d Mon Sep 17 00:00:00 2001 From: konstin Date: Sun, 3 May 2026 22:38:58 +0200 Subject: [PATCH 7/7] Restructure linkcheck matrix per review --- .github/workflows/test.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 973d46a93..81ea4f054 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,17 +25,18 @@ jobs: if: ${{ github.repository_owner == 'pypa' || github.event_name != 'schedule' }} runs-on: ubuntu-latest timeout-minutes: 20 - # Don't block PRs on linkcheck unrelated failures - continue-on-error: ${{ matrix.ignore-errors || false }} + continue-on-error: >- + ${{ fromJSON(matrix.continue-on-error) }} strategy: - fail-fast: false matrix: noxenv: - build - - linkcheck + continue-on-error: + - false include: - noxenv: linkcheck - ignore-errors: true + continue-on-error: >- # Don't block PRs on linkcheck unrelated failures + ${{ toJSON(github.event_name == 'pull_request') }} steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0