From 81a215d3e694b7814839a0fdef5b9500ce5e9833 Mon Sep 17 00:00:00 2001 From: npiyush97 Date: Mon, 13 May 2024 22:44:00 +0530 Subject: [PATCH] added changes Signed-off-by: npiyush97 --- .changeset/thirty-plums-shout.md | 2 +- .../src/modules/core/AnnotateLocationEntityProcessor.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.changeset/thirty-plums-shout.md b/.changeset/thirty-plums-shout.md index 5b5ffad6a9..56ac640326 100644 --- a/.changeset/thirty-plums-shout.md +++ b/.changeset/thirty-plums-shout.md @@ -2,4 +2,4 @@ '@backstage/plugin-catalog-backend': patch --- -Added a regex test to check commit hash.If url is from git commit branch ignore the edit url. +Added a regex test to check commit hash. If url is from git commit branch ignore the edit url. diff --git a/plugins/catalog-backend/src/modules/core/AnnotateLocationEntityProcessor.ts b/plugins/catalog-backend/src/modules/core/AnnotateLocationEntityProcessor.ts index f46f5cfd42..00864b69e7 100644 --- a/plugins/catalog-backend/src/modules/core/AnnotateLocationEntityProcessor.ts +++ b/plugins/catalog-backend/src/modules/core/AnnotateLocationEntityProcessor.ts @@ -31,6 +31,7 @@ import { CatalogProcessorEmit, } from '@backstage/plugin-catalog-node'; +const commitHashRegExp = /\b[0-9a-f]{40,}\b/; /** @public */ export class AnnotateLocationEntityProcessor implements CatalogProcessor { constructor( @@ -53,7 +54,6 @@ export class AnnotateLocationEntityProcessor implements CatalogProcessor { let viewUrl; let editUrl; let sourceLocation; - const commitHashRegExp = /\b[0-9a-f]{40,}\b/; if (location.type === 'url') { const scmIntegration = integrations.byUrl(location.target);