19202 Commits

Author SHA1 Message Date
Eric Peterson 0422010a37 Address valid review comments
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2026-05-18 17:12:19 +02:00
Eric Peterson 00bdd871a3 Simplify baggage getting to a single method
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2026-05-18 16:50:43 +02:00
Eric Peterson b70f13990b Bring tracing service more in line with upstream APIs
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2026-05-18 15:20:09 +02:00
renovate[bot] 8007b58dcd chore(deps): update dependency embedded-postgres to v18.3.0-beta.17
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-05-18 10:00:37 +00:00
Eric Peterson d6c7805527 Propagate and forward gen_ai baggage from caller, if available
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2026-05-18 11:56:20 +02:00
Eric Peterson 6209065f00 Add support for async context propagation and baggage in tracing service.
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2026-05-18 10:28:09 +02:00
Fredrik Adelöw 2f0519cba3 permission: cache user info and parallelize resolution
The permission backend previously resolved userInfo and minted a plugin
request token sequentially for every authorize request with user
credentials. On high-traffic endpoints this meant two serial internal
HTTP round-trips per request, even when the same user made many
requests in quick succession.

This change:

1. Adds a 5-second TTL cache to DefaultUserInfoService so that repeated
   getUserInfo() calls for the same user return the cached result
   without an HTTP call to the auth backend.

2. Parallelises the getUserInfo() and getPluginRequestToken() calls in
   the permission backend's handleRequest via Promise.all, saving one
   sequential round-trip on cache misses.

Signed-off-by: Fredrik Adelöw <freben@gmail.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-16 17:39:50 +02:00
Fredrik Adelöw ada7df7929 backend-test-utils: add version field to mock credentials
The mock credentials created by mockCredentials.none(), .user(), and
.service() were missing the internal version: 'v1' field. This caused
toInternalBackstageCredentials() to throw when used with mock
credentials in tests.

Signed-off-by: Fredrik Adelöw <freben@gmail.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-16 17:39:31 +02:00
Fredrik Adelöw eab8f7a510 Merge pull request #34256 from backstage/cursor/ui-field-flex
fix(ui): allow fields to grow in flex layouts
2026-05-16 16:53:46 +02:00
Fredrik Adelöw 8165184fba tests: use describe.each for database test iteration
Refactors all test files that use TestDatabases/TestCaches with
it.each(databases.eachSupportedId()) to instead use describe.each at
the outer level. This ensures that all tests for one database engine
complete before moving to the next, rather than interleaving engines
across individual tests. This reduces the number of concurrent database
connections and should help with test timeout issues in CI.

The TestDatabases.create() call is hoisted to module scope so the
describe.each can iterate over supported IDs at the top level.

40 files changed across packages/backend-defaults,
packages/backend-test-utils, and multiple plugins.

Signed-off-by: Fredrik Adelöw <freben@gmail.com>

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-15 20:27:43 +02:00
Fredrik Adelöw c667c2bf90 Merge pull request #34262 from backstage/chore/upgrade-storybook-10.4 2026-05-15 19:10:05 +02:00
Charles de Dreuille 18aa6e4d56 Merge pull request #34151 from backstage/password
Style PasswordField like TextField
2026-05-15 14:22:17 +01:00
Charles de Dreuille e6e796e45c chore(deps): update storybook monorepo to v10.4.0
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-05-15 10:29:56 +01:00
Charles de Dreuille 5520e07992 fix(ui): allow fields to grow in flex layouts
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-05-14 15:39:41 +01:00
Charles de Dreuille 3e0ff6c240 fix(ui): align header sections with container
Add container layout to Header sections so the title, actions, tags, metadata, and tabs align with surrounding page content.

Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
2026-05-13 17:44:07 +01:00
Fredrik Adelöw e72fcdcbdf fix assertion: expect(fn1) not expect(fn1.mock)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-05-13 16:52:03 +02:00
Fredrik Adelöw e4ac8e2244 Update packages/backend-defaults/src/entrypoints/scheduler/lib/TaskWorker.test.ts
Co-authored-by: Marat Dyatko <31615495+dyatko@users.noreply.github.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-13 16:03:56 +02:00
Fredrik Adelöw e6892e8767 fix(filter-predicates): reject operator keys mixed with other keys
Previously, a predicate like `{ kind: 'API', $not: { 'spec.type': 'dataset' } }`
was silently accepted — the `kind` check was dropped entirely because
`evaluateFilterPredicate` short-circuited on the `$not` operator. This
made the filter match any non-dataset entity regardless of kind, which
is incorrect. The correct form requires wrapping in `$all`.

