Commit Graph

69089 Commits

Author SHA1 Message Date
Johan Persson 5f88e246e3 chore(create-app): add jest 30 dependencies to template
Add jest and its environment dependencies as devDependencies to the
create-app template, so new Backstage apps are set up with Jest 30
support out of the box.

For Jest 30, apps need @jest/environment-jsdom-abstract and jsdom
instead of jest-environment-jsdom.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2025-12-11 18:07:01 +01:00
Johan Persson a169d7f6e9 fix(cli): add helpful error message for missing jest dependency
Since jest is now a peer dependencies, users must add it as a
devDependency themselves. This commit adds early detection and
a helpful error message when jest is missing, directing users
to the migration guide.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2025-12-11 18:07:01 +01:00
Johan Persson 900053a576 fix(catalog): fix flaky context menu test race condition
The "should render an onClick based context menu item" test was
failing intermittently due to a race condition where the test
would interact with the menu before the entity route parameters
were fully resolved.

Fix by adding explicit waits:
- Wait for entity to load before clicking the menu button
- Wait for menu to open before asserting on menu items

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2025-12-11 18:07:00 +01:00
Johan Persson e70ff47db3 chore: migrate three packages to MSW v2
Migrates test files in config-loader, events-node and kubernetes-react
packages from MSW 1.x to MSW 2.x API to fix compatibility issues with
Jest 30 and JSDOM v26.

Changes:
- Updated msw dependency from ^1.0.0 to ^2.0.0
- Changed imports from `rest` to `http` and `HttpResponse`
- Converted handler syntax from `res(ctx.*)` to `HttpResponse.*`
- Changed `toStrictEqual` to `toEqual` for response assertions

Affected packages:
- @backstage/config-loader
- @backstage/plugin-events-node
- @backstage/plugin-kubernetes-react

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2025-12-11 18:07:00 +01:00
Johan Persson cd0b8a11a3 chore: make jest a peer dependency with v29/v30 support
Move jest from dependencies to peer dependencies, allowing users to
choose between Jest 29 and Jest 30.

The CLI now detects the Jest version at runtime and uses the
appropriate environment:
- Jest 29: Uses standard jest-environment-jsdom
- Jest 30: Uses a custom environment based on @jest/environment-jsdom-abstract
  with fixes for Web API globals (fetch, streams, Error, etc.)

The cross-fetch polyfill is only injected for Jest 29, as with Jest 30+
our patched Jest environment is used. The network request blocker is made
MSW-compatible by checking if fetch was wrapped before blocking.

Jest 30 (with jsdom v27) fixes `Could not parse CSS stylesheet`
warnings/errors when testing components from @backstage/ui or other
packages using CSS `@layer` declarations.

New peer dependencies (install based on your Jest version):
- jest (required, ^29 or ^30)
- Jest 29 requires: jest-environment-jsdom
- Jest 30 requires: @jest/environment-jsdom-abstract, jsdom

Production code changes for jsdom 27 testability:
- AppIdentityProxy: extract navigateToUrl method for spying
- LiveReloadAddon: export utils.reloadPage for spying
- collect.ts: export internal.resolvePackagePath for mocking

MockFetchApi: evaluate global.fetch at call time instead of construction
time, allowing MSW to patch fetch after MockFetchApi is constructed.

Test adaptations for jsdom 27:
- Use RGB values instead of named colors in CSS assertions
- Update error format expectations (hyphenated type names, SyntaxError
  instead of FetchError for JSON parse errors)
- Simplify URL error assertions for cross-version compatibility
- Fix accessible name whitespace handling for external links
- Use history.replaceState for location mocking (non-configurable)
- Use fireEvent.blur for contentEditable elements
- Move async assertions inside waitFor for race conditions
- Remove Blob.prototype.text polyfill (now native)
- Remove test case using credentials in plugin:// URLs

Test adaptations for Jest 30:
- Replace `expect.objectContaining([...])` with direct array equality
- Replace `expect.objectContaining({ length: N })` with
  `expect.any(Array)` + separate `toHaveLength()` assertions
- Use child process for native Node.js module resolution in
  collect.test.ts to work around Jest 30's resolver behavior
- Update snapshot headers for new Jest format

