Unverified Commit 966bc95a authored by Wolfgang Walther's avatar Wolfgang Walther Committed by GitHub
Browse files

workflows/labels: various fixes (#418504)

parents 84b6f246 d00d3190
Loading
Loading
Loading
Loading
+18 −4
Original line number Diff line number Diff line
@@ -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,6 +152,16 @@ jobs:
                    status: prEventCondition ? 'in_progress' : 'success',
                    exclude_pull_requests: true,
                    head_sha: pull_request.head.sha
                  })).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
@@ -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' ||
+1 −0
Original line number Diff line number Diff line
@@ -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:

+1 −1
Original line number Diff line number Diff line
@@ -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)