From 82f45771227a447a792e676de5d0c2c172153f22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carl=20Anthon=20Wellsj=C3=B6?= <58119759+anthonwellsjo@users.noreply.github.com> Date: Thu, 19 Dec 2024 08:39:06 +0100 Subject: [PATCH] feat: show jira issues in hashed deploy-gae urls (#28) * feat: show jira issues in hashed deploy-gae urls * Update src/deploy/deploy.util.ts Co-authored-by: Kirill Groshkov * fix: comments --------- Co-authored-by: Kirill Groshkov --- src/deploy/deploy.util.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/deploy/deploy.util.ts b/src/deploy/deploy.util.ts index b0cdde8..3c92ab9 100644 --- a/src/deploy/deploy.util.ts +++ b/src/deploy/deploy.util.ts @@ -60,8 +60,11 @@ export async function createDeployInfo( let branchName = gitBranch if (backendCfg.hashedBranches) { - // todo: jira - branchName = md5(gitBranch).slice(0, 10) + // Obfuscates the branch name by hashing it. + // If there are Jira issue names in the branch name, the first one found will be used as a prefix. + const jiraIssue = gitBranch.match(/([Dd][Ee][Vv]-\d+)/)?.[0] + const branchHash = md5(gitBranch).slice(0, 10) + branchName = [jiraIssue, branchHash].filter(Boolean).join('-') } gaeService = validateGAEServiceName([branchName, gaeService].join('--'))