Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
db45da1
workflows/eval: Request reviews from changed package maintainers
infinisil Nov 28, 2024
0916ec4
workflows/eval: Use maintainer GitHub IDs for review requests of chan…
infinisil Dec 18, 2024
d29ca81
ci/request-reviews: split off a more reusable reviewer processing script
infinisil Jan 3, 2025
b4b6dde
workflows/eval: Reuse process-reviewers.sh
infinisil Jan 3, 2025
0fb6e88
workflows/eval: Minor cleanup
infinisil Jan 3, 2025
1b7595a
ci/request-reviews: Don't request reviews from non-repo-collaborators
infinisil Jan 3, 2025
58e9df7
ci/request-reviews: lowercase handles consistently
wolfgangwalther Jan 4, 2025
ff1e788
ci/request-reviews: rename code-owner related files
wolfgangwalther Jan 4, 2025
d82f7fa
ci/request-reviews: use generic wording instead of "code owner"
wolfgangwalther Jan 4, 2025
981355c
workflows/eval: make "requesting maintainer reviews" separate step
wolfgangwalther Jan 4, 2025
bc3c6a9
ci/request-reviews: share code to request reviewers from gh api
wolfgangwalther Jan 4, 2025
53d0959
ci/request-reviews: request reviewers 1-by-1
wolfgangwalther Jan 4, 2025
982e96f
ci/request-reviews: limit to 10 maintainer review requests
wolfgangwalther Jan 5, 2025
410510d
workflows/eval: add eval summary before requesting reviewers
wolfgangwalther Jan 6, 2025
8ccc1cf
actions/no-channel-pr: re run when base branch is updated
JohnRTitor Dec 29, 2024
fae0c7b
workflows: lock Ubuntu runner to ubuntu-22.04
trueNAHO Dec 26, 2024
1a7793d
workflows: update Ubuntu runner to ubuntu-24.04
trueNAHO Jan 4, 2025
c2ab54c
workflows: lock macOS runner to macos-14
trueNAHO Dec 27, 2024
a6ea384
workflows/eval: add swap to tackle recent borderline OOM
JohnRTitor Jan 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/backport.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
backport:
name: Backport Pull Request
if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name))
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
# Use a GitHub App to create the PR so that CI gets triggered
# The App is scoped to Repository > Contents and Pull Requests: write for Nixpkgs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/basic-eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
jobs:
tests:
name: basic-eval-checks
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
# we don't limit this action to only NixOS repo since the checks are cheap and useful developer feedback
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-cherry-picks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions: {}
jobs:
check:
name: cherry-pick-check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: github.repository_owner == 'NixOS'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-maintainers-sorted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
jobs:
nixos:
name: maintainer-list-check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: github.repository_owner == 'NixOS'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-nix-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:

nixos:
name: nixfmt-check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: get-merge-commit
if: "needs.get-merge-commit.outputs.mergedSha && !contains(github.event.pull_request.title, '[skip treewide]')"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-nixf-tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:
jobs:
nixos:
name: exp-nixf-tidy-check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: "!contains(github.event.pull_request.title, '[skip treewide]')"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-shell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions: {}
jobs:
x86_64-linux:
name: shell-check-x86_64-linux
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand All @@ -23,7 +23,7 @@ jobs:

aarch64-darwin:
name: shell-check-aarch64-darwin
runs-on: macos-latest
runs-on: macos-14
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/codeowners-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ name: Codeowners v2
#
# This split is done because checking code owners requires handling untrusted PR input,
# while requesting code owners requires PR write access, and those shouldn't be mixed.
#
# Note that the latter is also used for ./eval.yml requesting reviewers.

on:
pull_request_target:
Expand All @@ -39,7 +41,7 @@ jobs:
# Check that code owners is valid
check:
name: Check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: get-merge-commit
if: needs.get-merge-commit.outputs.mergedSha
steps:
Expand Down Expand Up @@ -86,7 +88,7 @@ jobs:
# Request reviews from code owners
request:
name: Request
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30

