-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace allowed-refs.json with ref-statuses.json
As far as stable versions of Nix Flake Checker are concerned, a Nixpkgs branch is considered supported if it meets the following criteria: 1. The branch is connected to a channel. 2. The branch’s status is not "unmaintained". 3. The branch’s status is not "beta". Before this change, here’s how Nix Flake Checker would enforce those criteria: 1. An API request was made to get a list of channels. Refs were only considered if they were on that list [1]. 2. Refs would only get added to allowed-refs.json if their current field was set to "1" [1]. (The current field gets set to "0" for unmaintained channels and "1" for all other channels [2].) 3. The Nix Flake Checker project was careful about when it released updates that contained changes to allowed-refs.json. Specifically, updates to allowed-refs.json would stay in the main branch and not be released while Nixpkgs channels were in beta. This change replaces allowed-refs.json with ref-statuses.json. allowed-refs.json contained a list of supported Nixpkgs branches. ref-statuses.json contains a list of Nixpkgs branches along with their current status ("rolling", "beta", "stable", "deprecated" or "unmaintained"). Here’s how Nix Flake Checker now enforces those same criteria: 1. Unchanged. 2. All channel branches get added to ref-statuses.json regardless of whether or not they’re supported. Nix Flake Checker checks if a branch’s status is "unmaintained" at runtime. 3. Nix Flake Checker checks if a branch’s status is "beta" at runtime. The main motivation behind this change is to make it easier to create a future commit. That future commit will allow users to access a branch’s status via a CEL variable. As an added bonus, this change also makes it so that the Nix Flake Checker project doesn’t have to be careful about releasing updates while there’s Nixpkgs branches that are in beta. [1]: src/allowed_refs.rs [2]: <https://github.com/NixOS/infra/blob/ae9b362fe0d92cff76c0b5404d0bcec59dd322cb/build/pluto/prometheus/exporters/channel-exporter.py#L78>
- Loading branch information
1 parent
ca7cfb3
commit 65bc77d
Showing
10 changed files
with
161 additions
and
134 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Check that ref statuses are up to date | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * *" # Daily | ||
|
||
jobs: | ||
check-ref-statuses: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: DeterminateSystems/nix-installer-action@main | ||
|
||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
|
||
- name: Check ref statuses | ||
run: | | ||
nix develop --command cargo run --features ref-statuses -- --check-ref-statuses | ||
- name: Update ref-statuses.json | ||
if: failure() | ||
run: | | ||
ref_statuses_json=$(nix develop --command cargo run --features ref-statuses -- --get-ref-statuses | jq --sort-keys .) | ||
echo "${ref_statuses_json}" > ref-statuses.json | ||
- name: Create pull request | ||
if: failure() | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
commit-message: Update ref-statuses.json to new valid Git refs list | ||
title: Update ref-statuses.json | ||
body: | | ||
Nixpkgs has changed its list of maintained references. This PR updates `ref-statuses.json` to reflect that change. | ||
branch: updated-ref-statuses | ||
base: main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,4 +38,4 @@ thiserror = { workspace = true } | |
|
||
[features] | ||
default = [] | ||
allowed-refs = [] | ||
ref-statuses = [] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"nixos-24.05": "deprecated", | ||
"nixos-24.05-small": "deprecated", | ||
"nixos-24.11": "stable", | ||
"nixos-24.11-small": "stable", | ||
"nixos-unstable": "rolling", | ||
"nixos-unstable-small": "rolling", | ||
"nixpkgs-24.05-darwin": "deprecated", | ||
"nixpkgs-24.11-darwin": "stable", | ||
"nixpkgs-unstable": "rolling" | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.