69 Commits

Author SHA1 Message Date
github-actions[bot] 68db890456 Version Packages (next) 2026-05-26 15:26:38 +00:00
Fredrik Adelöw eca61bc02e fix(cli): narrow protobufjs warning suppression to specific message
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-26 12:04:56 +02:00
Fredrik Adelöw c069132a86 fix(cli): suppress protobufjs/inquire dynamic require warning in bundler
Since protobufjs 7.5.9, the @protobufjs/inquire utility is no longer
called with dynamic module names (replaced by bundler-safe lookups in
protobufjs/protobuf.js#2254). However, webpack/rspack still statically
analyzes the inquire source and emits a "Critical dependency" warning
for its require(moduleName) pattern. This is a false positive — the
code path is dead in practice.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-26 11:23:14 +02:00
Fredrik Adelöw 17cce350b3 Merge pull request #34219 from backstage/renovate/embedded-postgres-18.x
Update dependency embedded-postgres to v18.3.0-beta.17
2026-05-25 12:09:39 +02:00
github-actions[bot] b97fcb0a93 Version Packages 2026-05-19 18:28:24 +00:00
Patrik Oldsberg dcf850f1f5 Merge pull request #34108 from backstage/rugvip/forward-embedded-pg-config
cli-module-build: forward user config to embedded Postgres
2026-05-19 12:10:05 +02:00
Patrik Oldsberg 2a03b0798c Apply suggestion from @Rugvip
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-05-19 11:48:20 +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
Patrik Oldsberg c9468995fa Move config reading into startEmbeddedDb
Encapsulate the config-loading and embedded-postgres decision inside
`startEmbeddedDb` so that `runBackend` only needs to pass through the
raw `configPaths` and `targetDir`. This simplifies the interface between
the two modules and keeps all embedded-postgres concerns in one place.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-30 13:07:04 +02:00
Patrik Oldsberg a3a1802284 Use mockServices.rootConfig.mock for config mocking in tests
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-30 12:35:55 +02:00
Patrik Oldsberg d7e22c23c4 Fix config read crash when database connection is a string
The readDatabaseConfig function would crash when trying to read
sub-keys of backend.database.connection when the value is a plain
string (e.g. ':memory:' for better-sqlite3). Guard by checking the
raw value type before attempting to read structured connection keys.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-30 11:50:58 +02:00
Patrik Oldsberg be7e4eb48b cli-module-build: forward user config to embedded Postgres
When using the embedded-postgres database client, user-provided
connection config (host, port, user, password) is now forwarded to
the embedded Postgres instance. Only values that the user hasn't
configured are filled in with defaults and injected into the app
config, preserving existing behavior when no config is provided.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-30 11:34:51 +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] 1cc86bee1c Version Packages (next) 2026-04-21 15:07:43 +00:00
Patrik Oldsberg df1e14e369 Merge pull request #33949 from secustor/chore/migrate-module-federation-v2
chore: migrate module-federation to v2
2026-04-16 19:07:18 +02:00
secustor 41070b89c5 chore: migrate module-federation to v2
Signed-off-by: secustor <sebastian@poxhofer.at>
2026-04-16 15:15:04 +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
Patrik Oldsberg ed4ee6fdfb cli: fix config path resolution for embedded-postgres detection
Resolve config paths relative to the target package directory instead
of the workspace root in readDatabaseClient, matching the behavior of
the rest of the config loading system.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-15 09:58:31 +02:00
github-actions[bot] 93e643d142 Version Packages 2026-04-14 14:57:31 +00:00
Patrik Oldsberg 178f58687d Merge pull request #33802 from davidfestal/fix-bundle-cli-error-in-ci
fix(cli-module-build): ignore MF version warning for secondary entry points
2026-04-09 01:08:23 +02:00
Patrik Oldsberg f1b493f6bd Fix embedded-postgres PID file written before initialization
The PID file was written to the database directory before
`pg.initialise()`, which prevented initialization from succeeding.
Moved the PID file write to just after initialization but before
starting the database.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-08 17:04:36 +02:00
David Festal f52a296a53 fix(cli-module-build): ignore MF version warning for secondary entry points
Signed-off-by: David Festal <dfestal@redhat.com>
2026-04-08 14:01:43 +02:00
github-actions[bot] 6c10d88c13 Version Packages (next) 2026-04-07 15:30:58 +00:00
Patrik Oldsberg c0908fe5b5 cli: add error handling for config close and startup failure cleanup
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-02 00:38:35 +02:00
Patrik Oldsberg 13c5f97337 cli: clean up stale embedded-postgres temp directories on startup
Uses a PID file to track which process owns each temp directory, so
concurrent instances from different projects are not affected.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-02 00:34:49 +02:00
Patrik Oldsberg 77d17a5110 cli: add experimental warning for embedded-postgres
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-02 00:34:48 +02:00
Patrik Oldsberg 7e7e763163 cli: add tests for embedded-postgres config detection
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-02 00:34:48 +02:00
Patrik Oldsberg 1f88d2624b cli: address review feedback for embedded-postgres
- Close embedded DB on shutdown to avoid leaking the Postgres process
  and temp directory