Expand All @@ -104,6 +106,6 @@ jobs:
run: nix-build ci -A requestReviews

- name: Request reviews
run: result/bin/request-reviews.sh ${{ github.repository }} ${{ github.event.number }} "$OWNERS_FILE"
run: result/bin/request-code-owner-reviews.sh ${{ github.repository }} ${{ github.event.number }} "$OWNERS_FILE"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
2 changes: 1 addition & 1 deletion .github/workflows/editorconfig-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

tests:
name: editorconfig-check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: get-merge-commit
if: "needs.get-merge-commit.outputs.mergedSha && github.repository_owner == 'NixOS' && !contains(github.event.pull_request.title, '[skip treewide]')"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/eval-lib-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

nixpkgs-lib-tests:
name: nixpkgs-lib-tests
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: get-merge-commit
if: needs.get-merge-commit.outputs.mergedSha
steps:
Expand Down
70 changes: 61 additions & 9 deletions .github/workflows/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

attrs:
name: Attributes
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: get-merge-commit
# Skip this and dependent steps if the PR can't be merged
if: needs.get-merge-commit.outputs.mergedSha
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:

eval-aliases:
name: Eval nixpkgs with aliases enabled
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: [ attrs, get-merge-commit ]
steps:
- name: Check out the PR at the test merge commit
Expand All @@ -78,13 +78,20 @@ jobs:

outpaths:
name: Outpaths
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: [ attrs, get-merge-commit ]
strategy:
fail-fast: false
matrix:
system: ${{ fromJSON(needs.attrs.outputs.systems) }}
steps:
- name: Enable swap
run: |
sudo fallocate -l 10G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

- name: Download the list of all attributes
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
Expand Down Expand Up @@ -118,7 +125,7 @@ jobs:

process:
name: Process
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: [ outpaths, attrs, get-merge-commit ]
outputs:
baseRunId: ${{ steps.baseRunId.outputs.baseRunId }}
Expand All @@ -133,6 +140,7 @@ jobs:
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ needs.get-merge-commit.outputs.mergedSha }}
fetch-depth: 2
path: nixpkgs

- name: Install Nix
Expand Down Expand Up @@ -194,12 +202,18 @@ jobs:
- name: Compare against the base branch
if: steps.baseRunId.outputs.baseRunId
run: |
nix-build nixpkgs/ci -A eval.compare \
git -C nixpkgs worktree add ../base ${{ needs.attrs.outputs.baseSha }}
git -C nixpkgs diff --name-only ${{ needs.attrs.outputs.baseSha }} ${{ needs.attrs.outputs.mergedSha }} \
| jq --raw-input --slurp 'split("\n")[:-1]' > touched-files.json

# Use the base branch to get accurate maintainer info
nix-build base/ci -A eval.compare \
--arg beforeResultDir ./baseResult \
--arg afterResultDir ./prResult \
--arg touchedFilesJson ./touched-files.json \
-o comparison

cat comparison/step-summary.md >> "$GITHUB_STEP_SUMMARY"
# TODO: Request reviews from maintainers for packages whose files are modified in the PR

- name: Upload the combined results
if: steps.baseRunId.outputs.baseRunId
Expand All @@ -211,20 +225,43 @@ jobs:
# Separate job to have a very tightly scoped PR write token
tag:
name: Tag
runs-on: ubuntu-latest
needs: process
runs-on: ubuntu-24.04
needs: [ attrs, process ]
if: needs.process.outputs.baseRunId
permissions:
pull-requests: write
statuses: write
steps:
# See ./codeowners-v2.yml, reuse the same App because we need the same permissions
# Can't use the token received from permissions above, because it can't get enough permissions
- uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0
id: app-token
with:
app-id: ${{ vars.OWNER_APP_ID }}
private-key: ${{ secrets.OWNER_APP_PRIVATE_KEY }}

