From 41572efb92c5dc8691d9844e3c2fb98a002c70da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=BE=BE=E6=98=8E?= <83948628+tyza66@users.noreply.github.com> Date: Thu, 19 Nov 2026 09:41:24 +0800 Subject: [PATCH] fix(impact): name mise.local.toml with the other tool-version files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #326 named `.tool-versions`, `mise.toml`, `.mise.toml` and `.bun-version` after review suggested, correctly, that `mise.local.toml` and `.mise.local.toml` still came out as `Unknown changed file`. They are mise's machine-local override, so they pick the toolchain exactly as `mise.toml` does. The pattern grows to `/^\.?mise(?:\.local)?\.toml$/` rather than a second entry, so one example still covers the family, and `toolConfigurationSubject` matches it with the same expression instead of listing four names. - `tests/repo/tool-config-reasons.test.ts` gets one case per new name. - `tests/repo/config-patterns.test.ts`'s example becomes `mise.local.toml`, which the widened pattern still has to match. - The docs row lists both. Signed-off-by: 孙达明 <83948628+tyza66@users.noreply.github.com> --- docs/using-diffci.md | 2 +- src/git/git-diff.ts | 2 +- src/repo/impact.ts | 2 +- tests/repo/config-patterns.test.ts | 2 +- tests/repo/tool-config-reasons.test.ts | 3 +++ 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/docs/using-diffci.md b/docs/using-diffci.md index 8bdae3b..0be8730 100644 --- a/docs/using-diffci.md +++ b/docs/using-diffci.md @@ -606,7 +606,7 @@ For `Unknown changed file` and `Deleted source/asset`, `observe --json` also ret | `Infrastructure definition(s) changed; full validation required` | Edit a `Dockerfile` or `terraform/main.tf` | Yes: declare it in `inputs` | | `Database definition(s) changed; full validation required` | Add a file under `migrations/` | Yes: declare it in `inputs` | | `Language/framework configuration changed: …` | Edit `go.mod` or `pom.xml` | No | -| `Tool configuration changed: … (…); full validation required` | Change `.nvmrc`, `.node-version`, `.npmrc`, `.mocharc.*`, `tsconfig.base.json`, `tsconfig.test.json`, `.tool-versions`, `mise.toml`, `.mise.toml` or `.bun-version` | No | +| `Tool configuration changed: … (…); full validation required` | Change `.nvmrc`, `.node-version`, `.npmrc`, `.mocharc.*`, `tsconfig.base.json`, `tsconfig.test.json`, `.tool-versions`, `mise.toml`, `.mise.toml`, `mise.local.toml`, `.mise.local.toml` or `.bun-version` | No | | `Code that no file imports changed: …; a tool may load it by name, so full validation required` | Edit `karma.conf.js`, `.c8rc.js` or a root-level script that nothing imports | Yes: declare it in `inputs` | | `The test script runs …; full validation required` | Edit `scripts/check.mjs` when `package.json` has `"test": "node scripts/check.mjs && node --test"` | Yes: `verify` and the agent tools run that phase instead when it runs the program alone (`node scripts/check.mjs`) | | `The test script runs …, which imports …; full validation required` | Edit a module that `scripts/check.mjs` imports, with the same test script | Same as above | diff --git a/src/git/git-diff.ts b/src/git/git-diff.ts index f48a23a..f1e0c1b 100644 --- a/src/git/git-diff.ts +++ b/src/git/git-diff.ts @@ -256,7 +256,7 @@ export const CONFIG_PATTERNS = [ // falls back to the full suite; these entries make the reason name the file instead of reporting it // as unknown. /^\.tool-versions$/, - /^\.?mise\.toml$/, + /^\.?mise(?:\.local)?\.toml$/, /^\.bun-version$/, ]; diff --git a/src/repo/impact.ts b/src/repo/impact.ts index 0d70181..d4cfbcb 100644 --- a/src/repo/impact.ts +++ b/src/repo/impact.ts @@ -67,7 +67,7 @@ function toolConfigurationSubject(filePath: string): string | undefined { if (base === ".npmrc") return "package manager settings"; if (/^tsconfig\.[^/]+\.json$/.test(base) || /^jsconfig\.[^/]+\.json$/.test(base)) return "TypeScript configuration"; if (base === ".mocharc" || base.startsWith(".mocharc.")) return "Mocha settings"; - if (base === ".tool-versions" || base === "mise.toml" || base === ".mise.toml") return "tool versions"; + if (base === ".tool-versions" || /^\.?mise(?:\.local)?\.toml$/.test(base)) return "tool versions"; if (base === ".bun-version") return "Bun version"; return undefined; } diff --git a/tests/repo/config-patterns.test.ts b/tests/repo/config-patterns.test.ts index 4d2e8f0..0d9e70f 100644 --- a/tests/repo/config-patterns.test.ts +++ b/tests/repo/config-patterns.test.ts @@ -55,7 +55,7 @@ const EXAMPLES = [ ".npmrc", ".mocharc.json", ".tool-versions", - "mise.toml", + "mise.local.toml", ".bun-version", ]; diff --git a/tests/repo/tool-config-reasons.test.ts b/tests/repo/tool-config-reasons.test.ts index 0be4a21..55eb1fc 100644 --- a/tests/repo/tool-config-reasons.test.ts +++ b/tests/repo/tool-config-reasons.test.ts @@ -59,6 +59,9 @@ const CASES: Array<{ file: string; before: string; after: string; reason: string { file: ".tool-versions", before: "nodejs 22.5.0\n", after: "nodejs 24.1.0\n", reason: "Tool configuration changed: tool versions" }, { file: "mise.toml", before: '[tools]\nnode = "22.5.0"\n', after: '[tools]\nnode = "24.1.0"\n', reason: "Tool configuration changed: tool versions" }, { file: ".mise.toml", before: '[tools]\nnode = "22.5.0"\n', after: '[tools]\nnode = "24.1.0"\n', reason: "Tool configuration changed: tool versions" }, + // mise.local.toml is mise's machine-local override, so it picks the toolchain just as mise.toml does. + { file: "mise.local.toml", before: '[tools]\nnode = "22.5.0"\n', after: '[tools]\nnode = "24.1.0"\n', reason: "Tool configuration changed: tool versions" }, + { file: ".mise.local.toml", before: '[tools]\nnode = "22.5.0"\n', after: '[tools]\nnode = "24.1.0"\n', reason: "Tool configuration changed: tool versions" }, { file: ".bun-version", before: "1.1.0\n", after: "1.2.0\n", reason: "Tool configuration changed: Bun version" }, ];