Enabling "Jira Policy" from Control Freak with "Reference at least one Jira ticket"

Issue #150 on hold
Vishnubabu created an issue

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)

  1. Julius Davies [bit-booster.com] repo owner

    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):

    git fetch
    git rebase --interactive $(git merge-base origin/master HEAD)
    

    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.

  2. Log in to comment