From f2a9c92948a86c013e2a85f1f423d6ff978d2712 Mon Sep 17 00:00:00 2001 From: Maciej Ptak <0ptaq0@gmail.com> Date: Tue, 31 Dec 2024 10:40:44 +0100 Subject: [PATCH 1/4] using target branch for jira labels when deploy before merge flag is true (#924) --- src/common/ticketProvider/ticketProviderRoot.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/common/ticketProvider/ticketProviderRoot.ts b/src/common/ticketProvider/ticketProviderRoot.ts index fa1a1e033..eee426b37 100644 --- a/src/common/ticketProvider/ticketProviderRoot.ts +++ b/src/common/ticketProvider/ticketProviderRoot.ts @@ -2,6 +2,7 @@ import { SfError } from "@salesforce/core"; import c from "chalk"; import { Ticket } from "./index.js"; import { getCurrentGitBranch, uxLog } from "../utils/index.js"; +import { GitProvider } from "../gitProvider/index.js"; export abstract class TicketProviderRoot { public isActive = false; @@ -25,9 +26,20 @@ export abstract class TicketProviderRoot { public async getDeploymentTag(): Promise { const currentGitBranch = await getCurrentGitBranch() || ""; let tag = currentGitBranch.toUpperCase() + "_DEPLOYED"; + + if (GitProvider.isDeployBeforeMerge()) { + const prInfo = await GitProvider.getPullRequestInfo(); + const targetBranch = prInfo?.targetBranch || process.env.FORCE_TARGET_BRANCH; + if (targetBranch) { + tag = targetBranch.toUpperCase() + "_DEPLOYED"; + } + } + if (process.env?.DEPLOYED_TAG_TEMPLATE && !(process.env?.DEPLOYED_TAG_TEMPLATE || "").includes("$(")) { - tag = process.env?.DEPLOYED_TAG_TEMPLATE.replace("{BRANCH}", currentGitBranch.toUpperCase()); + const branchToUse = tag.replace("_DEPLOYED", ""); + tag = process.env?.DEPLOYED_TAG_TEMPLATE.replace("{BRANCH}", branchToUse); } + return tag; } } From 9f429cd815206739e1ab6c1acbeab3cd73b3f248 Mon Sep 17 00:00:00 2001 From: Maciej Ptak <0ptaq0@gmail.com> Date: Tue, 31 Dec 2024 15:39:08 +0100 Subject: [PATCH 2/4] updated changelog with jira labels changes (#924) --- CHANGELOG.md | 4 ++++ package.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00ff90af1..02c774732 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,10 @@ Note: Can be used with `sfdx plugins:install sfdx-hardis@beta` and docker image - Update Microsoft Teams notifications integration User Guide - Add troubleshooting section in Email integration User Guide +## [5.10.2] 2024-12-31 + +- Using target_branch for Jira labels when isDeployBeforeMerge flag is true + ## [5.10.1] 2024-12-12 - Fix sfdx-hardis docker image build by adding coreutils in dependencies diff --git a/package.json b/package.json index 0556a6f3b..388b57311 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Swiss-army-knife Toolbox for Salesforce.\n Allows you to define a complete CD/CD Pipeline.\n Orchestrate base commands and assist users with interactive wizards", "author": "NicolasVuillamy @nvuillam", "bugs": "https://github.com/hardisgroupcom/sfdx-hardis/issues", - "version": "5.10.1", + "version": "5.10.2", "dependencies": { "@actions/github": "^6.0.0", "@gitbeaker/node": "^35.8.1", From 2f9caee6ebec2412fe5766ea53e36cdb43134245 Mon Sep 17 00:00:00 2001 From: Nicolas Vuillamy Date: Thu, 2 Jan 2025 20:12:36 +0100 Subject: [PATCH 3/4] Update CHANGELOG.md --- CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02c774732..2c081f689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,15 +27,12 @@ Note: Can be used with `sfdx plugins:install sfdx-hardis@beta` and docker image - Fix init sfdx-hardis project commands and docs - Display warning message in case package.xml has wrong format - Allow to override package-no-overwrite from a branch .sfdx-hardis.yml config file + - Using target_branch for Jira labels when isDeployBeforeMerge flag is true - Doc - Update Microsoft Teams notifications integration User Guide - Add troubleshooting section in Email integration User Guide -## [5.10.2] 2024-12-31 - -- Using target_branch for Jira labels when isDeployBeforeMerge flag is true - ## [5.10.1] 2024-12-12 - Fix sfdx-hardis docker image build by adding coreutils in dependencies From 0c568fcfcb07fca140b450829cba66a00ef6b10f Mon Sep 17 00:00:00 2001 From: Nicolas Vuillamy Date: Thu, 2 Jan 2025 20:12:55 +0100 Subject: [PATCH 4/4] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 388b57311..0556a6f3b 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "description": "Swiss-army-knife Toolbox for Salesforce.\n Allows you to define a complete CD/CD Pipeline.\n Orchestrate base commands and assist users with interactive wizards", "author": "NicolasVuillamy @nvuillam", "bugs": "https://github.com/hardisgroupcom/sfdx-hardis/issues", - "version": "5.10.2", + "version": "5.10.1", "dependencies": { "@actions/github": "^6.0.0", "@gitbeaker/node": "^35.8.1",