Merge pull request #25248 from harness/cjlee1/enableEditUrl

fix: enable support for edit_url in TechDocs
This commit is contained in:
John Philip
2024-06-14 14:36:14 -04:00
committed by GitHub
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);