From 2d813b77199c4d43b30eec31e13bfb33effac173 Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Mon, 31 Aug 2026 18:06:11 -0400 Subject: [PATCH] ci/supportedBranches.js: move to ci/github-script This way it will be covered by our package.json when we configure ES Modules in the next commit. --- .github/workflows/merge-group.yml | 2 +- .github/workflows/test.yml | 4 ++-- ci/README.md | 2 +- ci/github-script/bot.js | 2 +- ci/github-script/check-target-branch-policy.ts | 2 +- ci/github-script/check-target-branch.ts | 2 +- ci/github-script/commits.js | 2 +- ci/github-script/lint-commits.js | 2 +- ci/github-script/manual-file-edits.js | 2 +- ci/github-script/merge.js | 2 +- ci/github-script/prepare.js | 4 ++-- ci/{ => github-script}/supportedBranches.js | 0 12 files changed, 13 insertions(+), 13 deletions(-) rename ci/{ => github-script}/supportedBranches.js (100%) diff --git a/.github/workflows/merge-group.yml b/.github/workflows/merge-group.yml index 196bf3040068..e1dfa01dbda3 100644 --- a/.github/workflows/merge-group.yml +++ b/.github/workflows/merge-group.yml @@ -38,7 +38,7 @@ jobs: TARGET_SHA: ${{ inputs.targetSha }} with: script: | - const { classify } = require('./ci/supportedBranches.js') + const { classify } = require('./ci/github-script/supportedBranches.js') const supportedSystems = require('./ci/github-script/supportedSystems.js') const baseBranch = ( diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fac0be466bb8..90be0ae08ced 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,9 +61,9 @@ jobs: '.github/workflows/lint.yml', '.github/workflows/merge-group.yml', '.github/workflows/test.yml', + 'ci/github-script/supportedBranches.js', 'ci/github-script/supportedSystems.js', 'ci/pinned.json', - 'ci/supportedBranches.js', 'pkgs/top-level/release-supported-systems.json', ].includes(file))) core.setOutput('merge-group', true) @@ -85,10 +85,10 @@ jobs: 'ci/github-script/prepare.js', 'ci/github-script/reviewers.js', 'ci/github-script/reviews.js', + 'ci/github-script/supportedBranches.js', 'ci/github-script/supportedSystems.js', 'ci/github-script/withRateLimit.js', 'ci/pinned.json', - 'ci/supportedBranches.js', 'pkgs/top-level/release-supported-systems.json', ].includes(file))) core.setOutput('pr', true) diff --git a/ci/README.md b/ci/README.md index 6fbdca39800c..992ed92ed3ac 100644 --- a/ci/README.md +++ b/ci/README.md @@ -104,7 +104,7 @@ For the purposes of CI, branches in the NixOS/nixpkgs repository are classified Some branches also have a version component, which is either `unstable` or `YY.MM`. -`ci/supportedBranches.js` is a script imported by CI to classify the base and head branches of a Pull Request. +`ci/github-script/supportedBranches.js` is a script imported by CI to classify the base and head branches of a Pull Request. This classification will then be used to skip certain jobs. This script can also be run locally to print basic test cases. diff --git a/ci/github-script/bot.js b/ci/github-script/bot.js index bdd304a5ac97..0646cd35953d 100644 --- a/ci/github-script/bot.js +++ b/ci/github-script/bot.js @@ -4,7 +4,7 @@ module.exports = async ({ github, context, core, dry }) => { const { DefaultArtifactClient } = await import('@actions/artifact') const { readFile, writeFile } = require('node:fs/promises') const withRateLimit = require('./withRateLimit.js') - const { classify } = require('../supportedBranches.js') + const { classify } = require('./supportedBranches.js') const { handleMerge } = require('./merge.js') const { handleReviewers } = require('./reviewers.js') diff --git a/ci/github-script/check-target-branch-policy.ts b/ci/github-script/check-target-branch-policy.ts index 30879a6f7ac8..75870b21b0bf 100644 --- a/ci/github-script/check-target-branch-policy.ts +++ b/ci/github-script/check-target-branch-policy.ts @@ -1,4 +1,4 @@ -const { classify, split } = require('../supportedBranches.js') +const { classify, split } = require('./supportedBranches.js') type TargetBranchPolicyFacts = { base: string diff --git a/ci/github-script/check-target-branch.ts b/ci/github-script/check-target-branch.ts index 8d07482a9533..4d0ff3dda30d 100644 --- a/ci/github-script/check-target-branch.ts +++ b/ci/github-script/check-target-branch.ts @@ -6,7 +6,7 @@ import type { GitHub } from '@actions/github/lib/utils' // They do seem quite similar, but this needs to run after eval, // and prepare.js obviously doesn't. -const { split } = require('../supportedBranches.js') +const { split } = require('./supportedBranches.js') const { readFile } = require('node:fs/promises') const { postReview, dismissReviews } = require('./reviews.js') const { diff --git a/ci/github-script/commits.js b/ci/github-script/commits.js index 1235f0b8619f..5563ceaa7fc6 100644 --- a/ci/github-script/commits.js +++ b/ci/github-script/commits.js @@ -1,7 +1,7 @@ // @ts-nocheck module.exports = async ({ github, context, core, dry, cherryPicks }) => { const { execFileSync } = require('node:child_process') - const { classify } = require('../supportedBranches.js') + const { classify } = require('./supportedBranches.js') const withRateLimit = require('./withRateLimit.js') const { dismissReviews, postReview } = require('./reviews.js') const reviewKey = 'check-commits' diff --git a/ci/github-script/lint-commits.js b/ci/github-script/lint-commits.js index ec51d0e281c5..8380f19c917b 100644 --- a/ci/github-script/lint-commits.js +++ b/ci/github-script/lint-commits.js @@ -1,4 +1,4 @@ -const { classify } = require('../supportedBranches.js') +const { classify } = require('./supportedBranches.js') const { getCommitDetailsForPR } = require('./get-pr-commit-details.js') /** @typedef {import('./get-pr-commit-details.js').Commit} Commit */ diff --git a/ci/github-script/manual-file-edits.js b/ci/github-script/manual-file-edits.js index 2c10b090e9e2..34d9bb1aa3e5 100644 --- a/ci/github-script/manual-file-edits.js +++ b/ci/github-script/manual-file-edits.js @@ -1,4 +1,4 @@ -const { classify } = require('../supportedBranches.js') +const { classify } = require('./supportedBranches.js') const { getCommitDetailsForPR } = require('./get-pr-commit-details') /** diff --git a/ci/github-script/merge.js b/ci/github-script/merge.js index d0538e4a26ba..6712d54cc2b6 100644 --- a/ci/github-script/merge.js +++ b/ci/github-script/merge.js @@ -1,5 +1,5 @@ // @ts-nocheck -const { classify } = require('../supportedBranches.js') +const { classify } = require('./supportedBranches.js') function runChecklist({ committers, diff --git a/ci/github-script/prepare.js b/ci/github-script/prepare.js index 03ac37c2f724..47ad4402925c 100644 --- a/ci/github-script/prepare.js +++ b/ci/github-script/prepare.js @@ -1,5 +1,5 @@ // @ts-nocheck -const { classify } = require('../supportedBranches.js') +const { classify } = require('./supportedBranches.js') const { postReview, dismissReviews } = require('./reviews.js') const reviewKey = 'prepare' const supportedSystems = require('./supportedSystems.js') @@ -65,7 +65,7 @@ module.exports = async ({ github, context, core, dry }) => { // commits between that base and head is the real base. We can query for this via GitHub's // REST API. There can be multiple candidates for the real base with the same number of // commits. In this case we pick the "best" candidate by a fixed ordering of branches, - // as defined in ci/supportedBranches.js. + // as defined in ./supportedBranches.js. // // These requests take a while, when comparing against the wrong release - they need // to look at way more than 10k commits in that case. Thus, we try to minimize the diff --git a/ci/supportedBranches.js b/ci/github-script/supportedBranches.js similarity index 100% rename from ci/supportedBranches.js rename to ci/github-script/supportedBranches.js