Enabling "Jira Policy" from Control Freak with "Reference at least one Jira ticket"
My intention is to have all Pull Requests for persistent branch (master) should have a Jira issue id specified in its Title, without that merge should not be allowed.
I see Control Freak provide an option thru “Jira Policy” to look for at least on Jira ticket in commit message. As far as I understand and tried, it is not checking Pull Requests title or description, instead it looks for commits in the PR branch to have Jira issue id in a regex format.
Our repository is in development for quite some time and there are many active Pull Requests with multiple commits per Pull Request. After enabling Control Freak, it is not allowing PRs to get merged as past commits doesn’t have Jira issue id.
I tried with one latest commit with Jira issue id mentioned in the first line, but still Control Freak doesn’t allow to merge the PR.
Since we already have multiple PRs with many commits in each, how can I address this problem?
Please do correct me, if I’m missing some configuration with which I can achieve my requirement.
Thanks,
Vishnu
Comments (2)
-
repo owner -
repo owner - changed status to on hold
Waiting to hear back from Vishnubabu.
- Log in to comment
The best approach is to use “git rebase --interactive” on the PR’s source branch to adjust all the commit messages so that they adhere to your policy.
I think this would work best (assumes you want to merge into master):
Then in the “interactive rebase” mark every commit (that’s missing Jira references) with “reword”.
Control-Freak doesn’t look at PR titles at all for any reason. It only looks at commit messages.