diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 0ca429421891..3e44f8cdb0a6 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -72,8 +72,8 @@ jobs: maxConcurrent: 1, // Hourly limit is at 5000, but other jobs need some, too! // https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api - reservoir: 1000, - reservoirRefreshAmount: 1000, + reservoir: 500, + reservoirRefreshAmount: 500, reservoirRefreshInterval: 60 * 60 * 1000 }) // Pause between mutative requests @@ -152,7 +152,17 @@ jobs: status: prEventCondition ? 'in_progress' : 'success', exclude_pull_requests: true, head_sha: pull_request.head.sha - })).data.workflow_runs[0]?.id + })).data.workflow_runs[0]?.id ?? + // TODO: Remove this after 2025-09-17, at which point all eval.yml artifacts will have expired. + (await github.rest.actions.listWorkflowRuns({ + ...context.repo, + // In older PRs, we need eval.yml instead of pr.yml. + workflow_id: 'eval.yml', + event: 'pull_request_target', + status: 'success', + exclude_pull_requests: true, + head_sha: pull_request.head.sha + })).data.workflow_runs[0]?.id // Newer PRs might not have run Eval to completion, yet. We can skip them, because this // job will be run as part of that Eval run anyway. @@ -186,7 +196,11 @@ jobs: // Get all currently set labels that we manage const before = - pull_request.labels.map(({ name }) => name) + (await github.paginate(github.rest.issues.listLabelsOnIssue, { + ...context.repo, + issue_number: pull_request.number + })) + .map(({ name }) => name) .filter(name => name.startsWith('10.rebuild') || name == '11.by: package-maintainer' || diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 8e92b5aed816..368ede03ffe7 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -8,6 +8,7 @@ on: - .github/workflows/eval.yml - .github/workflows/lint.yml - .github/workflows/pr.yml + - .github/workflows/labels.yml - .github/workflows/reviewers.yml # needs eval results from the same event type pull_request_target: diff --git a/ci/eval/compare/default.nix b/ci/eval/compare/default.nix index 8b609cc8f2c4..302a2df90611 100644 --- a/ci/eval/compare/default.nix +++ b/ci/eval/compare/default.nix @@ -100,7 +100,7 @@ let (getLabels rebuildCountByKernel) # Adds "10.rebuild-*-stdenv" label if the "stdenv" attribute was changed ++ lib.mapAttrsToList (kernel: _: "10.rebuild-${kernel}-stdenv") ( - lib.filterAttrs (_: kernelRebuilds: kernelRebuilds ? "stdenv") rebuildsByKernel + lib.filterAttrs (_: lib.elem "stdenv") rebuildsByKernel ) # Adds the "11.by: package-maintainer" label if all of the packages directly # changed are maintained by the PR's author. (https://github.com/NixOS/ofborg/blob/df400f44502d4a4a80fa283d33f2e55a4e43ee90/ofborg/src/tagger.rs#L83-L88)