fix: enable support for edit_url in TechDocs

Signed-off-by: Calvin Lee <cjlee@ualberta.ca>
This commit is contained in:
Calvin Lee
2024-06-14 10:56:53 -06:00
parent a3492581e8
commit 5db753618f
2 changed files with 9 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-techdocs-node': patch
---
Updated getRepoUrlFromLocationAnnotation to check for harness scm integration
@@ -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);