794 Commits

Author SHA1 Message Date
Fredrik Adelöw 496982782b fix: fix CI-flaky database test timing
DatabaseEventBusStore: 500ms → 2000ms for the performance threshold
when cleaning 100k rows — this is intentionally a perf test so a real
time assertion is correct, it just needs more headroom for CI.

DatabaseKeyStore: replace fixed 500ms sleep with waitForExpect polling
so the test adapts to however long the async deletion actually takes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-29 16:56:21 +02:00
Fredrik Adelöw 4857351bf3 Merge pull request #34415 from stijnbrouwers/bugfix/gitlab-archive-fetch 2026-05-28 17:52:36 +02:00
Stijn Brouwers 3692a346a5 chore(gitlabUrlReader): Add comment and patch file
Signed-off-by: Stijn Brouwers <stijn@bdcommit.com>
2026-05-28 09:26:05 +02:00
Stijn Brouwers 05d4126db0 chore(code-review): Use single quote instead of ticks
Signed-off-by: Stijn Brouwers <stijn@bdcommit.com>
2026-05-28 09:13:38 +02:00
Fredrik Adelöw 150f290178 Merge pull request #31613 from backstage/renovate/azure-sdk-for-js-monorepo
chore(deps): update azure-sdk-for-js monorepo
2026-05-27 14:55:44 +02:00
Stijn Brouwers 70fc9e0370 bugfix(gitlabUrlReader): Fix issue with repository archive retrieval
Signed-off-by: Stijn Brouwers <stijn@bdcommit.com>
2026-05-27 14:29:41 +02:00
github-actions[bot] 68db890456 Version Packages (next) 2026-05-26 15:26:38 +00:00
Fredrik Adelöw 72db53e9fb Remove stale credsManager field from conflict resolution
The field was accidentally kept from master during the rebase
conflict resolution but doesn't belong in this PR's version of
the file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-26 17:18:31 +02:00
Fredrik Adelöw 8dae41216d chore: update API report for AzureBlobStorageUrlReader
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-26 17:18:31 +02:00
Fredrik Adelöw 843f71caf4 fix: adapt tests for Azure SDK upgrade to ESM-style exports
The Azure SDK monorepo upgrade (storage-blob 12.26→12.31, identity
4.5→4.9) adds "type": "module" to package.json, making jest.mock()
unable to intercept imports from production code.

- AzureBlobStorageUrlReader: accept createContainerClient as an
  optional dependency, letting tests pass a mock directly instead
  of trying to mock the @azure/storage-blob module
- AzureUrlReader: provide PAT credentials in all test cases so
  DefaultAzureCredential is never instantiated — the Bearer auth
  flow is already covered by the integration package's own tests
- DefaultAzureDevOpsCredentialsProvider: use expect.any() for
  mock instance comparison instead of new DefaultAzureCredential()

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-26 17:18:31 +02:00
Andre Wanlin 850f7c2ce5 Merge pull request #33359 from awanlin/topic/typos-cli
Added `typos` to CI and fixed all findings
2026-05-25 15:23:38 -05:00
Asish Kumar def82d4d5e fix(backend-defaults): use ipKeyGenerator for rate limiter keys
The built-in rate limiter derived its key directly from `req.ip`, which
express-rate-limit 8.x rejects with an ERR_ERL_KEY_GEN_IPV6 validation
error. A raw IPv6 address used as a rate limiting key would let a client
bypass the limit by rotating through addresses in its allotted block, so
the library now requires its `ipKeyGenerator` helper to normalize the
address. Wrap the resolved client address in that helper so the limiter
starts cleanly and groups IPv6 clients by their address block.

Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
2026-05-25 05:21:28 +05:30
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
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
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
Andre Wanlin a07e6a31a4 Typos CLI - initial config and changes
Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Fixed test typos

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Fixed docs typos

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Fixed code comment typos

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Fixed remaining typos

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Added CI and Config

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Fixed typo, lol

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Fixes and update API reports

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Updated based on feedback

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Updated test

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Minor corrections

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Removed changesets

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Refactor to make changes non-breaking

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Clean up of new typos

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Use typoed over typo'd

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Added typoed

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Updated API Reports

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Feedback improvement

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Refinements

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Simplify based on feedback

Signed-off-by: Andre Wanlin <awanlin@spotify.com>