- name: Download process result
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: comparison
path: comparison

- name: Tagging pull request
- name: Install Nix
uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 # v30

# Important: This workflow job runs with extra permissions,
# so we need to make sure to not run untrusted code from PRs
- name: Check out Nixpkgs at the base commit
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ needs.attrs.outputs.baseSha }}
path: base
sparse-checkout: ci

- name: Build the requestReviews derivation
run: nix-build base/ci -A requestReviews

- name: Labelling pull request
run: |
# Get all currently set rebuild labels
gh api \
Expand Down Expand Up @@ -252,6 +289,7 @@ jobs:
/repos/"$REPOSITORY"/issues/"$NUMBER"/labels \
-f "labels[]=$toAdd"
done < <(comm -13 before after)

env:
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
Expand All @@ -276,3 +314,17 @@ jobs:
GH_TOKEN: ${{ github.token }}
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
NUMBER: ${{ github.event.number }}

- name: Requesting maintainer reviews
run: |
# maintainers.json contains GitHub IDs. Look up handles to request reviews from.
# There appears to be no API to request reviews based on GitHub IDs
jq -r 'keys[]' comparison/maintainers.json \
| while read -r id; do gh api /user/"$id" --jq .login; done \
| GH_TOKEN=${{ steps.app-token.outputs.token }} result/bin/request-reviewers.sh "$REPOSITORY" "$NUMBER" "$AUTHOR"

env:
GH_TOKEN: ${{ github.token }}
REPOSITORY: ${{ github.repository }}
NUMBER: ${{ github.event.number }}
AUTHOR: ${{ github.event.pull_request.user.login }}
2 changes: 1 addition & 1 deletion .github/workflows/get-merge-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ permissions: {}

jobs:
resolve-merge-commit:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
mergedSha: ${{ steps.merged.outputs.mergedSha }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
jobs:
labels:
name: label-pr
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: "github.repository_owner == 'NixOS' && !contains(github.event.pull_request.title, '[skip treewide]')"
steps:
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-nixos-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
jobs:
nixos:
name: nixos-manual-build
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: github.repository_owner == 'NixOS'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-nixpkgs-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
jobs:
nixpkgs:
name: nixpkgs-manual-build
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
if: github.repository_owner == 'NixOS'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nix-parse-v2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

tests:
name: nix-files-parseable-check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: get-merge-commit
if: "needs.get-merge-commit.outputs.mergedSha && github.repository_owner == 'NixOS' && !contains(github.event.pull_request.title, '[skip treewide]')"
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nixpkgs-vet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
check:
name: nixpkgs-vet
# This needs to be x86_64-linux, because we depend on the tooling being pre-built in the GitHub releases.
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
# This should take 1 minute at most, but let's be generous. The default of 6 hours is definitely too long.
timeout-minutes: 10
needs: get-merge-commit
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/no-channel.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
name: "No channel PR"

on:
pull_request:
pull_request_target:
# Re-run should be triggered when the base branch is updated, instead of silently failing
types: [opened, synchronize, reopened, edited]
branches:
- 'nixos-**'
- 'nixpkgs-**'

permissions:
contents: read
permissions: {}

jobs:
fail:
permissions:
contents: none
name: "This PR is is targeting a channel branch"
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- run: |
cat <<EOF
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/periodic-merge-24h.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
contents: write # for devmasx/merge-branch to merge branches
pull-requests: write # for peter-evans/create-or-update-comment to create or update comment
if: github.repository_owner == 'NixOS'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
# don't fail fast, so that all pairs are tried
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/periodic-merge-6h.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
contents: write # for devmasx/merge-branch to merge branches
pull-requests: write # for peter-evans/create-or-update-comment to create or update comment
if: github.repository_owner == 'NixOS'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
strategy:
# don't fail fast, so that all pairs are tried
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:

build:
name: Build
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: get-merge-commit
steps:
- uses: actions/checkout@<VERSION>
Expand Down
Loading