Commit Graph

73929 Commits

Author SHA1 Message Date
Fredrik Adelöw 7efdc27464 Remove mountPath → initialRouteEntries defaulting
Don't auto-default initialRouteEntries from mountPath — for
parameterized paths this silently produces wrong params (literal
':name' values). Require callers to set both explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-25 15:18:11 +02:00
Fredrik Adelöw fcde31d871 Address review: remove fallback route, handle trailing splat, extract shared path
- Remove the path="*" fallback Route so mismatches between mountPath
  and initialRouteEntries surface as test failures instead of silently
  rendering without params
- Handle mountPath values that already end with /* to avoid double splat
- Extract repeated entity path string into a shared constant

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-21 15:49:36 +02:00
Fredrik Adelöw bc1b4263c9 Update API report for frontend-test-utils
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-21 15:40:39 +02:00
Fredrik Adelöw 5dca781385 Replace mountedRoutes-based wrapping with mountPath option
Address review feedback: mountedRoutes are for abstract route targets
the test subject links to, not for the subject itself. Add a dedicated
mountPath option that wraps the test element in a single Route with
the given path pattern, enabling useParams(). When mountPath is set
and initialRouteEntries is not, the initial entry defaults to mountPath.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-21 13:39:52 +02:00
Fredrik Adelöw 62dd4fc3bc Add changeset for renderInTestApp route matching fix
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-20 10:31:13 +02:00
Fredrik Adelöw a06003bc90 Switch to in-memory catalog client for entity page tests
Now that renderInTestApp properly sets up Route matching, the test can
use the real in-memory catalog client instead of jest stubs. The
in-memory client does actual ref-based lookups, verifying that
useEntityFromUrl receives correct route params end-to-end.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-20 10:28:18 +02:00
Fredrik Adelöw 95e107bc6e Wrap test element in Routes when mountedRoutes are provided
renderInTestApp disables app/routes, so the test element was rendered
without any Route matching. This meant useParams() always returned {}
even when initialRouteEntries and mountedRoutes were set — the mounted
routes only fed the route resolution API for link generation, never
created actual React Router <Route> matching for param extraction.

Wrap the test element in <Routes> with a <Route> for each mounted path
(plus a path="*" fallback), mirroring what the real AppRoutes extension
does via useRoutes(). This makes useParams() return real params when
initialRouteEntries matches a mounted route path.

Update entity page test href expectations to match the now-correct
production behavior where sub-route links resolve relative to the
matched parent Route, and replace synchronous getByTestId/getByText
with async findBy queries for lazy-loaded content.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-20 09:42:47 +02:00
Fredrik Adelöw a58bcdcb47 Add initialRouteEntries to fix flaky entity page test
The entity page resolves route params via useRouteRefParams. Without
initialRouteEntries, the MemoryRouter starts at '/' which doesn't
match the entity route pattern. On fast machines the mock entity
resolves before the useEffect error check fires, but on slow CI
runners the timing differs and the "No name provided!" error path
wins, causing the test to flake.

Adding initialRouteEntries ensures the router starts at a URL that
matches /catalog/:namespace/:kind/:name, so route params are always
available regardless of timing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-20 08:41:04 +02:00
Fredrik Adelöw 479d78ed5c Revert to catalogApiMock.mock(), only keep Entity type annotation
The InMemoryCatalogClient + initialRouteEntries approach didn't work
because route params weren't being resolved by the test harness,
causing getEntityByRef to receive an empty ref. The original mock
with getEntityByRef: async () => entityMock works correctly. The
only change from master is adding the Entity type annotation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-20 08:34:28 +02:00
Fredrik Adelöw ac1a4ab3c9 Type entityMock as Entity and remove casts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-20 00:02:02 +02:00
Fredrik Adelöw e5da0ab00f fix(catalog): fix flaky entity page test by providing initial route and in-memory catalog
The test rendered at '/' instead of a URL matching the entity route
pattern, causing useEntityFromUrl to sometimes fail to extract route
params. Use initialRouteEntries to start at the correct entity URL,
and switch from catalogApiMock.mock() to catalogApiMock() for a
working in-memory catalog client.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-19 23:58:21 +02:00
Fredrik Adelöw 8abfa78e4c Revert eachSupportedId guard — env var fix is sufficient
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-19 23:23:37 +02:00
Fredrik Adelöw 2c53691962 Fix postgres env var casing in deploy_packages workflow
The env vars used lowercase postgres18/postgres14 instead of uppercase
POSTGRES18/POSTGRES14, which didn't match the names expected by
TestDatabases. This caused all postgres-only test suites to see no
available databases and crash.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-19 23:21:47 +02:00
Fredrik Adelöw 03f0f3f953 Add changeset
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-19 23:19:18 +02:00
Fredrik Adelöw 1cbc3241a1 fix(backend-test-utils): prevent suite crash when no databases are available
When eachSupportedId() returned an empty array, describe.each([]) would
throw and crash the entire test suite. Return a placeholder ID instead,
so individual tests fail with a clear error rather than preventing the
entire suite from running.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-19 23:19:07 +02:00
Ben Lambert cfb9f07c28 Merge pull request #34228 from backstage/changeset-release/master 2026-05-19 21:21:29 +02:00
github-actions[bot] b97fcb0a93 Version Packages 2026-05-19 18:28:24 +00:00
Patrik Oldsberg 0a44fb3cb8 Merge pull request #33895 from ganievs/fix-valkey-cluster-client
fix: use iovalkey Cluster for Valkey cluster mode
2026-05-19 20:14:27 +02:00
Ben Lambert e16b564c6f Merge pull request #34310 from backstage/copilot/copy-commits-from-pr-34066
MCP structured responses, OIDC error improvements, catalog model reference config
2026-05-19 20:12:47 +02:00
benjdlambert 3f5e7ec2b4 Improve MCP safeStringify, OIDC error messages, and catalog model reference config
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 19:27:45 +02:00
Ben Lambert a5a269c27a Merge pull request #34300 from backstage/github-omit-suspended-rest
feat(catalog-backend-module-github): add experimental REST-based suspended user check
2026-05-19 19:19:59 +02:00
Love Kumar Chauhan ca8951ae87 fix(mcp-actions-backend): return structured content and remove markdown formatting in tool responses
This change aligns the MCP tool execution responses with the specification by returning plain text in the 'content' array and providing the raw JSON in a new 'structuredContent' field. It also removes the unnecessary Markdown code block formatting that was previously added to tool results.

Fixes #34052

Signed-off-by: Love Kumar Chauhan <lovechauhan6564@gmail.com>

Co-authored-by: benjdlambert <3645856+benjdlambert@users.noreply.github.com>
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 18:48:50 +02:00
Ben Lambert 381cf2ae10 Merge pull request #34308 from backstage/freben/cached-service-cleanup
Fix cache eviction race in CachedUserInfoService
2026-05-19 18:37:27 +02:00
Ben Lambert 359d5a502f Merge pull request #34016 from backstage/benjdlambert/api-v1beta2-mcp-server 2026-05-19 16:01:11 +02:00
Ben Lambert 484c073be9 Merge pull request #34261 from backstage/session/scheming-finch-ks70 2026-05-19 16:00:41 +02:00
MT Lewis 7c43925d68 feat(catalog-backend-module-github): remove @public tags from non-public github library functions
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2026-05-19 14:45:34 +01:00
MT Lewis 253c014cc1 feat(catalog-backend-module-github): memoize isGitHubEnterprise check
We should mostly get these for free because of the
GitHub conditional request caching, but this is a
nice safety net and also probably saves us some
time.

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2026-05-19 14:45:34 +01:00
MT Lewis 91d7d91317 feat(catalog-backend-module-github): restore previous sequential processing of connection nodes
Keeping this change as minimal as possible for
this first phase, will restore the parallel
processing in a later iteration.

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2026-05-19 14:45:33 +01:00
MT Lewis 340977de5e feat(catalog-backend-module-github): rename options_ to wrappedOptions
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2026-05-19 14:45:33 +01:00
MT Lewis d745f1c39c feat(catalog-backend-module-github): add experimental REST-based suspended user check
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2026-05-19 14:45:33 +01:00
Fredrik Adelöw 97d3bd4c7b Add changeset for cached service cleanup
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-19 15:27:22 +02:00
Fredrik Adelöw 4b4a614c5c Guard cache eviction on identity and use createDeferred in test
Only delete the cache entry on error if the map still holds the same
promise, preventing a stale rejection from evicting a newer entry.
Also switch the test to createDeferred for readability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-19 15:26:58 +02:00
Fredrik Adelöw 6eacdc036e Merge pull request #34252 from backstage/freben/lazy-permission-user
permission: cache user info, clean up PolicyQueryUser, drop getPluginRequestToken
2026-05-19 15:20:48 +02:00
Patrik Oldsberg 1dbc1543f4 Merge pull request #34299 from backstage/rugvip/nav-item-gone
frontend-plugin-api: remove NavItemBlueprint
2026-05-19 14:44:58 +02:00
Fredrik Adelöw a9f5560b49 Address review feedback: use fake timers and type the shared cache map
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-19 14:44:28 +02:00
Ben Lambert f0f6823a66 docs(scaffolder): update form decorators docs for promoted API (#34181)
* docs(scaffolder): update form decorators docs for promoted API

Signed-off-by: benjdlambert <ben@blam.sh>

* docs(scaffolder): address review feedback on form decorators docs

Signed-off-by: benjdlambert <ben@blam.sh>

---------

Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:24:58 +02:00
benjdlambert 3bf3c9d878 chore: remove unnecessary as const assertions
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:44 +02:00
benjdlambert 34e52d13e7 chore: regenerate API reports after rebase
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:35 +02:00
benjdlambert 6d98fcefe0 chore: regenerate API reports
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:35 +02:00
benjdlambert be71476943 chore: rename changeset, remove invalid example entity
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:34 +02:00
benjdlambert a674ec354d refactor: type McpServerApiEntity against ApiEntityV1alpha1
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:34 +02:00
benjdlambert 888955697b refactor: register mcp-server model in ai-model module, remove separate module
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:34 +02:00
benjdlambert 2003dcb4db refactor(catalog-model): move mcp-server model to opt-in backend module
Moves the mcp-server specType registration out of the default catalog
entity model into a separate backend module following the same pattern
as the AiResource module. Types and validators are now alpha exports.

Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:34 +02:00
benjdlambert 2a640474c2 chore: add invalid mcp-server example for validation demo
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:34 +02:00
benjdlambert 664d1da60f refactor(catalog-model): move mcp-server to v1alpha1 specType, drop v1alpha2
Registers mcp-server as a specType on v1alpha1/v1beta1 instead of
introducing a new v1alpha2 apiVersion. Adds addKindVersion to the
builder so separate layers can extend existing kinds.

Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:34 +02:00
benjdlambert 421af6a8d1 chore: add example MCP server API entity
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:34 +02:00
benjdlambert 8dd6dce9ed feat(catalog-model): add addKindVersion builder method and move v1alpha2 to own layer
Adds addKindVersion to CatalogModelLayerBuilder so layers can add
versions to an existing kind without re-declaring its metadata.
Moves v1alpha2 API registration into ApiEntityV1alpha2.ts as a
separate model layer using the new method.

Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:34 +02:00
benjdlambert fc407b805e chore: remove explanatory comments from apiEntityModel test
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:34 +02:00
benjdlambert 2cf453f328 refactor(catalog-model): rename API v1beta2 to v1alpha2
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:34 +02:00
benjdlambert dddcc0b382 chore(catalog-model): regenerate API report for v1beta2 additions
Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-19 14:15:33 +02:00