Reverted to handle both keys

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
2026-05-19 07:38:06 -05:00
Fredrik Adelöw 644adbd19a Move sweep before cache lookup to simplify expired entry handling
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:09:58 +02:00
Patrik Oldsberg 9a88d85d50 Merge pull request #34089 from backstage/otel/mcp-tools-call
feat: Instrument MCP tool calls with semantically appropriate span
2026-05-19 10:53:13 +02:00
Fredrik Adelöw a29edc58fb Merge pull request #34267 from backstage/freben/describe-each-databases
tests: use describe.each for database test iteration
2026-05-19 10:24:00 +02:00
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
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 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 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 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
github-actions[bot] 42a2f56e61 Version Packages (next) 2026-05-12 18:28:01 +00: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
Andre Wanlin 2f33a9f63f Fixes for non-breaking typos and typos configuration
Signed-off-by: Andre Wanlin <awanlin@spotify.com>

More

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
2026-04-29 16:54:05 -05:00
github-actions[bot] 7295193bb6 Version Packages (next) 2026-04-28 15:53:09 +00:00
Fredrik Adelöw e9b78e9698 Remove uuid dependency in favor of crypto.randomUUID()
The uuid package dropped its CommonJS entry point in v14, making it
incompatible with Backstage's CJS build output and Jest test runner.
Rather than working around the ESM-only issue, replace all usage with
the built-in crypto.randomUUID() which has been available in Node.js
since v16.7 and in all major browsers since March 2022.

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
2026-04-23 10:51:43 +02:00
github-actions[bot] 1cc86bee1c Version Packages (next) 2026-04-21 15:07:43 +00:00
Fredrik Adelöw 89d324840c fix(scheduler): handle setTimeout overflow for long sleep durations
Node.js setTimeout uses a 32-bit signed integer for the delay, so
values larger than 2^31-1 ms (~24.8 days) cause the callback to fire
immediately. Fix by chunking the wait into segments of at most 2^30 ms.

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
2026-04-18 15:30:07 +02:00
Patrik Oldsberg 5f849c6a37 Remove unused taskSettingsV1Schema and TaskSettingsV1
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-17 00:14:15 +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
Fredrik Adelöw f0c27227cf chore: remove duplicate dependencies/devDependencies entries
Several packages had the same dependency listed in both `dependencies`
and `devDependencies`. This removes the duplicate from whichever section
is incorrect based on actual usage in the source code.

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
2026-04-16 10:22:01 +02:00
Patrik Oldsberg 3210dbd638 Merge pull request #33782 from UsainBloot/feat/extension-point-middleware
feat(backend): add extensionPointFactoryMiddleware to createBackend
2026-04-15 01:00:53 +02:00
github-actions[bot] 93e643d142 Version Packages 2026-04-14 14:57:31 +00:00
Shamil Ganiev d00a44bc12 fix: use iovalkey Cluster for Valkey cluster mode
Signed-off-by: Shamil Ganiev <ganiev@pm.me>
2026-04-14 15:30:31 +03:00
Patrik Oldsberg dd4ea5896d Remove unnecessary exports of file-local helpers
Remove the `export` keyword from functions that are only used within
their own file and are not part of any package's public API:

- `parseStringsParam` and `isOrder` in notifications-backend
- `toWeb` in backend-defaults urlReader
- `resolvePublicPath` in app-backend

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-13 21:29:21 +02:00
Patrik Oldsberg 38f2703930 backend-defaults: delete orphaned isValidUrl utility (#33857)
Made-with: Cursor

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-04-13 12:24:06 +02:00
Fredrik Adelöw 05b1de4321 Merge pull request #33680 from rolandfuszenecker-seon/feat/aws-rds-iam-auth
feat(backend-defaults): add AWS RDS IAM authentication support for PostgreSQL
2026-04-10 16:47:13 +02:00
Jack Palmer e782afcb3b Address PR review comments
- Make ExtensionPointFactoryMiddleware an opaque type via new
  @internal/backend package using OpaqueType from @internal/opaque
- Use options object for createExtensionPointFactoryMiddleware
- Make middleware function async (returns Promise<T>)
- Remove extensionPointFactoryMiddleware from createBackend, keep only
  on createSpecializedBackend
- Export defaultServiceFactories from @backstage/backend-defaults

Signed-off-by: Jack Palmer <jackpalmer@spotify.com>
2026-04-09 15:59:44 +01:00
Fredrik Adelöw 547258f67b refactor(backend-defaults): clean up database creation retry loop
Refactor the postgres database creation retry loop to avoid an
unnecessary sleep after the final failed attempt, and improve
readability by using named variables.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-04-09 15:12:07 +02:00
github-actions[bot] 6c10d88c13 Version Packages (next) 2026-04-07 15:30:58 +00:00