Commit Graph

55 Commits

Author SHA1 Message Date
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
David Festal 4074a227c2 fix(backend-dynamic-feature-service): improve package resolution for bundled dynamic plugins
Updated `resolvePackagePath` to correctly resolve `package.json` for dynamic plugins that bundle their own copy of `@backstage/backend-plugin-api`. This change ensures that the resolution works for both the host application and bundled dependencies, enhancing compatibility with plugins created using the `backstage-cli package bundle` command.

Signed-off-by: David Festal <dfestal@redhat.com>
Assisted-by: Cursor
2026-03-16 18:42:07 +01:00
David Festal 62d08492c7 feat(cli): contribute a bundle command for dynamic loading
for both frontend and backend plugins.

Signed-off-by: David Festal <dfestal@redhat.com>
Assisted-by: Cursor
2026-03-16 18:36:46 +01:00
Patrik Oldsberg 08dbd83cd3 chore: remove redundant cli.ts files from CLI modules
The bin scripts already had the full runCliModule logic for the production
path. Inline the same pattern for local dev and drop the intermediate
src/cli.ts files that just duplicated it.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-16 13:12:00 +01:00
Patrik Oldsberg 4d081452b1 Address review feedback from freben
- Use cli-defaults instead of listing individual CLI modules in
  create-app template and root package.json
- Move nodeTransform config files from cli-module-build to cli-node
  to avoid cross-module direct imports
- Rename cli-module-create-github-app to cli-module-github
- Start createCliModule init chain with Promise.resolve()
- Deduplicate exitWithError in runCliModule.ts
- Extract shared isCommandNodeHidden to @internal/cli
- Add explanatory comment for fromArray deduplication field
- Restore error for cli role packages missing bin in runCliExtraction

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-16 12:55:22 +01:00
Patrik Oldsberg 26eab3bf83 Rename CLI module bin entries to use backstage prefix
Rename all bin entries from `cli-module-*` to `backstage-cli-module-*`
to establish a clear namespace for Backstage CLI tooling.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-16 12:27:08 +01:00
Patrik Oldsberg 6395e35c6a Generate CLI reports for cli-module packages
Include cli-module role in CLI report generation alongside the
existing cli role. Packages without a bin field are silently skipped.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 23:12:59 +01:00
Patrik Oldsberg 55f6eb8c64 Move config files to CLI modules with lazy proxies
Move jest config files to cli-module-test-jest/config and node
transform + webpack-public-path to cli-module-build/config. Replace
originals in @backstage/cli/config with lazy proxies that forward
to the appropriate module or throw if it is not installed.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 22:11:43 +01:00
Patrik Oldsberg 00adaa9902 Restore findOwnPaths for serve_index.html in build module
Move serve_index.html to cli-module-build/templates and use
findOwnPaths instead of require.resolve for safer path resolution.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 22:01:41 +01:00
Patrik Oldsberg 2069f64201 Remove extra exports from CLI module packages
CLI modules should only export the module itself as a default export.
Remove the named `buildPlugin` export from cli-module-build and the
unused `configOption` export from cli-module-config. Also remove the
API report warning skip for CLI module packages.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 21:51:07 +01:00
Patrik Oldsberg 4f2d7d555b Add README files to CLI module packages
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 15:03:35 +01:00
Patrik Oldsberg 9937a8aa8e Clean up CLI module dependencies and revert incorrect require() changes
Align dependency versions in CLI modules to match the original CLI
package versions. Move dependencies that are only used by modules out
of the main CLI package, and add missing dependencies to the modules
that actually use them. Revert import-to-require conversions in
cli-module-build that were incorrectly introduced during the split.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 12:40:25 +01:00
Patrik Oldsberg 86509de5c8 Fix CI failures: dependencies, API reports, and create-app versions
- Move runtime dependencies from devDependencies to dependencies in
  cli-module-build, cli-module-auth, cli-module-migrate, cli-module-new,
  cli-module-test-jest, and cli-module-translations
- Fix relative package.json paths in cli-module-build
- Downgrade rollup in cli-module-build to ^4.27.3 to match the CLI
- Downgrade eslint-webpack-plugin to ^4.2.0 to prevent @types/eslint v9
- Add CLI module packages to create-app version helper
- Add allow-warnings for CLI module packages in API reports
- Generate API report files for all CLI module packages

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 16:44:50 +01:00
Patrik Oldsberg 506da6b8be Fix rollup version in cli-module-build to prevent API report breakage
Downgrade rollup from ^4.59.0 to ^4.27.3 to match the main CLI package
and avoid the dedupe upgrading all rollup instances to 4.59.0, which
breaks API report generation.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 16:14:54 +01:00
Patrik Oldsberg 72457cfe98 Fix incorrect relative package.json paths in cli-module-build
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-14 16:06:33 +01:00