Also removes the jest-haste-map patch which is no longer needed.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2025-12-11 18:06:55 +01:00
Ben Lambert 6dd4fdfae0 Merge pull request #32102 from backstage/copilot/commit-changeset-result
Exit prerelease mode
2025-12-11 14:55:21 +01:00
copilot-swe-agent[bot] 2576e92f29 Exit prerelease mode
Co-authored-by: benjdlambert <3645856+benjdlambert@users.noreply.github.com>
2025-12-11 10:30:59 +00:00
Patrik Oldsberg 0197b44433 Merge pull request #32101 from backstage/rugvip/in
docs: +in
2025-12-11 11:28:57 +01:00
copilot-swe-agent[bot] 93740f4fed Initial plan 2025-12-11 10:25:54 +00:00
Ben Lambert b22618c336 Merge pull request #32099 from backstage/blam/support-public-kety
`integrations`: Add flag for using an app for `publicAccess`
2025-12-11 11:04:13 +01:00
Patrik Oldsberg 8cab6b0b7e docs: +in
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-12-11 11:02:33 +01:00
benjdlambert 45146fbbc7 chore: fix api reports
Signed-off-by: benjdlambert <ben@blam.sh>
2025-12-11 10:47:44 +01:00
benjdlambert a26a3229bc chore: add changeset
Signed-off-by: benjdlambert <ben@blam.sh>
2025-12-11 09:39:49 +01:00
benjdlambert f2b7585824 feat: support marking a github app as a public token generator
Signed-off-by: benjdlambert <ben@blam.sh>
2025-12-11 09:33:46 +01:00
Patrik Oldsberg ce948cdf25 Merge pull request #32096 from backstage/rugvip/es2022
cli: move back to ES2022 in tsconfig
2025-12-10 23:40:23 +01:00
Andre Wanlin 6c53ccc136 Merge pull request #31655 from williamwu-mongodb/feature/add-scheduled-tasks-devtools-plugin
feat: add scheduled tasks UI to devtools plugin
2025-12-10 16:26:54 -06:00
Patrik Oldsberg c07af9f966 cli: move back to ES2022 in tsconfig
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-12-10 20:46:08 +01:00
backstage-goalie[bot] 08d56dd72d Merge pull request #32085 from backstage/renovate/eslint-rspack-plugin-4.x-lockfile
chore(deps): update dependency eslint-rspack-plugin to v4.3.0
2025-12-10 00:11:37 +00:00
williamwu-mongodb c692fbf5e3 Update plugins/devtools-common/src/permissions.ts
Co-authored-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com>
2025-12-09 12:54:41 -08:00
williamwu-mongodb bf97a69ad0 Update plugins/devtools-common/src/permissions.ts
Co-authored-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com>
2025-12-09 12:54:32 -08:00
williamwu-mongodb 02b0071484 Update plugins/devtools-common/src/permissions.ts
Co-authored-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com>
2025-12-09 12:54:21 -08:00
williamwu-mongodb d76c326143 repo fix
Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com>
2025-12-09 12:45:44 -08:00
williamwu-mongodb c89d74b763 address feedback
Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com>
2025-12-09 12:07:00 -08:00
williamwu-mongodb ef961b2299 Update .changeset/short-lizards-find.md
Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com>
2025-12-09 11:15:02 -08:00
williamwu-mongodb 6a552b389a Update plugins/devtools/config.d.ts
Co-authored-by: Fredrik Adelöw <freben@gmail.com>
Signed-off-by: williamwu-mongodb <william.t.wu@mongodb.com>
2025-12-09 11:14:52 -08:00
Fredrik Adelöw 61b8f93105 Merge pull request #31947 from backstage/changeset-release/master
Version Packages (next)
2025-12-09 17:01:46 +01:00
github-actions[bot] e08f48a9b5 Version Packages (next) 2025-12-09 15:00:09 +00:00
Fredrik Adelöw 081b310d26 Merge pull request #31940 from backstage/renovate/npm-modelcontextprotocol-sdk-vulnerability
chore(deps): update dependency @modelcontextprotocol/sdk to v1.24.0 [security]
2025-12-09 15:53:49 +01:00
Andre Wanlin 2eb837ffe1 Merge pull request #32076 from backstage/sennyeya/fix-root-metadata-service
chore(docs): add root instance metadata to sidebar
2025-12-09 08:24:24 -06:00
benjdlambert e83e038dad chore: ok, this is it
Signed-off-by: benjdlambert <ben@blam.sh>
2025-12-09 15:11:32 +01:00
renovate[bot] a40b2ee43a chore(deps): update dependency eslint-rspack-plugin to v4.3.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-09 13:21:15 +00:00
Andre Wanlin 2c7447ca3a Update .changeset/short-lizards-find.md
Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
2025-12-09 07:07:32 -06:00
Andre Wanlin e008f86edf Update .changeset/short-lizards-find.md
Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
2025-12-09 07:07:23 -06:00
Fredrik Adelöw 6fc8377792 Merge pull request #32048 from awanlin/topic/plugin-directory-audit
Plugins - Added plugin directory audit script
2025-12-09 13:51:42 +01:00
Fredrik Adelöw 1ff323a3b1 Merge pull request #32004 from backstage/renovate/backstage-community-plugin-explore-common-0.x
fix(deps): update dependency @backstage-community/plugin-explore-common to ^0.9.0
2025-12-09 13:47:23 +01:00
Fredrik Adelöw bbd3dec4ae Merge pull request #32069 from backstage/renovate/nodemailer-7.x
chore(deps): update dependency @types/nodemailer to v7
2025-12-09 13:47:05 +01:00
benjdlambert 043140529a chore: fix deps
Signed-off-by: benjdlambert <ben@blam.sh>
2025-12-09 12:54:52 +01:00
Patrik Oldsberg 625148b35f Merge pull request #28129 from backstage/sennyeya/deployment-discovery
feat: add a new system metadata service
2025-12-09 12:48:52 +01:00
Fredrik Adelöw d5cde2a0ee Merge pull request #31678 from vandr0iy/vandr0iy/configurable-referrer-policy
feat(frontend): allow configuration of the referrerPolicy
2025-12-09 12:36:05 +01:00
Patrik Oldsberg 0700f49a4c Apply suggestions from code review
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2025-12-09 12:29:15 +01:00
Fredrik Adelöw 622c29c900 Update .changeset/early-doors-visit.md
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2025-12-09 12:18:11 +01:00
Fredrik Adelöw f80cb26825 Merge pull request #31349 from IlyaSavich/kubernetes-router-extension
Add Kubernetes Router extension point, add fetcher to custom objects provider
2025-12-09 11:58:52 +01:00
renovate[bot] ac759e20da chore(deps): update dependency @modelcontextprotocol/sdk to v1.24.0 [security]
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-09 11:57:53 +01:00
Ben Lambert e1e90684a2 Merge pull request #32082 from OSfrog/fix/catalog-about-card-filter-before-useprops
fix(catalog): filter icon links before calling useProps
2025-12-09 11:36:42 +01:00
Tommy Le 91f5ed82d6 fix(catalog): filter icon links before calling useProps
The catalogAboutEntityCard was calling useProps() for all icon links
before checking filters, causing hooks with side effects to execute
for all entity types. This fix reverses the order to check the filter
first, then only call useProps() if the filter passes.

This prevents unnecessary side effects like API calls, auth flows, or
state updates from running for icon links that won't be displayed.

Signed-off-by: Tommy Le <tommy_le@outlook.com>
2025-12-09 10:58:42 +01:00
Fredrik Adelöw d90aed6b3a Merge pull request #32077 from backstage/freben/immediate
updated the immediate entity provider example a bit
2025-12-09 10:12:40 +01:00
Fredrik Adelöw e7204e24db updated the immediate entity provider example a bit
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2025-12-09 08:40:50 +01:00
aramissennyeydd 7d201ad7cb chore(docs): add root instance metadata to sidebar
Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
2025-12-08 17:30:56 -05:00
Fredrik Adelöw cecaa124bb Merge pull request #32014 from backstage/freben/versioned-entity-list
Use a versioned context for `useEntityList`
2025-12-08 19:37:31 +01:00
renovate[bot] b267aeaa04 chore(deps): update dependency @types/nodemailer to v7
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-08 16:08:04 +00:00