Both the runtime evaluator and the zod validation schemas now reject
predicates that mix `$all`/`$any`/`$not` with other keys.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-05-13 15:47:19 +02:00
Fredrik Adelöw 0624b2eaf6 fix(backend-defaults): fix flaky TaskWorker initialDelayDuration test
The "respects initialDelayDuration per worker" test had only a 50ms
margin (350ms total sleep vs 300ms initial delay) for the worker to
complete its internal DB roundtrips before asserting. Under CI load
this frequently wasn't enough. Replace the fixed sleep with
waitForExpect, consistent with the rest of the test file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-05-13 15:21:06 +02:00
Juan Escalada e8c67ea82c test: add test for deleting store on autologout timeout, remove unused import
Signed-off-by: Juan Escalada <juanescalada175@gmail.com>
2026-05-13 13:18:47 +09:00
Juan Escalada 19b5047c12 fix: refactor disconnectedUsers for readability
Signed-off-by: Juan Escalada <juanescalada175@gmail.com>
2026-05-13 13:11:54 +09:00
Juan Escalada 92c3435d9e fix: state bug in onIdle
Signed-off-by: Juan Escalada <juanescalada175@gmail.com>
2026-05-13 13:11:54 +09:00
Juan Escalada 327cc8b09c fix: remove timeout for deleting lastOnline store
Signed-off-by: Juan Escalada <juanescalada175@gmail.com>
2026-05-13 13:11:54 +09:00
github-actions[bot] 42a2f56e61 Version Packages (next) 2026-05-12 18:28:01 +00:00
Ben Lambert d09c21cb84 feat(scaffolder): config-driven template groups and swappable TemplateCard (#34147)
* feat(scaffolder): config-driven template groups and swappable TemplateCard

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

* refactor(scaffolder): keep createGroupsWithOther internal

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

* docs(scaffolder): fix sub-page extension ID in changeset

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

* address PR review feedback

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

* split TemplateCard swappable contract from legacy props

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

* address review feedback: dedupe tags, defensive groups copy, doc clarifications

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

* regenerate api reports

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

* align docs and changeset with actual default group titles

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

* regen api reports after rebase

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

---------

Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-12 12:29:44 +02:00
Fredrik Adelöw 92dfe61e79 Merge pull request #34087 from backstage/otel/tracing-service
feat: `TracingService` to match `MetricService`
2026-05-12 12:15:30 +02:00
Erik Hughes d726bcd842 feat(ui): add DatePicker component (#34184)
* feat(ui): add DatePicker component

Add a single-date picker built on React Aria's DatePicker, mirroring the
existing DateRangePicker implementation. Includes the date field with
segmented input, calendar popover, BUI design tokens, bg consumer
pattern, and full keyboard/screen reader accessibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Erik Hughes <erikh@spotify.com>

* fix(ui): address DatePicker PR feedback

- Remove unused dataAttributes spread from DatePickerGroup
- Mark DatePickerGroupDefinition and DatePickerCalendarDefinition as
  public so CSS class name changes appear in API reports
- Add Affected components line to changeset

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Erik Hughes <erikh@spotify.com>

* fix(ui): restore dataAttributes spread in DatePickerGroup

The bg: 'consumer' config on DatePickerGroupDefinition emits
data-on-bg attributes via useDefinition. Without spreading
dataAttributes onto <Group>, the CSS [data-on-bg] selectors
never match and background auto-increment doesn't work.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Erik Hughes <erikh@spotify.com>

---------

Signed-off-by: Erik Hughes <erikh@spotify.com>
Co-authored-by: Erik Hughes <erikh@spotify.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-05-12 10:46:46 +02:00
Ben Lambert 728629cf64 fix(catalog): show not-found instead of falling back to first route on unknown entity sub-paths (#34081)
* fix(catalog): show not-found instead of falling back to first route on unknown entity sub-paths

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

* fix(catalog): address PR review feedback

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

* fix(core-compat-api): update entity page conversion test for new not-found behavior

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

* fix(catalog): use NotFoundErrorPage and drop redundant route sort

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

* fix(catalog): split slash trimming into two replacements for clarity

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

* fix(catalog): comment normalizeRoutePath regex and memoize routes

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

* fix(catalog): preserve explicit trailing wildcards in route paths

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

---------

Signed-off-by: benjdlambert <ben@blam.sh>
2026-05-12 09:57:28 +02:00
Fredrik Adelöw d61a91846e fix(create-app): pin jest and @jest/environment-jsdom-abstract to ~30.2.0
30.4.0 introduced synchronous require(ESM) that requires Node v24.9+,
breaking tests on Node 22. 30.3.0 pulls in @sinonjs/fake-timers@^15
which conflicts with @types/sinon@^17 (used by aws-sdk-client-mock).
30.2.0 avoids both issues cleanly.

Resets lockfile to a clean base-install from master constraints.

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 15:04:51 +02:00
Fredrik Adelöw e7020fa352 fix(create-app): pin @jest/environment-jsdom-abstract to ~30.3.0 alongside jest
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 14:46:37 +02:00
Fredrik Adelöw da0a5444be fix(create-app): also pin jest in root and cli package.json to ~30.3.0
Keep the monorepo's own jest resolution consistent with the template
range, and update the lockfile to 30.3.0 accordingly.

Co-authored-by: Cursor <cursoragent@cursor.com>

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-11 14:46:37 +02:00
Fredrik Adelöw 9198a7f03e fix(create-app): pin jest to ~30.3.0 to avoid Node 24.9+ requirement
Jest 30.4.0 introduced synchronous require(ESM) support that requires
Node v24.9+. With ^30.2.0 in the templates, a fresh yarn install in
e2e test apps resolves to 30.4.x and breaks on Node 22.

Pin to ~30.3.0 (30.3.x patches only), which includes the 30.3.0 fix
that explicitly disables the require_module feature flag, while staying
below the 30.4.0 runtime requirement.

Co-authored-by: Cursor <cursoragent@cursor.com>

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-11 14:46:36 +02:00
Johan Persson 4bb649d511 fix(ui): prevent selection checkboxes from creating phantom scroll height
Add `position: relative` to `.bui-Table` so it becomes the containing
block for react-aria's absolutely positioned hidden checkbox inputs.

Without this, the inputs position themselves relative to a distant
ancestor, extending its scrollable area and creating phantom scroll
height.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-05-07 16:39:02 +02:00
James Brooks 11699ac31f Style PasswordField like TextField
Signed-off-by: James Brooks <jamesbrooks@spotify.com>
2026-05-07 14:10:31 +01:00
Brian Hudson 8df06ec2bc feat(integration-aws-node): add per-account webIdentityTokenFile config
Adds an optional `webIdentityTokenFile` field to
`AwsIntegrationAccountConfig` and `AwsIntegrationDefaultAccountConfig`.
When set on a per-account config along with a `roleName` and no static
credentials, `DefaultAwsCredentialsManager` now retrieves credentials
by calling `AssumeRoleWithWebIdentity` directly using the file's
contents as the web identity token (via `fromTokenFile`). The token
file is re-read on each refresh, so an external process can rotate it
in place — the same mechanism EKS IRSA uses, where the kubelet rotates
a projected service account token at the path identified by
`AWS_WEB_IDENTITY_TOKEN_FILE`.

This unlocks multi-account `AssumeRoleWithWebIdentity` for backends
running outside AWS (GKE, Cloud Run, Vault sidecars, etc.) without
requiring every plugin to construct a custom `AwsCredentialsManager`.
Existing call sites and configurations are unaffected — the new path
is opt-in via the new optional field.

Validator rejects:

- `webIdentityTokenFile` combined with static credentials
  (`accessKeyId`/`secretAccessKey`) on the same account
- `webIdentityTokenFile` combined with `profile` on the same account
- `webIdentityTokenFile` without a `roleName` (matches the existing
  precedent for `externalId`/`region`/`partition` without `roleName`)
- `webIdentityTokenFile` combined with `externalId` (the STS
  `AssumeRoleWithWebIdentity` API does not accept an external ID)

Same rules apply at the `accountDefaults` level. The `!config.accessKeyId`
guard in `getSdkCredentialProvider` is defensive — it protects callers
that build an `AwsIntegrationAccountConfig` directly without going
through `readAwsIntegrationConfig`. In that case we fall through to the
existing static-creds AssumeRole path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Brian Hudson <brian.r.hudson@gmail.com>
2026-05-07 07:43:47 -04:00
Eric Peterson 7fb12b83c2 Add tracingServiceMock test util
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2026-05-07 12:15:15 +02:00
Eric Peterson 130db0d6c6 Initial default implementation of the tracing service + docs
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2026-05-07 12:15:15 +02:00
Eric Peterson 90b572e4a3 Add alpha TracingService API
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2026-05-07 12:15:14 +02:00
Andre Wanlin fe697792c5 Merge pull request #34105 from awanlin/topic/non-breaking-typos
Fixes for non-breaking typos and typos configuration
2026-05-06 13:44:11 -05:00
github-actions[bot] b0bc1e5cc9 Version Packages (next) 2026-05-05 14:57:07 +00:00
Johan Persson 25909ba27a feat(ui): add searchDebounceMs/filterDebounceMs to useTable complete mode (#34127)
* feat(ui): add internal useDebouncedValue hook for Table

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): expose searchDebounceMs and filterDebounceMs on UseTableCompleteOptions

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* feat(ui): debounce search/filter in useTable complete mode pipeline

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* docs(ui): add SearchWithDebounce Table dev story

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* docs(ui): document searchDebounceMs/filterDebounceMs and fix Table search note

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* docs(ui): add searchDebounceMs/filterDebounceMs to Table props reference

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* docs(ui): note controlled-callback behavior on Table debounce props

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore(ui): regenerate API report for useTable debounce options

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore(ui): changeset for useTable complete-mode debounce options

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore: accept 'debouncing' in Vale vocabulary

Signed-off-by: Johan Persson <johanopersson@gmail.com>

---------

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-05-05 16:45:18 +02:00
James Brooks ddca41f775 Add Combobox component to Backstage UI (#34118)
Introduces a Combobox component to Backstage UI for times when you want to allow users to choose from a list of values but also specify their own in some cases.

---------

Signed-off-by: James Brooks <jamesbrooks@spotify.com>
2026-05-05 15:29:15 +01:00
Johan Persson 37535b2a60 feat(ui): add --bui-bg-inherit CSS variable (#34124)
* feat(ui): add --bui-bg-inherit CSS variable in core.css

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(ui): remove duplicated data-bg painting from Box.module.css

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(ui): remove duplicated data-bg painting from Flex.module.css

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(ui): remove duplicated data-bg painting from Grid.module.css

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(ui): centralize Accordion data-bg painting, preserve no-intent behavior

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* refactor(ui): use --bui-bg-inherit for Card scroll-shadow gradients

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* docs(ui): document --bui-bg-inherit token

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* chore: changeset for --bui-bg-inherit

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* docs(ui): add Storybook story for --bui-bg-inherit

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* docs(ui): fold --bui-bg-inherit story into colors stories

Signed-off-by: Johan Persson <johanopersson@gmail.com>

* changeset: Reword for clarity.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Johan Persson <johanopersson@gmail.com>

---------

Signed-off-by: Johan Persson <johanopersson@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-05-05 16:00:47 +02:00
Emma Indal f5ec9f95e9 Merge pull request #34119 from backstage/fix-card-link-focus-ring
fix(ui): show focus indicator on Card when used as a link
2026-05-05 13:40:17 +02:00
Andre Wanlin 5e53254fe0 Merge pull request #33370 from rtar/master
fix(plugin-techdocs-node): Move docs directory validation to after copying README.md
2026-05-05 06:02:44 -05:00
Emma Indal 9c16bf9707 fix(ui): render focus ring on Link via data-focus-visible
Style the bui-Link itself when keyboard-focused using the ring token,
matching the established pattern from ButtonLink. Also tweak the
changeset wording to reflect the new behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Emma Indal <emma.indahl@gmail.com>
2026-05-05 09:48:53 +02:00
Emma Indal 5b85902ede fix(ui): show focus indicator on Card when used as a link
Card's focus-ring CSS keys off data-focus-visible on the
bui-CardTrigger, but Link (the trigger when href is set) wasn't
emitting it because useLink does not track focus-visible state.
Compose useFocusRing in Link so keyboard focus is now properly
indicated on Card href=... and any other Link styled via
[data-focus-visible].

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Emma Indal <emma.indahl@gmail.com>
2026-05-04 17:18:52 +02:00
Fredrik Adelöw 1004d7bd10 Merge pull request #34117 from backstage/freben/gitlab-integration-fetch-fixes
fix(integration): correct GitLab fetch mode and retry on network errors
2026-05-04 16:37:42 +03:00
Fredrik Adelöw da5ba4eecd Handle non-numeric Retry-After header values gracefully
Validate the parsed Retry-After value is a finite positive number before
using it as a delay, falling back to exponential backoff otherwise. This
prevents a near-zero delay tight retry loop when the header contains an
HTTP-date or unexpected value.

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-04 15:12:02 +02:00
Fredrik Adelöw dd78c9cffa defer fetch lookup so test interceptors apply
Capturing globalThis.fetch as a value at construction time meant the
GitLabUrlReader tests bypassed the MSW fetch interceptor and hit the
real gitlab.com (returning 401). Wrapping the call resolves fetch at
invocation time so the patched fetch is used.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-05-04 14:01:43 +02:00