From 97336ccfe7a57c241c2b8fe18c72291702bbf7db Mon Sep 17 00:00:00 2001 From: bherbruck Date: Sun, 1 Nov 2026 20:19:41 +0000 Subject: [PATCH] Kernel pause: pull requests are judged by the kernel directories they change (#10807) A pull request outside crates/kernel, crates/geom and vendor/truck* is no longer labelled for a kernel word in its title. Issues and discussions keep the title check. Co-authored-by: Claude Opus 5.5 --- .github/workflows/kernel-paused.yml | 7 ++++--- CONTRIBUTING.md | 13 +++++++------ scripts/kernel-paused/kernel-paused.js | 20 +++++++++++--------- scripts/kernel-paused/kernel-paused.test.js | 14 ++++++++++++++ 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/.github/workflows/kernel-paused.yml b/.github/workflows/kernel-paused.yml index cfa6d659b..be5de83cd 100644 --- a/.github/workflows/kernel-paused.yml +++ b/.github/workflows/kernel-paused.yml @@ -1,6 +1,7 @@ -# While a new geometry kernel is evaluated, new issues, pull requests and discussions about kernel -# work are labelled `kernel-paused` for a maintainer to answer (CONTRIBUTING.md, "Kernel work is -# paused"). The logic is in scripts/kernel-paused/ (tested in ci.yml). +# While a new geometry kernel is evaluated, new issues and discussions about kernel work, and new +# pull requests that change the kernel directories, are labelled `kernel-paused` for a maintainer to +# answer (CONTRIBUTING.md, "Kernel work is paused"). The logic is in scripts/kernel-paused/ (tested +# in ci.yml). name: Kernel paused on: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7d444429d..54fed4165 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,12 +19,13 @@ Questions, ideas or want to say what you're working on? Join the [Discord](https ## Kernel work is paused -We're evaluating a new geometry kernel. Until that's decided, please don't open issues, pull -requests or discussions about kernel work: booleans, fillets, chamfers, shell, offsets, sweeps and -lofts, threads and holes, STEP/IGES import and export, tessellation, or anything else that changes -`crates/kernel/`. The pinned issue on the tracker explains it. New ones get the `kernel-paused` -label (`.github/workflows/kernel-paused.yml`) and a maintainer answers them. Crashes and data loss -are still taken as issues, and everything outside the kernel carries on as normal. +We're moving to a new geometry kernel. Until that's done, please don't open pull requests that +change `crates/kernel/`, `crates/geom/` or `vendor/truck*`, or issues and discussions about kernel +work: booleans, fillets, chamfers, shell, offsets, sweeps and lofts, threads and holes, STEP/IGES +import and export, or tessellation. The pinned issue on the tracker explains it. New ones get the +`kernel-paused` label (`.github/workflows/kernel-paused.yml`) and a maintainer answers them. Crashes +and data loss are still taken as issues. Pull requests outside those directories carry on as normal, +including the dialogs and tools for these features. ## Get it running (about 10 minutes on a fast machine) diff --git a/scripts/kernel-paused/kernel-paused.js b/scripts/kernel-paused/kernel-paused.js index 480a94378..2311aa0d2 100644 --- a/scripts/kernel-paused/kernel-paused.js +++ b/scripts/kernel-paused/kernel-paused.js @@ -1,21 +1,21 @@ 'use strict'; -// While a new geometry kernel is evaluated, new issues, pull requests and discussions about -// kernel work get the `kernel-paused` label, so a maintainer finds them and answers in person -// (CONTRIBUTING.md, "Kernel work is paused"). Reports of crashes and data loss are left alone, -// and so is anyone who can push to the repository. +// While a new geometry kernel is evaluated, new issues and discussions about kernel work, and new +// pull requests that change the kernel directories, get the `kernel-paused` label, so a maintainer +// finds them and answers in person (CONTRIBUTING.md, "Kernel work is paused"). Reports of crashes +// and data loss are left alone, and so is anyone who can push to the repository. const LABEL = 'kernel-paused'; const LABEL_COLOR = 'b60205'; const LABEL_DESCRIPTION = 'Kernel work is paused while a new geometry kernel is evaluated'; -// Kernel operations named in a title. "Hole" and "shell" are left out on purpose: they name UI -// work too, and a pull request that changes the kernel is caught by its files. +// Kernel operations named in the title of an issue or discussion. "Hole" and "shell" are left out +// on purpose: they name UI work too. A pull request is judged by its files, never by its title. const TOPIC = /\b(booleans?|fillets?|chamfers?|offsets?|sweeps?|lofts?|threads?|step|stp|iges|igs|tessellat\w*|kernel|truck|b-?rep)\b/i; // Crashes and lost work come first whatever the kernel is. const URGENT = /\b(crash\w*|panic\w*|data loss|lost (my )?work|corrupt\w*)\b/i; // What a pull request changes that makes it kernel work. -const KERNEL_PATHS = ['crates/kernel/', 'vendor/truck']; +const KERNEL_PATHS = ['crates/kernel/', 'crates/geom/', 'vendor/truck']; function isTopic(title) { return TOPIC.test(title || ''); @@ -55,10 +55,12 @@ async function handleOpened({ github, context }) { const pull = Boolean(context.payload.pull_request); if (isUrgent(item.title, item.body)) return `#${item.number}: a crash or data-loss report, left alone`; if (await canPush({ github, context }, item.user.login)) return `#${item.number}: by a maintainer, left alone`; - let kernel = isTopic(item.title); - if (pull && !kernel) { + let kernel; + if (pull) { const files = await github.paginate(github.rest.pulls.listFiles, { ...context.repo, pull_number: item.number, per_page: 100 }); kernel = touchesKernel(files.map((f) => f.filename)); + } else { + kernel = isTopic(item.title); } if (!kernel) return `#${item.number}: not kernel work`; await ensureLabel({ github, context }); diff --git a/scripts/kernel-paused/kernel-paused.test.js b/scripts/kernel-paused/kernel-paused.test.js index 910ad2b15..627cd45f4 100644 --- a/scripts/kernel-paused/kernel-paused.test.js +++ b/scripts/kernel-paused/kernel-paused.test.js @@ -80,6 +80,20 @@ test('a pull request outside the kernel is left alone', async () => { assert.deepEqual(calls, []); }); +test('a pull request with a kernel topic in its title but no kernel files is left alone', async () => { + const { github, calls } = fake({ files: ['crates/ui-egui/src/dialogs.rs'] }); + const pr = { number: 10, title: 'Fillet dialog: a clearer radius field', body: '', draft: false, node_id: 'PR_3', user: { login: 'someone' } }; + await paused.handleOpened({ github, context: { repo, payload: { pull_request: pr } } }); + assert.deepEqual(calls, []); +}); + +test('a pull request that changes crates/geom is labelled', async () => { + const { github, calls } = fake({ files: ['crates/geom/src/lib.rs'] }); + const pr = { number: 11, title: 'Tidy a helper', body: '', draft: false, node_id: 'PR_4', user: { login: 'someone' } }; + await paused.handleOpened({ github, context: { repo, payload: { pull_request: pr } } }); + assert.deepEqual(names(calls), ['addLabels']); +}); + test('a kernel discussion is labelled', async () => { const { github, calls } = fake(); const d = { number: 3, title: 'Ideas for better booleans', body: '', node_id: 'D_1', user: { login: 'someone' } };