Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JIRA labels for DEPLOY_BEFORE_MERGE = true #924

Open
0ptaq0 opened this issue Dec 12, 2024 · 6 comments
Open

JIRA labels for DEPLOY_BEFORE_MERGE = true #924

0ptaq0 opened this issue Dec 12, 2024 · 6 comments

Comments

@0ptaq0
Copy link
Contributor

0ptaq0 commented Dec 12, 2024

Some time ago a great feature was introduced to support my exotic way of deployment: SFDX_HARDIS_DEPLOY_BEFORE_MERGE: "true"
Thank you for that!

When we have a pull/merge request, the merge results (diff) are deployed to the target branch, and if that succeeded the pull/merge request is merged.

I am using that approach but have one ask for additional support for my "deploy before merge" for jira labels.
If SFDX_HARDIS_DEPLOY_BEFORE_MERGE: "true" create a tag in a way:
UPPERCASE(target_branch_name) + "_DEPLOYED"

Currently, we do have: UPPERCASE(branch_name) + "_DEPLOYED" which is pointing to the source branch od the merge request and is not really accurate in that case.

@nvuillam
Copy link
Member

@0ptaq0 that should be hard to implement :)

Time for your first PR to sfdx-hardis ? 😇

The code building the tag is here ->

let tag = currentGitBranch.toUpperCase() + "_DEPLOYED";

You can add a condition using isDeployBefore merge

To get the targetBranch, you can use

const prInfo = await GitProvider.getPullRequestInfo();
const targetBranch = prInfo?.targetBranch || process.env.FORCE_TARGET_BRANCH

@0ptaq0
Copy link
Contributor Author

0ptaq0 commented Dec 23, 2024

Hi @nvuillam,

This is my first TS code so I have no idea what I am doing, but I managed to make some changes locally on a feature branch.
I tried to push it but I am getting 403:

git push origin features/deploy-before-merge-label
info: please complete authentication in your browser...
remote: Permission to hardisgroupcom/sfdx-hardis.git denied to 0ptaq0.
fatal: unable to access 'https://github.com/hardisgroupcom/sfdx-hardis.git/': The requested URL returned error: 403

Can you please give me permission to push?
Or share some other way to have my changes implemented :D

@0ptaq0
Copy link
Contributor Author

0ptaq0 commented Dec 30, 2024

Hi @nvuillam, just a reminder, how should I add the PR?

@nvuillam
Copy link
Member

@0ptaq0
Copy link
Contributor Author

0ptaq0 commented Dec 31, 2024

@nvuillam thanks!
I feel like a newbie now, haha but it's my first contribution to someone else public repo.

Here is the PR - #960

0ptaq0 added a commit to 0ptaq0/sfdx-hardis that referenced this issue Dec 31, 2024
@nvuillam
Copy link
Member

@0ptaq0 and not the last I hope ! :)

Going to check your PR :)

0ptaq0 added a commit to 0ptaq0/sfdx-hardis that referenced this issue Dec 31, 2024
nvuillam added a commit that referenced this issue Jan 2, 2025
…true (#924) (#960)

* using target branch for jira labels when deploy before merge flag is true (#924)

* updated changelog with jira labels changes (#924)

* Update CHANGELOG.md

* Update package.json

---------

Co-authored-by: Nicolas Vuillamy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants