681 Commits

Author SHA1 Message Date
github-actions[bot] 68db890456 Version Packages (next) 2026-05-26 15:26:38 +00:00
github-actions[bot] b97fcb0a93 Version Packages 2026-05-19 18:28:24 +00:00
github-actions[bot] 7295193bb6 Version Packages (next) 2026-04-28 15:53:09 +00:00
Patrik Oldsberg 482cc5900a Address review feedback for feature flag isolation
Deduplicate the plugin/module feature flag registration loops and
distinguish the error source (Plugin vs Module). Treat
FEATURE_FLAG_INVALID as a warning in frontend-defaults.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-23 14:47:52 +02:00
Patrik Oldsberg b6ca666812 frontend-app-api: isolate invalid feature flag registrations
Wrap each feature flag registration in a try/catch so that a single
invalid flag name (e.g. containing a slash) is reported through the
error collector instead of crashing the entire app at bootstrap.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-23 00:38:05 +02:00
github-actions[bot] 1cc86bee1c Version Packages (next) 2026-04-21 15:07:43 +00:00
Patrik Oldsberg e8bc1d99d9 frontend-app-api: deduplicate joinPaths utility in routing
Extract the identical joinPaths function from both
extractRouteInfoFromAppNode.ts and RouteResolver.ts into a shared
joinPaths.ts module, then import it from both consumers.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-16 22:17:34 +02:00
Fredrik Adelöw 8e7f7249e7 chore: regenerate knip reports
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
2026-04-16 12:14:47 +02:00
github-actions[bot] 93e643d142 Version Packages 2026-04-14 14:57:31 +00:00
Patrik Oldsberg d3627319a1 Merge pull request #33836 from backstage/rugvip/explore-standard-schema-decoupling
frontend-plugin-api: decouple zod dependency using Standard Schema
2026-04-14 12:27:53 +02:00
Patrik Oldsberg 8923d6def0 Drop Zod v3 support from new configSchema path
The new `configSchema` option now strictly requires StandardSchemaV1
values (e.g. Zod v4 or `zod/v4` from the Zod v3 package). Direct Zod
v3 schemas are no longer silently converted and will throw an error.

The deprecated `config.schema` callback path continues to work with
Zod v3 through a separate `createDeprecatedConfigSchema` function.

Also adds `createZodV4FilterPredicateSchema` to `@backstage/filter-predicates`
as a v4 counterpart to the now-deprecated v3 variant.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-13 21:38:28 +02:00
Patrik Oldsberg 1f80e1a5a4 frontend-plugin-api: per-field config schema with lazy JSON Schema
Replace the monolithic `createSchemaFromZod` approach with per-field
schema resolution via `createConfigSchema`. Each field is resolved
individually and eagerly validated for JSON Schema conversion support,
but the actual JSON Schema generation is deferred until first access.

`PortableSchema.schema` is now a lazy callable — it can still be
accessed as a property (backward compat, deprecated) or called as a
method returning `{ schema: JsonObject }` for the new API.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-10 10:13:19 +02:00
github-actions[bot] 6c10d88c13 Version Packages (next) 2026-04-07 15:30:58 +00:00
github-actions[bot] a2cb332e25 Version Packages (next) 2026-03-31 15:30:51 +00:00
Fredrik Adelöw c38610bd9d Address review feedback: add cast rationale, drop redundant assertError
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-28 17:07:00 +01:00
Fredrik Adelöw 400aa2313a Add FetchMiddlewares.clarifyFailures and improve permission error handling
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-28 16:55:33 +01:00
github-actions[bot] c1b510cabb Version Packages (next) 2026-03-24 14:54:00 +00:00
Patrik Oldsberg 364d4fe187 frontend-app-api: add apis to specialized app result types (#33445)
* frontend-app-api: add `apis` to specialized app result types

Added `apis: ApiHolder` to both `BootstrapSpecializedApp` and
`FinalizedSpecializedApp` types, and included the APIs in the returned
objects from `getBootstrapApp()`, `finalizeFromSessionState()`, and
`finalizeFromBootstrapError()`.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor

* Add .patches entry for PR #33445

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor

---------

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-03-19 20:57:20 +01:00
github-actions[bot] 5725b5fcfa Version Packages 2026-03-17 21:39:07 +00:00
Gabriel Dugny a49a40d314 Proper /v3 usage everywhere
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-03-17 16:48:42 +01:00
Patrik Oldsberg 7ffb61b703 frontend-app-api: fix rebased test type import
Remove a stale createSpecializedApp test import that started failing repository type checking after the rebase.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:19:10 +01:00
Patrik Oldsberg 46b530378d frontend-app-api: revert predicate traversal cleanup
Restore the more defensive predicate traversal implementation after the narrowing cleanup turned out not to be worth the type fallout.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:21 +01:00
Patrik Oldsberg 0d6596f4e7 frontend-app-api: apply review follow-up cleanup
Tighten a few small follow-up details from review by improving stack traces in permission batching, simplifying synthetic child refs, and making predicate traversal narrowing more direct.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:21 +01:00
Patrik Oldsberg d7ed46b83c frontend-app-api: follow up phased app review feedback
Fix utility API resolution for falsy values and clarify how phased app finalization is owned between onFinalized and finalize.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:20 +01:00
Patrik Oldsberg da11157729 frontend-app-api: move session reuse to prepare time
Remove the late-bound finalize session override so prepared apps accept reusable session state in one place. This keeps bootstrap and finalization semantics aligned and simplifies the prepared app API.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:20 +01:00
Patrik Oldsberg e04955b861 frontend-app-api: split prepared app wiring helpers
Extract the prepared app tree and API factory lifecycle helpers so prepareSpecializedApp reads as orchestration, while keeping the finalization flow documented and behaviorally unchanged.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:11 +01:00
Patrik Oldsberg 65805c8117 frontend-app-api: split prepared app session loading
Separate direct and callback-driven finalization by keeping async session loading inside onFinalized and simplifying the shared finalization helpers.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:11 +01:00
Patrik Oldsberg 4a1a3496f2 frontend-app-api: separate prepared app finalization modes
Make prepared apps choose either onFinalized or finalize so the async and direct finalization flows can no longer be mixed on the same instance.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:11 +01:00
Patrik Oldsberg a5017f7951 frontend-app-api: extract prepare app finalizers
Move the session-state and bootstrap-error finalization flows into same-file helpers with explicit inputs so the local state updates remain visible at the call sites.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:11 +01:00
Patrik Oldsberg 0ce78c110c frontend-app-api: simplify prepare app finalization flow
Keep the sign-in finalization path local to the identity callback and use safer error normalization while preserving the finalized bootstrap error flow.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg 217de172dc frontend-app-api: finalize bootstrap failures through app root
Resolve async finalization failures by building a finalized app that throws from app/root.children, and simplify the identity proxy target callback to a synchronous fire-and-forget hook.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg 89fd91eaf8 frontend-app-api: store bootstrap errors for app root
Route bootstrap finalization failures through an external store that re-enters React at app/root.children, and simplify prepared app finalization to use a success-only callback.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg 12f809015f frontend-app-api: restore local prepare app state
Replace the consolidated runtime state object in prepareSpecializedApp with local variables so the control flow stays easier to follow while preserving the extracted helper modules.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg d30aba815a frontend-app-api: extract prepared app phase apis
Move the phase-specific API proxies and tree initialization helpers out of prepareSpecializedApp so the remaining file can stay focused on bootstrap and finalization flow.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg ca24aa2da9 frontend-app-api: extract prepared app predicates
Move predicate reference collection and predicate context loading out of prepareSpecializedApp so the session and finalization flow can focus on lifecycle state.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg 01f5660fe7 frontend-app-api: split prepare and create app wiring
Move the phased specialized app lifecycle into prepareSpecializedApp.tsx and leave createSpecializedApp.tsx as the deprecated wrapper so the public entry points and their related types live alongside their own implementations.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg 756e84eb9a frontend-app-api: capture sign-in through identity proxy
Let prepared apps observe sign-in completion through the bootstrap identity proxy instead of overriding the sign-in page component, and surface finalization failures back through the default app root.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:06:10 +01:00
Patrik Oldsberg ab3f15f3b3 frontend-app-api: share subtree instantiation logic
Move detached API discovery over to the same subtree instantiation traversal that powers the app tree so predicate handling and attachment traversal stay aligned in one place.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:05:46 +01:00
Patrik Oldsberg d7a44138d2 frontend-app-api: freeze materialized bootstrap APIs
Keep deferred API overrides only for bootstrap APIs that were never materialized, while reporting and ignoring overrides of implementations that were already used during bootstrap.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:05:39 +01:00
Patrik Oldsberg f919c714fc frontend-app-api: stop resetting the tree for api discovery
Collect bootstrap and deferred API factories without mutating app node instances, so conditional API roots stay deferred and visible API instances can survive finalization unchanged.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:05:30 +01:00
Patrik Oldsberg 268f8f8d9f frontend-app-api: fix sync specialized app predicates
Avoid finalizing prepared apps with an empty predicate context when sign-in is disabled, so deferred feature-flagged extensions resolve consistently in both bootstrap and finalized trees.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:05:18 +01:00
Patrik Oldsberg 837de816d5 frontend-app-api: export prepare app options type
Expose PrepareSpecializedAppOptions from the wiring entrypoint and refresh the API report so the new type is available to callers.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:04:42 +01:00
Patrik Oldsberg b6fc7f861f frontend-app-api: fix phased predicate type checks
Use internal extension shapes when reading predicate metadata and type the finalized app test helper explicitly. This fixes the typecheck breakage introduced by the phased predicate and override changes.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:03:29 +01:00
Patrik Oldsberg d65d4812f6 frontend-plugin-api: support predicate overrides
Allow plugin and extension overrides to replace or remove existing if predicates. This makes conditional plugin and extension behavior overrideable through both plugin overrides and module-installed extension overrides.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:03:21 +01:00
Patrik Oldsberg f30eeba995 frontend-plugin-api: support feature-level predicates
This lets plugin and module instances apply a shared condition to all of their extensions, while preserving extension-level conditions by combining them with logical AND during app spec resolution.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:03:11 +01:00
Patrik Oldsberg 457904d372 frontend-app-api: defer conditional bootstrap APIs and root elements
This keeps bootstrap rendering stable while still allowing root elements and API subtrees to activate once session predicates are available, and warns when bootstrap-visible extensions depend on APIs that only appear during finalization.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:02:42 +01:00
Patrik Oldsberg 89f83827c9 frontend-app-api: expose bootstrap app state
Expose the prepared bootstrap tree together with subscription-based phase updates so createApp can render from app state directly instead of forcing rerenders through a sign-in callback.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:01:58 +01:00
Patrik Oldsberg f4c03772a4 frontend-app-api: internalize prepared session state
Move prepared app session ownership into frontend-app-api so bootstrap only signals readiness while callers use tryFinalize or finalize to read the finalized app state. This reduces createApp boilerplate and keeps the specialized app lifecycle centered in the lower-level API.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:01:34 +01:00
Patrik Oldsberg 94e91d9de3 frontend-app-api: make session state opaque
Replace exposed prepared app APIs and predicate plumbing with a reusable opaque session state so apps can skip sign-in without leaking internals. Align the specialized app flow around getSignIn().ready and finalize(sessionState) for explicit session bootstrap and reuse.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:01:15 +01:00
Patrik Oldsberg b14e301bb6 frontend-app-api: clean up session boundary initialization
Make the bootstrap-visible app slice explicit so APIs and predicate validation follow the same session boundary rules before the full tree is finalized.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:01:06 +01:00