Skip to content

Commit

Permalink
feat: show jira issues in hashed deploy-gae urls (#28)
Browse files Browse the repository at this point in the history
* feat: show jira issues in hashed deploy-gae urls

* Update src/deploy/deploy.util.ts

Co-authored-by: Kirill Groshkov <[email protected]>

* fix: comments

---------

Co-authored-by: Kirill Groshkov <[email protected]>
  • Loading branch information
anthonwellsjo and kirillgroshkov authored Dec 19, 2024
1 parent 9204bd3 commit 82f4577
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/deploy/deploy.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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('--'))
Expand Down

0 comments on commit 82f4577

Please sign in to comment.