635 Commits

Author SHA1 Message Date
Fredrik Adelöw 2a85164e49 Use cheaper auth plugin and skip binlog for test MySQL containers
Switch the dockerized MySQL container to mysql_native_password (single
challenge-response) instead of the default caching_sha2_password
(extra RSA key exchange round-trip on non-TLS connections). Also
disable binary logging since tests don't need replication. Both
reduce per-connection overhead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-27 22:36:57 +02:00
Fredrik Adelöw 6fe88aabb3 fix(backend-test-utils): increase MySQL connect and pool timeouts
The mysql2 driver defaults to a 10-second connect timeout, which is
too short when many test suites share a single MySQL container under
CI load. Increase the connect timeout to 30 seconds and add pool
acquire/create timeouts of 30 seconds to reduce flaky ETIMEDOUT
failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-27 22:35:31 +02:00
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
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 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 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
github-actions[bot] 42a2f56e61 Version Packages (next) 2026-05-12 18:28:01 +00:00
Eric Peterson 7fb12b83c2 Add tracingServiceMock test util
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
2026-05-07 12:15:15 +02: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 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 fb9efc3e28 Address review feedback for waitForReady and helpers
Change lastError type to unknown to match catch clause semantics,
and disconnect failed Keyv instances in attemptKeyvConnection to
avoid leaking sockets/handles during readiness polling.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-13 22:53:29 +02:00
Patrik Oldsberg f44c6bd265 backend-test-utils: deduplicate test infrastructure readiness-polling helpers
Extract shared internal helpers to eliminate near-identical readiness
polling loops across database and cache test infrastructure:

- waitForReady: generic probe-until-ready loop used by both postgres
  and mysql database helpers
- attemptKeyvConnection: generic Keyv set/get probe loop used by redis,
  valkey, and memcached cache helpers
- startRedisLikeContainer: shared container-start for redis-protocol
  stores (redis and valkey)

Also normalizes cache timeout error formatting to use stringifyError
instead of template string coercion.

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 20:48:35 +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
Ben Lambert 4559806b96 feat(actionsRegistry): Adding support for examples (#33551)
* feat(backend-plugin-api): add typed examples to actions registry

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

* fix: address review feedback for actions registry examples

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

* fix: remove empty examples from scaffolder action bridge

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

* chore: add changeset for scaffolder-backend

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

* fix: update router test to match removed examples field

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

---------

Signed-off-by: benjdlambert <ben@blam.sh>
2026-03-24 18:16:23 +01:00
github-actions[bot] c1b510cabb Version Packages (next) 2026-03-24 14:54:00 +00:00
github-actions[bot] 5725b5fcfa Version Packages 2026-03-17 21:39:07 +00:00
Gabriel Dugny 0257363c51 Allow zod v3 or v4 dependency (keep using v3)
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-03-17 16:48:42 +01:00
Gabriel Dugny 49171c9de4 chore: Update all imports to zod/v3
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-03-17 16:48:42 +01:00
Ben Lambert dee4283ccf feat: add pluginId to actions, server name/description config, dot separator for namespaced tools (#33344)
Signed-off-by: benjdlambert <ben@blam.sh>
2026-03-17 08:47:51 +01:00
github-actions[bot] ed7c4e3bef Version Packages (next) 2026-03-10 17:34:12 +00:00
Fredrik Adelöw c0b9c63be4 Fix TypeScript error in MockSchedulerService test
Use non-null assertion for resolveBlock since TypeScript cannot track
the async reassignment across the setTimeout boundary.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-10 13:59:40 +01:00
Fredrik Adelöw 25157bec8d Fix AbortController reuse after cancel and prevent overlapping liveness checks
Reset AbortController in MockSchedulerService after cancelTask so
subsequent triggerTask calls receive a fresh signal. Replace setInterval
with a self-scheduling setTimeout loop for liveness checks in TaskWorker
to prevent overlapping DB queries when a check takes longer than the
polling interval.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-10 13:49:38 +01:00
Fredrik Adelöw 3e4b372955 Implement cancelTask in MockSchedulerService with proper error types
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-09 22:37:08 +01:00
Fredrik Adelöw 60eec59601 Fix missing cancelTask in mock SchedulerService implementations
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-09 22:16:33 +01:00
github-actions[bot] db0d171511 Version Packages (next) 2026-03-03 14:16:49 +00:00
Ben Lambert 62f0a53d65 Fix error forwarding in actions registry to preserve original status codes (#33021)
Signed-off-by: benjdlambert <ben@blam.sh>
2026-02-26 08:59:58 +00:00
github-actions[bot] 4bd6a3a1af Version Packages (next) 2026-02-24 19:24:06 +00:00
Ben Lambert 1ee5b28e41 feat(metrics): Implement MetricsService (#32977)
* feat: add MetricsService alpha release

Introduces MetricsService as a new @alpha core service wrapping
@opentelemetry/api. Includes migration of existing catalog metrics
to use the new service.

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

* chore: duplicate otel types, add plugin-scoped factory and tests

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

* chore: update BEP-0012 metrics service design

Signed-off-by: Kurt King <kurtaking@gmail.com>

* chore: address PR feedback from freben and rugvip

Rename instrument types with MetricsService prefix for namespace
clarity, move config to backend.metrics.plugin.{pluginId}, add
config.d.ts schema, and improve factory test assertions.

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

---------

Signed-off-by: benjdlambert <ben@blam.sh>
Signed-off-by: Kurt King <kurtaking@gmail.com>
Co-authored-by: Kurt King <kurtaking@gmail.com>
2026-02-24 16:57:02 +01:00
github-actions[bot] e6df5d52ce Version Packages 2026-02-17 16:06:18 +00:00
github-actions[bot] 7c41134684 Version Packages (next) 2026-02-10 16:14:59 +00:00
Patrik Oldsberg ee8d999aac backend-test-utils: bring back old alpha solution
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-10 15:23:00 +01:00
Patrik Oldsberg 1cedbc7d1b backend-test-utils: review fixes
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-10 15:23:00 +01:00
Patrik Oldsberg 42abfb1b85 Add createServiceMock to backend-test-utils
Exports the internal simpleMock utility as createServiceMock, allowing
plugin authors to define mock creators for their own service refs
following the same pattern as the built-in mockServices mocks.

Also updates catalog-node to use createServiceMock instead of its own
copy, and simplifies the gateway-backend test to use the mock's
.factory property directly.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-10 15:22:59 +01:00
Patrik Oldsberg 68eb32266d add missing jest peer deps
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-09 21:16:24 +01:00
github-actions[bot] 1ea737c1e2 Version Packages (next) 2026-02-03 14:24:29 +00:00
github-actions[bot] d4b85dddee Version Packages (next) 2026-01-27 15:51:11 +00:00
Fredrik Adelöw f02219a054 Merge pull request #32516 from backstage/freben/nodecolon
Add a rule for the use of `node:` prefix on native imports
2026-01-27 14:17:14 +01:00
Patrik Oldsberg b9ac3a6014 Merge pull request #32512 from backstage/rugvip/module-failures
catalog-backend: attribute provider connection failures to modules
2026-01-27 13:02:28 +01:00
Fredrik Adelöw 69d880e171 Bump to latest zod
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-01-26 13:52:02 +01:00