Commit Graph

179 Commits

Author SHA1 Message Date
Patrik Oldsberg 482ceed6d2 Address review feedback: simplify toError and add changeset
- Remove JSON.stringify fallback from toError, use the same unknown
  error messaging as stringifyError for all non-string/non-error values
- Add try/catch to protect against values that throw on string
  conversion (e.g. null-prototype objects, symbols)
- Fix no-op `void toError(err)` in DeleteEntityConfirmationDialog
- Fix `${err}` producing [object Object] in UrlReaderProcessor
- Fix double toError call in openStackSwift
- Update JSDoc to accurately describe the behavior
- Add tests for throwing toString and circular objects
- Add changeset for all refactored packages

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-03 11:25:58 +02: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
Ben Lambert e96f6d9ce9 Merge commit from fork
Signed-off-by: Bond Yan <bondy@spotify.com>
Co-authored-by: Bond Yan <bondy@spotify.com>
2026-03-04 07:33:06 +01:00
Bond Yan cb7c6b1bc0 allowed keys implementation
Signed-off-by: Bond Yan <bondy@spotify.com>
2026-02-26 17:27:23 -05:00
benjdlambert 3c455d4151 chore: small tweaks
Signed-off-by: benjdlambert <ben@blam.sh>
2026-01-30 20:43:52 +01:00
Fredrik Adelöw 7455dae884 require the use of node prefix on native imports
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-01-26 13:22:53 +01:00
Andre Wanlin f0951aaff0 TechDocs - Updated the defaultDockerImage version
Signed-off-by: Andre Wanlin <awanlin@spotify.com>
2026-01-19 15:09:49 -06:00
Fredrik Adelöw b3a36948b0 Merge pull request #32010 from backstage/techdocs-integrations-support 2026-01-16 20:29:26 +01:00
Vincenzo Scamporlino bd096c93b1 techdocs: use ScmIntegrations instead of using raw config
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2025-12-09 16:27:29 +01:00
Vincenzo Scamporlino 5a3965849b techdocs: fix logger param
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2025-12-04 10:19:56 +01:00
Vincenzo Scamporlino 09af448338 techdocs: moar config tests
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2025-12-04 10:19:34 +01:00
Vincenzo Scamporlino 4fb08a1b31 techdocs: add support for integrations.awsS3
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2025-12-03 23:17:31 +01:00
Vidhan Shah 848335461e PR comments
Signed-off-by: Vidhan Shah <vidhans958@gmail.com>
2025-11-24 16:42:38 +05:30
Vidhan Shah e115272955 PR comments
Signed-off-by: Vidhan Shah <vidhans958@gmail.com>
2025-11-21 21:36:41 +05:30
Vidhan Shah 0f258e24fa PR comments
Signed-off-by: Vidhan Shah <vidhans958@gmail.com>
2025-11-21 21:17:50 +05:30
Vidhan Shah e6314f2534 PR comments
Signed-off-by: Vidhan Shah <vidhans958@gmail.com>
2025-11-21 20:54:32 +05:30
Vidhan Shah 87da464220 PR comments
Signed-off-by: Vidhan Shah <vidhans958@gmail.com>
2025-11-12 21:13:34 +05:30
Vidhan Shah 39ab1a8935 PR comments
Signed-off-by: Vidhan Shah <vidhans958@gmail.com>
2025-11-08 09:04:16 +05:30
Vidhan Shah 9fc3cd9d39 Merge branch 'feat/uploadingtoS3' of https://github.com/vidhanshah/keyboard-nav-techdocs into feat/uploadingtoS3 2025-11-08 08:02:11 +05:30
Vidhan Shah f2f84ad597 Improving code as per reviews
Signed-off-by: Vidhan Shah <vidhans958@gmail.com>
2025-11-08 07:58:34 +05:30
vidhanshah f9a3682c9f Merge pull request #6 from backstage/master
Fetching commits from main
2025-11-07 16:55:32 +05:30
Rudra Sharans 4fbde9e3f1 PR comments
Signed-off-by: Rudra Sharans <rudra099999@gmail.com>
2025-10-22 22:55:28 +05:30
Paul Schultz 05f60e1e0a refactor: convert constructor parameter properties for erasableSyntaxOnly compatibility
Signed-off-by: Paul Schultz <pschultz@pobox.com>
2025-10-14 08:29:21 -05:00
Rudra Sharans c13704bf52 Fixing test cases
Signed-off-by: Rudra Sharans <rudra099999@gmail.com>
2025-10-08 00:17:09 +05:30
Rudra Sharans 703f8c08bd Modifying large size files upload to S3
Signed-off-by: Rudra Sharans <rudra099999@gmail.com>
2025-10-08 00:01:00 +05:30
Mike Haley 029526ccf0 Fix parseReferenceAnnotation missing annotation error message
Signed-off-by: Mike Haley <mike.f.haley@gmail.com>
2025-06-30 23:03:22 -04:00
Gabriel Dugny 72d019d663 chore(typos): Fix low-impact typos
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2025-04-23 17:56:22 +02:00
Sydney Achinger 1d55517f79 Fix tsc error.
Signed-off-by: Sydney Achinger <sydneynicoleachinger@spotify.com>
2025-04-01 14:09:26 -04:00
Sydney Achinger 2d7a3b8731 Update Azure techdocs publisher to pipe file content to res.
Signed-off-by: Sydney Achinger <sydneynicoleachinger@spotify.com>
2025-04-01 13:41:34 -04:00
Sydney Achinger 304a422ef4 Replace S3 streamToBuffer with pipe. (#28993)
* Replace S3 streamToBuffer with pipe.

Signed-off-by: Sydney Achinger <sydneynicoleachinger@spotify.com>
2025-03-19 09:12:31 -04:00
John Philip 30d1cbe4d4 bump techdocs generator version
Signed-off-by: John Philip <jphilip@spotify.com>
2025-02-14 22:15:13 -05:00
Laimis Juzeliūnas 8de3d2d53d feat(techdocs): add support for AWS S3 retries in publisher (#28446)
This change is to allow a configurable retry in Backstage TechDocs AWS S3 publisher.

It introduces a new possible option for techdocs-cli publish called --awsMaxAttempts. This configuration when specified as a number translates to maxAttempts that is compatible with aws-sdk/client-s3 (JavaScript v3) S3Client class. The change will not break existing configuration setups - maxAttempts is optional and fallbacks to already existing defaults if not specified.

Signed-off-by: Laimis Juzeliūnas <asnelaimis@gmail.com>
2025-01-14 13:15:16 -05:00
Fredrik Adelöw ee8b63def9 use mockServices more
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2024-12-18 14:14:42 +01:00
Adrian Kosiński fbdc63116c feat(techdocs): Allow to pass options to GCS publisher (#26836)
* feat(techdocs): Allow to pass options to GCS publisher

Signed-off-by: Adrian Kosinski <adrian.kosinski@allegro.com>

---------

Signed-off-by: Adrian Kosinski <adrian.kosinski@allegro.com>
2024-10-01 13:40:47 -04:00
Patrik Oldsberg e94df98f1b techdocs-node: improved type detection and filtering
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Alex Lorenzi <alorenzi@spotify.com>
2024-09-17 14:57:08 +02:00
Patrik Oldsberg d995579b11 techdocs-node: improve bucket path handling
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Alex Lorenzi <alorenzi@spotify.com>
2024-09-17 13:49:46 +02:00
Camila Belo c72023c5e6 Merge pull request #25543 from SDA-SE/techdocs-node/migrate-container-runner
Add TechdocsContainerRunner interface as successor of deprecated ContainerRunner for TechdocsGenerator
2024-09-11 11:53:34 +02:00
John Philip 02966a3803 Merge pull request #26432 from martina-equinix/martina-equinix/techdocs-yaml-custom-tags
fix(techdocs-node): Allow mapping custom tags in mkdocs validator
2024-09-09 13:36:49 -04:00
Fredrik Adelöw 3606843e44 fixup
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2024-09-05 15:01:41 +02:00
martina-equinix e6a0d4f7f0 Support mapping custom tags in mkdocs yaml parser (techdocs)
Signed-off-by: martina-equinix <martina.iglesias@eu.equinix.com>
2024-09-03 12:10:49 +02:00
Jörg Siebahn f715f5ca71 Move TechdocsContainerRunner interface from publish to generate where it is used
Signed-off-by: Jörg Siebahn <joerg.siebahn@sda-se.com>
2024-08-28 14:26:38 +02:00
Camila Belo 997998e0e0 refactor: apply review suggestions
Signed-off-by: Camila Belo <camilaibs@gmail.com>
2024-08-26 12:56:35 +02:00
Camila Belo 33ebb28942 refactor(techdocs-node): remove dependency on backend-common
Signed-off-by: Camila Belo <camilaibs@gmail.com>
2024-08-26 12:56:35 +02:00
Łukasz Jernaś 4417dd40d1 Fix typo and unify TechDocs casing in doc strings
Signed-off-by: Łukasz Jernaś <lukasz.jernas@allegro.com>
2024-08-19 16:17:27 +02:00
Johan Haals d897ce63d6 Remove backend-common dependency
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2024-08-15 13:43:32 +02:00
Johan Haals 38f3827e5a Remove deprecated UrlReaders and update usages
Signed-off-by: Johan Haals <johan.haals@gmail.com>
2024-08-15 13:28:21 +02:00
Kamil Markow 5cedd9f828 Fix TechDocs Edit URL link when trailing slash not present
Signed-off-by: Kamil Markow <kamilmarkow@gmail.com>
2024-08-05 13:19:31 -04:00
MT Lewis 9559b1ad21 Merge pull request #25772 from backstage/techdocs-common
techdocs: introduce common package for annotation constants
2024-07-30 08:38:41 +01:00
MT Lewis 69bd940408 techdocs: switch to using constants from techdocs-common for annotations
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
2024-07-24 20:34:59 +01:00
Isabel Tomb 0afa044555 Update test
Update the test that checks that the existing edit_uri value in a
mkdocs.yml won't be overridden by `patchMkdocsYmlPreBuild` so that it
checks the value of 'edit_uri' was not updated rather than just checking
for the existence of the substring. This change is needed because the
substring will exist in the file but as the `repo_url` value which is
expected after the changes in the previous commits.

Signed-off-by: Isabel Tomb <isabelgtomb@gmail.com>
2024-07-23 16:44:55 -05:00