From 5db753618fac375a5dc8c327e8685c86b662adc6 Mon Sep 17 00:00:00 2001 From: Calvin Lee Date: Fri, 14 Jun 2024 10:56:53 -0600 Subject: [PATCH] fix: enable support for edit_url in TechDocs Signed-off-by: Calvin Lee --- .changeset/tasty-forks-compare.md | 5 +++++ plugins/techdocs-node/src/stages/generate/helpers.ts | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 .changeset/tasty-forks-compare.md diff --git a/.changeset/tasty-forks-compare.md b/.changeset/tasty-forks-compare.md new file mode 100644 index 0000000000..6e748d884b --- /dev/null +++ b/.changeset/tasty-forks-compare.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs-node': patch +--- + +Updated getRepoUrlFromLocationAnnotation to check for harness scm integration diff --git a/plugins/techdocs-node/src/stages/generate/helpers.ts b/plugins/techdocs-node/src/stages/generate/helpers.ts index df1a31470d..5efe96877f 100644 --- a/plugins/techdocs-node/src/stages/generate/helpers.ts +++ b/plugins/techdocs-node/src/stages/generate/helpers.ts @@ -101,11 +101,13 @@ export const getRepoUrlFromLocationAnnotation = ( if (locationType === 'url') { const integration = scmIntegrations.byUrl(target); - // We only support it for github, gitlab and bitbucketServer for now as the edit_uri + // We only support it for github, gitlab, bitbucketServer and harness for now as the edit_uri // is not properly supported for others yet. if ( integration && - ['github', 'gitlab', 'bitbucketServer'].includes(integration.type) + ['github', 'gitlab', 'bitbucketServer', 'harness'].includes( + integration.type, + ) ) { // handle the case where a user manually writes url:https://github.com/backstage/backstage i.e. without /blob/... const { filepathtype } = gitUrlParse(target);