From 10c63e51170fa43f4e2ff021e8e113578f855662 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Wed, 25 Jun 2025 14:51:49 +0200 Subject: [PATCH 1/4] workflows/labels: fix processing the 100 oldest PRs The `page` number is 1-based, but the remainder might very well be 0. This lead to not looking at the 100 oldest PRs, ever. --- .github/workflows/labels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 3421ef77da5e..e1b7bd987cb2 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -390,7 +390,7 @@ jobs: // so it should certainly be hit on the next iteration. // TODO: Evaluate after a while, whether the above holds still true and potentially implement // an overlap between runs. - page: total_runs % Math.ceil(total_pulls / 100) + page: (total_runs % Math.ceil(total_pulls / 100)) + 1 })).data // Some items might be in both search results, so filtering out duplicates as well. From 4e9df2fc31d16dc04dff3d500583e4569c3ff07e Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Wed, 25 Jun 2025 14:54:43 +0200 Subject: [PATCH 2/4] workflows/labels: slightly improve logging --- .github/workflows/labels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index e1b7bd987cb2..e10f4832d513 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -247,6 +247,7 @@ jobs: .sort((a,b) => b-a) .at(0) ?? item.created_at ) + log('latest_event_at', latest_event_at.toISOString()) const stale_at = new Date(new Date().setDate(new Date().getDate() - 180)) From 3be9e2afc1f5745477addf578a87dad76d3d6517 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Wed, 25 Jun 2025 15:14:32 +0200 Subject: [PATCH 3/4] workflows/labels: label rebuilds on failed PR workflow We already tried to fix this case earlier, but didn't account for all cases: A scheduled workflow can also encounter a pull request with failed PR workflow. This failure doesn't need to be in the Eval part, so artifacts could *still* be available. To make sure PRs always get rebuild labels, just ignore the status condition. Either the artifact is there, or it is not. --- .github/workflows/labels.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index e10f4832d513..c92a9ac8da9a 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -147,8 +147,6 @@ jobs: ...context.repo, workflow_id: 'pr.yml', event: 'pull_request_target', - // In pull_request contexts the workflow is still running. - status: context.payload.pull_request ? undefined : 'success', exclude_pull_requests: true, head_sha: pull_request.head.sha })).data.workflow_runs[0]?.id ?? From 181802791664a7540b2e008a9daa2f8923842a96 Mon Sep 17 00:00:00 2001 From: Wolfgang Walther Date: Fri, 27 Jun 2025 09:15:22 +0200 Subject: [PATCH 4/4] workflows/labels: retry on transient API failures Currently, the labels job fails a few times each day with network failures. Retrying the requests should help. --- .github/workflows/labels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index c92a9ac8da9a..d84f49b5895c 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -65,6 +65,7 @@ jobs: uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: github-token: ${{ steps.app-token.outputs.token || github.token }} + retries: 3 script: | const Bottleneck = require('bottleneck') const path = require('node:path')