Repository navigation
fix(git-diff): fall back when a package's jest, vitest or Babel config changes - #121
Conversation
…g changes (DiffCI#117) CONFIG_PATTERNS is anchored at the repository root, so a lone change to packages/web/jest.config.js, vitest.config.* or babel.config.*/.babelrc* gave a SELECTIVE plan with no tests, while the same file at the root fell back. These configurations apply to every test of the directory that holds them, so a copy below the root now sets the config signal and the fallback reason names it. node_modules copies are ignored. Fixes DiffCI#117 Signed-off-by: sarankumar1325 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Engine pin moves from 8b8c5f5 to 93f4e6e, picking up the Core engine changes since 0.3.39, found on paperclipai/paperclip where every change planned FULL: - Go modules without a root go.mod are confined to their directories instead of blocking every change (a9f8b73). - A Vitest root or Jest rootDir that names the config's own directory (__dirname, import.meta.dirname, dirname(fileURLToPath(import.meta.url)), ...) is supported (6e93d73). - Relative imports into an installed package's node_modules are recorded as that external package, not as unresolved imports (ff2a671). - import(new URL(literal, import.meta.url).href) folds to its target (93f4e6e). - A package's jest, vitest or Babel config change falls back (#117, #121). Records the Muse marketplace digest for the 0.3.40 package tree, computed by the pinned Muse 1.4.11-R6667.1 build from an LF archive (the same method reproduces 0.3.39's recorded digest). Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: adityankale190895 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: adityankale190895 <[email protected]>
|
Hi @sarankumar1325, thank you for your ten merged PRs, #105 to #121, all merged on 11 November. Your shared lockfile list replaced the hand-written copies across the engine, and #121 closed a real gap: a package's own test config changing used to select no tests. We have just added contributor tiers to DiffCI (CONTRIBUTING.md), and I would like to invite you to be the area maintainer for lockfile and config-file signals: the code that decides what a lockfile, There is no obligation. If you would like it, you have already done most of #97. Three copies are left ( You are also on our new contributors page, diffci.com/contributors. Tell me if you would rather not be listed there, or would like a different name or link. |
Fixes #117
What DiffCI did before this PR
I built the fixture from step 1 of the issue: a workspace with
packages/web(Jest, babel-jest, two sources, two tests). The head commit changes one config file inpackages/web. Then I rananalyzeCheckouton it.packages/web/babel.config.jspackages/web/.babelrc.jspackages/web/jest.config.jspackages/web/vitest.config.jsSo the issue is confirmed.
isConfigFileclassifies these files asconfigat any depth, and theconfigbranch inimpact.tsonly recordsCONFIG_GLOBALevidence. The fallback comes fromconfigChanged, andCONFIG_PATTERNSonly matches at the root.vitest.config.*has the same gap, so I included it.Fix
src/git/git-diff.ts: a newisNestedTestConfig(path)matchesjest.config.*,vitest.config.*,babel.config.*and.babelrc*below the root, and skips anything undernode_modules.computeAnalysisadds those paths to theconfigsignal, so the existingCONFIG_GLOBALfallback fires and its reason names the file. Root behaviour is unchanged, because root files are still matched byCONFIG_PATTERNS.I kept the list to test-runner and transform configs, which apply to every test in their directory. I left out other basenames that
isConfigFileknows (eslint, prettier, tailwind, postcss, next, a nestedpackage.jsonortsconfig.json): they don't decide which tests run or how they are transformed, and nestedpackage.jsonalready has its own handling. I picked a full run over selecting only the owning package's tests. It is the conservative choice, it matches the root behaviour, and it stays correct when the root test command runs the package through--workspaces. Happy to narrow it to the package if you prefer.Tests
tests/repo/subdirectory-config-change.test.ts(registered inrelease-files.json):babel.config.js,.babelrc.js,jest.config.jsandvitest.config.js. It asserts mode FULL,fallbackRequired, bothpackages/webtests selected, and a fallback reason that names the file. All four cases fail on main.isNestedTestConfigcases: nested forms match. Root files,node_modulescopies,jest.setup.jsandmy-babel.config.jsdon't.computeAnalysis: a nestedjest.config.jssetsconfigChangedandsignalPaths.config, and a nested source file does not.docs/using-diffci.md: theConfiguration file(s) changedrow now lists a package'sjest.config.jsas an example.npm test: 950 passed, 0 failed.npm run typecheckandnpm run audit:boundaryare clean.AI assistance: I used an AI coding assistant to help write this change. I reviewed and ran everything above myself.