SolidCraft: an open-source parametric 3D CAD application built in pure Rust. Desktop, web, and automation through MCP.
Kernel pause: pull requests are judged by the kernel directories they change (#10807)
bherbruck97336ccfe7a5
diff --git a/.github/workflows/kernel-paused.yml b/.github/workflows/kernel-paused.ymlindex cfa6d659bb..be5de83cde 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 pausedon:diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex 7d444429d1..54fed4165f 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.jsindex 480a943789..2311aa0d23 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.jsindex 910ad2b154..627cd45f45 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' } };