553 Commits

Author SHA1 Message Date
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
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
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 927c0039d7 repo-tools, create-app: replace duplicate error utilities with cli-common imports (#33893)
* Replace duplicate error utilities with @backstage/cli-common imports

Remove dead CustomError and ExitCodeError classes from repo-tools and
create-app, replacing them with the ExitCodeError import from
@backstage/cli-common. This fixes the instanceof check in exitWithError
so it actually catches errors thrown by cli-common's run().

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor

* Add changeset for repo-tools and create-app

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor

---------

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-04-15 12:39:42 +00:00
github-actions[bot] 93e643d142 Version Packages 2026-04-14 14:57:31 +00:00
Patrik Oldsberg ca2dc15b07 repo-tools: remove unused OpenAPI generator constants
Remove the unused exported constants GENERATOR_VERSION, GENERATOR_NAME,
GENERATOR_FILE, and TS_MODULE from the OpenAPI constants module. The
TS_MODULE intermediate variable is inlined into TS_SCHEMA_PATH.

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 13:19:24 +02:00
Patrik Oldsberg 8049d7bf6e repo-tools: remove unused NotFoundError class
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-13 09:55:59 +02:00
Patrik Oldsberg 377de3645f repo-tools: fix peer-deps check to skip unreferenced dependencies
The peer-deps verification was requiring all tracked peer dependencies
(including react-router-dom) for every package that references any of
them. Now it only requires a peer dependency if the package actually
references it or if it belongs to a group containing a referenced dep.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-13 00:53:54 +02:00
github-actions[bot] 6c10d88c13 Version Packages (next) 2026-04-07 15:30:58 +00:00
Patrik Oldsberg b2319ffe45 errors: add toError utility and migrate assertError usages
Add a `toError` utility function to `@backstage/errors` that converts
unknown values to `ErrorLike` objects. If the value is already error-like
it is returned as-is. Strings are used directly as the error message, and
other values are stringified with a fallback to JSON.stringify to avoid
unhelpful `[object Object]` messages.

Non-error causes passed to `CustomErrorBase` are now converted and stored
using `toError` rather than discarded. Existing `assertError` call sites
across the codebase are migrated to `toError`.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-03 10:16:23 +02: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
Fredrik Adelöw 8278540c60 Fix pLimit type and remove trailing comma in error message
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-28 18:27:53 +01:00
Fredrik Adelöw 8e9679b3eb Parallelize CLI report generation in repo-tools
Converts createBinRunner from spawnSync to async spawn, and processes
all CLI packages concurrently with a shared p-limit limiter bounded
by CPU count. Reduces wall-clock time from ~50s to ~12s.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-28 17:48:33 +01:00
github-actions[bot] c1b510cabb Version Packages (next) 2026-03-24 14:54:00 +00:00
Patrik Oldsberg 270efef604 Update peer-deps lint to support React 18-only packages
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-18 16:14:09 +01:00
github-actions[bot] 5725b5fcfa Version Packages 2026-03-17 21:39:07 +00:00
Gabriel Dugny a49a40d314 Proper /v3 usage everywhere
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
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 b76bbfb461 Exclude cli-report files from stale API report detection
The runApiExtraction function was detecting cli-report.md files as
stale API reports because they matched the report filename pattern.
These files are managed by runCliExtraction instead and should be
excluded from the stale report check.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-15 23:54:51 +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
github-actions[bot] ed7c4e3bef Version Packages (next) 2026-03-10 17:34:12 +00:00
Fredrik Adelöw 7dc54e2267 Fix crypto mock in Cache.test.ts to preserve full module
The jest.mock('crypto') was replacing the entire module, causing
@smithy/uuid to fail with "Cannot read properties of undefined
(reading 'bind')" when @backstage/backend-test-utils was imported.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
2026-03-06 16:14:23 +01:00
github-actions[bot] db0d171511 Version Packages (next) 2026-03-03 14:16:49 +00:00
Johan Persson 426edbef9c fix(repo-tools): allow excess arguments for generate-catalog-info command
Re-add `.allowExcessArguments(true)` which was dropped during
conflict resolution in the Commander v14 upgrade (PR #32583).

lint-staged passes staged file paths as extra arguments when
invoking `generate-catalog-info` via the pre-commit hook, causing
Commander v14 to reject them with "too many arguments".

Signed-off-by: Johan Persson <johanopersson@gmail.com>
2026-03-02 11:36:02 +01:00
Aramis Sennyey 0fbcf23714 feat: add support for OpenAPI 3.1 (#32300)
* breaking: add support for OpenAPI 3.1

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* add changeset

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* update nullable prop

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* remove more allowReserved usages

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* make changes less breaking

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>

* Apply suggestion from @aramissennyeydd

Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com>

---------

Signed-off-by: aramissennyeydd <aramis.sennyey@doordash.com>
Signed-off-by: Aramis Sennyey <159921952+aramissennyeydd@users.noreply.github.com>
2026-02-28 09:04:02 -05:00
Patrik Oldsberg 992e37b93f repo-tools: Use randomUUID for temp files and document sequential execution
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-02-27 14:56:22 +01:00
Patrik Oldsberg aac8cd4cc2 repo-tools: Strip ANSI codes and set NO_COLOR for CLI report extraction
Cleye outputs ANSI bold escape sequences around section headers
(e.g. Usage:, Flags:) unconditionally, which prevented the help
page parser from recognizing them. Strip ANSI SGR sequences from
captured output and set NO_COLOR=1 in the child environment.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-02-27 10:45:56 +01:00
Patrik Oldsberg f2a8299d7a repo-tools: Log all command outputs for debugging
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-02-27 10:33:15 +01:00
Patrik Oldsberg 3a1054f51d repo-tools: Log stdout content when help markers missing
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-02-27 10:21:09 +01:00
Patrik Oldsberg b7c9a8df12 repo-tools: Add module-level debug log to verify util.ts is loaded
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-02-27 10:11:23 +01:00
Patrik Oldsberg f586daee1f repo-tools: Add debug logging for empty stdout in createBinRunner
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-02-27 09:59:15 +01:00
Patrik Oldsberg 2481126013 Remove setBlocking calls and simplify file-redirect approach
Remove fragile process.stdout._handle.setBlocking calls from CLI test
commands. Revert the preload workaround in repo-tools since the root
cause is removed.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-02-27 08:48:19 +01:00
Patrik Oldsberg 5e01ab714a repo-tools: Add _handle stub preload for file-backed stdout
Add a --require preload that stubs process.stdout._handle when stdout is
a SyncWriteStream (file-backed). Some CLI code accesses _handle.setBlocking
directly and would crash without the stub.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-02-27 08:46:44 +01:00
Patrik Oldsberg d9dde597c9 repo-tools: Redirect child stdout to file for CLI reports
Use a temp file instead of a pipe for child process stdout in
createBinRunner. Node.js uses a SyncWriteStream for regular files, so
all writes complete synchronously before process.exit() can discard them.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-02-27 01:21:53 +01:00
Patrik Oldsberg b4fea2bc29 repo-tools: Use spawnSync for CLI report extraction
Use spawnSync instead of spawn for child processes in createBinRunner.
This avoids stdout data loss when child processes call process.exit()
before Node.js flushes its internal stream buffer to the pipe.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-02-27 00:08:22 +01:00
Patrik Oldsberg d5779e525c Fix CLI report generation and --help handling for loader-based commands
Add cleye-based --help handling to all commands using the loader pattern.
Update the CLI report parser to support cleye's USAGE: and FLAGS: sections.
Revert accidental backstage.role addition to eslint-plugin.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-26 20:31:55 +01:00
github-actions[bot] 4bd6a3a1af Version Packages (next) 2026-02-24 19:24:06 +00:00
Patrik Oldsberg 2a515460e8 Fix prettier existence checks and import order
Use fs.pathExists instead of checking resolved path strings which are
always truthy. Fix import ordering in e2e-test runCommand.ts.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 22:08:37 +01:00
Patrik Oldsberg ebc01ef04d Add overrideTargetPaths test utility and fix rebase issues
Adds `overrideTargetPaths` to `@backstage/cli-common/testUtils` for
cleanly mocking `targetPaths` in tests without `jest.mock` or
`jest.spyOn`. Migrates all existing test mocks to use the new utility.

Also fixes translations module imports broken by the rebase.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-23 17:25:31 +01:00
Patrik Oldsberg 553e727d5f Fix lint errors: add eslint-disable for __dirname, fix no-use-before-define
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-23 14:44:11 +01:00
Patrik Oldsberg 6fa63d411f Fix prettier formatting
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-23 14:44:11 +01:00