- Use fs.remove instead of deprecated fs.rmdir with recursive option
- Guard against absolute config paths in readDatabaseClient
- Forward embedded-postgres error logs to console.error

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-02 00:34:48 +02:00
Patrik Oldsberg ae1cdd9e9f cli: remove custom embedded-postgres type declarations
The 18.x version ships its own .d.ts files that TypeScript resolves
correctly, so the custom module declaration is no longer needed.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-01 21:30:27 +02:00
Patrik Oldsberg d80e59ce9e cli: bump embedded-postgres to 18.3.0-beta.16
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-01 21:26:28 +02:00
Patrik Oldsberg 7bf4814173 cli: make embedded-postgres an optional peer dependency
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-01 21:22:14 +02:00
Patrik Oldsberg 45075dddcd cli: use ForwardedError for embedded-postgres import failure
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-01 21:20:10 +02:00
Patrik Oldsberg a922b3b921 cli: fix error message for missing embedded-postgres dependency
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-01 21:19:28 +02:00
Patrik Oldsberg b43c1f1bcb cli: simplify config loading using ConfigSources.toConfig
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-01 19:55:11 +02:00
Patrik Oldsberg 6537e5f8c1 cli: fix type errors and test for embedded-postgres
Fix implicit any types in startEmbeddedDb callbacks, replace the
re-export type declaration with an inline type definition for the
embedded-postgres module, and update runBackend tests to mock the
config loading and use async timer advancement.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-01 15:40:31 +02:00
Patrik Oldsberg 538d0a1488 cli: enable embedded-postgres via config instead of env var
Rather than requiring the `EXPERIMENTAL_DEV_DB` environment variable,
the embedded postgres server is now started automatically when
`backend.database.client` is set to `embedded-postgres` in the app
config. The CLI reads the config before spawning the backend and
injects the actual pg connection details via env override.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-01 13:03:11 +02:00
Patrik Oldsberg f14df56222 cli: experimental support for using embedded-postgres as dev DB
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-01 12:57:49 +02:00
Patrik Oldsberg b9fec1bdc8 Merge pull request #33642 from backstage/dist-workspace-pack-batching
cli-module-build: pack packages in batches inside createDistWorkspace
2026-04-01 11:54:21 +02:00
MT Lewis 8f174e18e9 cli-module-build: pack sequentially when cycles are detected in dependencies
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2026-04-01 09:48:11 +01:00
github-actions[bot] a2cb332e25 Version Packages (next) 2026-03-31 15:30:51 +00:00
Fredrik Adelöw b6c0ef5d5d Add windowsPathsNoEscape to glob calls that may receive backslash paths
Glob v13 treats backslashes as escape characters by default, unlike v7
which treated them as path separators on Windows. This broke Windows CI
where path.join/resolve produce backslash paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-31 15:20:56 +02:00
Fredrik Adelöw 2e5c5f85b2 Bump glob to v13 and rollup to v4.59+ to fix security vulnerabilities
Addresses the high severity rollup path traversal vulnerability
(GHSA-mw96-cpmx-2vgc) and the glob security advisory by upgrading
all instances across the monorepo. Updates code that used the legacy
callback-based glob API to use the modern promise/sync API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-30 23:13:08 +02:00
Fredrik Adelöw 0419acede2 Revert "Bump glob to v13 and rollup to v4.59+ to fix security vulnerabilities"
This reverts commit 6d76b1729b.

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-30 23:11:17 +02:00
Fredrik Adelöw 6d76b1729b Bump glob to v13 and rollup to v4.59+ to fix security vulnerabilities
Addresses the high severity rollup path traversal vulnerability
(GHSA-mw96-cpmx-2vgc) and the glob security advisory by upgrading
all instances across the monorepo. Updates code that used the legacy
callback-based glob API to use the modern promise/sync API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-30 23:10:09 +02:00
Fredrik Adelöw d06ba3a58e Revert "Bump glob to v13 and rollup to v4.59+ to fix security vulnerabilities"
This reverts commit 91b359ee5f.

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-30 23:05:11 +02:00
Fredrik Adelöw 91b359ee5f Bump glob to v13 and rollup to v4.59+ to fix security vulnerabilities
Addresses the high severity rollup path traversal vulnerability
(GHSA-mw96-cpmx-2vgc) and the glob security advisory by upgrading
all instances across the monorepo. Updates code that used the legacy
callback-based glob API to use the modern promise/sync API.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-30 23:02:37 +02:00
MT Lewis c16c5084d0 cli-module-build: pack packages in batches inside createDistWorkspace
When passing --always-yarn-pack, we previously
packed all packages in parallel. Since
package.json files are rewritten during packing,
this could cause intermittent "No local workspace
found for this range" failures.

To fix this, we now pack packages in batches,
starting with the ones that have no workspace
dependencies and expanding out to include packages
whose dependencies have already been packed.

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2026-03-30 11:38:25 +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
Fredrik Adelöw 64b7132d40 fix(cli): exclude __fixtures__ from coverage in cli-module-build
When the transform tests were moved from @backstage/cli to
@backstage/cli-module-build, the coveragePathIgnorePatterns config
was not carried over. This caused test failures in CI when running
with --coverage, as Jest tried to instrument the fixture files
containing fake node_modules packages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-17 15:37:24 +01:00