Skip to content

fix: scope cache key generators to projects (fix #11281) - #11301

Merged
sheremet-va merged 3 commits into
vitest-dev:mainfrom
ecoyoung:fix/project-cache-key-11281
Sep 29, 2026
Merged

sheremet-va merged 3 commits into
vitest-dev:mainfrom
ecoyoung:fix/project-cache-key-11281

Conversation

@ecoyoung

@ecoyoung ecoyoung commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

Scope cache-key generators to their project config. Previously, every project's generators ran for every module, so differently configured projects could share the wrong transformed code.

Fixes #11281. Regression tests cover cold and warm caches in both project orders.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Build, lint, typecheck, and 10 cache/cache-resiliency tests pass. The full CI suite was not run locally.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Updated the plugin context JSDoc to state project scope.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify

netlify Bot commented Sep 17, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit f8a56d6
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/6abb7e4670bcc50008f4ffd5
😎 Deploy Preview https://deploy-preview-11301--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

sheremet-va
sheremet-va previously approved these changes Sep 28, 2026

@sheremet-va sheremet-va left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, can you merge form main and run formatter?

@ecoyoung

Copy link
Copy Markdown
Contributor Author

Updated, thanks! The two failing e2e checks (windows fs-module-cache-invalidation and vite@7 scoped-fixtures) also fail on main's own CI, so they're unrelated to this PR.

@sheremet-va
sheremet-va merged commit 92ba7fc into vitest-dev:main Sep 29, 2026
27 of 29 checks passed
dadezzz pushed a commit to dadezzz/forgejo-agent that referenced this pull request Oct 4, 2026
This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [vitest](https://vitest.dev) ([source](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest)) | [`5.0.2` → `5.0.3`](https://renovatebot.com/diffs/npm/vitest/5.0.2/5.0.3) | ![age](https://developer.mend.io/api/mc/badges/age/npm/vitest/5.0.3?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/vitest/5.0.2/5.0.3?slim=true) |

---

### Release Notes

<details>
<summary>vitest-dev/vitest (vitest)</summary>

### [`v5.0.3`](https://github.com/vitest-dev/vitest/releases/tag/v5.0.3)

[Compare Source](vitest-dev/vitest@v5.0.2...v5.0.3)

#####    🐞 Bug Fixes

- Isolate `result.status` between `repeats` runs  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa), **Hiroshi Ogawa** and **Codex (GPT-6)** in [#&#8203;11218](vitest-dev/vitest#11218) [<samp>(5dbeb)</samp>](vitest-dev/vitest@5dbebe9e3)
- Don't print an interceptor warning in browser mode  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;11377](vitest-dev/vitest#11377) [<samp>(15cc0)</samp>](vitest-dev/vitest@15cc006aa)
- Don't retry when `test.fails` expectedly failed  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa), **Hiroshi Ogawa** and **Codex (GPT-6)** in [#&#8203;11219](vitest-dev/vitest#11219) [<samp>(b2458)</samp>](vitest-dev/vitest@b24585f08)
- Scope cache key generators to projects  -  by [@&#8203;ecoyoung](https://github.com/ecoyoung) in [#&#8203;11281](vitest-dev/vitest#11281) and [#&#8203;11301](vitest-dev/vitest#11301) [<samp>(92ba7)</samp>](vitest-dev/vitest@92ba7fc1d)
- **browser**:
  - Delay server `listen` until tests start running  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;11366](vitest-dev/vitest#11366) [<samp>(7d8ed)</samp>](vitest-dev/vitest@7d8ed3e9b)
  - Check mock path boundaries  -  by [@&#8203;saryn17](https://github.com/saryn17), **Ryosei Sato** and [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;11361](vitest-dev/vitest#11361) and [#&#8203;11362](vitest-dev/vitest#11362) [<samp>(1c388)</samp>](vitest-dev/vitest@1c3888bce)
  - Keep config of browser-consumed environments  -  by [@&#8203;kasperpeulen](https://github.com/kasperpeulen) and **Claude** in [#&#8203;11378](vitest-dev/vitest#11378) [<samp>(aafc0)</samp>](vitest-dev/vitest@aafc0996f)
  - Ignore page crash while cancelling  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;11386](vitest-dev/vitest#11386) [<samp>(7c367)</samp>](vitest-dev/vitest@7c36748fa)
  - `toMatchScreenshot` uses wrong reference on retried tests  -  by [@&#8203;macarie](https://github.com/macarie) in [#&#8203;11393](vitest-dev/vitest#11393) [<samp>(c22ab)</samp>](vitest-dev/vitest@c22aba992)
- **cache**:
  - Revalidate imports of cached modules  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;11381](vitest-dev/vitest#11381) [<samp>(38f98)</samp>](vitest-dev/vitest@38f98855f)
- **deps**:
  - Pin `why-is-node-running` to `3.2.1` to avoid users running into `ERR_PNPM_TRUST_DOWNGRADE`  -  by [@&#8203;AriPerkkio](https://github.com/AriPerkkio) in [#&#8203;11403](vitest-dev/vitest#11403) [<samp>(f6c9a)</samp>](vitest-dev/vitest@f6c9a4977)
- **expect**:
  - Pass current equality testers to `expect.extend` asymmetric matchers  -  by [@&#8203;hi-ogawa](https://github.com/hi-ogawa), **Hiroshi Ogawa** and **Claude** in [#&#8203;11401](vitest-dev/vitest#11401) [<samp>(3e794)</samp>](vitest-dev/vitest@3e794a96b)
- **jsdom**:
  - Support Blob on jsdom 30.1  -  by [@&#8203;sheremet-va](https://github.com/sheremet-va) in [#&#8203;11379](vitest-dev/vitest#11379) [<samp>(6c49b)</samp>](vitest-dev/vitest@6c49b7197)
- **pool**:
  - Preserve unique pool ids when `groupOrder` is set  -  by [@&#8203;mtorp](https://github.com/mtorp) in [#&#8203;11392](vitest-dev/vitest#11392) [<samp>(50312)</samp>](vitest-dev/vitest@50312ebb4)
- **ui**:
  - Split-pane handle overlapping iframe  -  by [@&#8203;macarie](https://github.com/macarie) in [#&#8203;11221](vitest-dev/vitest#11221) [<samp>(f91db)</samp>](vitest-dev/vitest@f91db0dfd)
- **vitest**:
  - Remove root temp dir on close  -  by [@&#8203;abhinav-phi](https://github.com/abhinav-phi) in [#&#8203;11248](vitest-dev/vitest#11248) [<samp>(7c711)</samp>](vitest-dev/vitest@7c7119cf7)
- **vm**:
  - Do not optimize deps from index.html  -  by [@&#8203;ezefernandezyf](https://github.com/ezefernandezyf), **Hiroshi Ogawa** and **Codex (GPT-6)** in [#&#8203;11329](vitest-dev/vitest#11329) and [#&#8203;11360](vitest-dev/vitest#11360) [<samp>(caf28)</samp>](vitest-dev/vitest@caf2887de)
  - Don't reuse scripts across vite environments  -  by [@&#8203;MO2k4](https://github.com/MO2k4), **Martin Oehlert** and **Claude** in [#&#8203;11395](vitest-dev/vitest#11395) [<samp>(346d3)</samp>](vitest-dev/vitest@346d3896b)

#####     [View changes on GitHub](vitest-dev/vitest@v5.0.2...v5.0.3)

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMzIuMiIsInVwZGF0ZWRJblZlciI6IjQ0LjEzMi4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

defineCacheKeyGenerator not distinguishing common files that a plugin process differently in two projects

2 participants