option to specify branch for foxtrot hook

Issue #20 resolved
Marijn van Zon created an issue

Hi,

Is it possible to make it configurable which branch(es) the hook that prevents foxtrot merges checks? I really like the hook but currently it always checks the default branch. Because when we base our new branches for 90% of the time on develop, that's set as the default branch in Bitbucket, however it is the master that we want to protect from foxtrot merges. So now we're stuck with either not being able to use the hook, or require everyone to not to forget selecting "develop" when they're creating a new branch.

Another possibility would be to if the Branching Model is enabled to force it on the Production branch, and otherwise use the default branch.

Regards,

Marijn.

Comments (12)

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

    Here's what I want to do:

    • Give each branch a score.

    • Default branch (aka "HEAD") gets 1000 points.

    • If branching-model is enabled, "Development" gets 900 points.
    • If branching-model is enabled, "Production" gets 800 points.
    • If branching-model is enabled any branch matching "release/*" gets 700 points.
    • If branching-model is enabled any branch matching "feature/*" gets 600 points.
    • If branching-model is enabled any branch matching "hotfix/*" gets 500 points.
    • If branching-model is enabled any branch matching "bugfix/*" gets 400 points.
    • All remote branches get 0 points.
    • Local branches (not tied to any remotes) get -1 points.

    When the foxtrot blocker evaluates a given merge, the branch on the left (e.g., the 1st parent) must have more points than the branch on the right to pass the hook.

    I'll need about 10 days to get this implemented. What do you think?

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

    p.s. 2016.7.6 and earlier versions are hard-coded to use "master" (they don't bother checking the default branch), so if you roll back to that version, that might be a good temporary workaround for you.

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

    I think i'm confusing myself, and the foxtrot hook can actually be applied quite easily without any points calculations.

  4. Marijn van Zon reporter

    Hi,

    Seems like a rather complicated solution compared to being able to a simple option where people can choose for themselves which branch they want to protect from foxtrot merges. Also the points system would probably in my case still made the develop branch the one protected from foxtrot when it's actually the master branch that I want to protect.

    Given that you've changed it from always "master" to the default branch in 2016.7.6 explains why we suddenly started to get merge blockers. :)

    What would be the objection against being able to choose which branch to protect? I assume which branch should be protected mostly depends on the branching module used. When using git flow it's the master/production branch you want to protect, as the develop will have foxtrot merges coming in from hotfixes. However since nearly all branches are either feature or release branches that are branched off of develop, it's the develop branch that's the develop branch to use. Only an incidental hotfix uses master as its parent.

    Regards,

    Marijn.

  5. Marijn van Zon reporter
    • (corrention) it's the develop branch that's the default branch to use

    default branch = develop != branch to protect from foxtrot merges

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

    Hi, Marijn,

    Sorry about the delay fixing this. I plan to offer foxtrot protection for all branches, and to provide a simple config screen for controlling which branches the protection applies to. I'm currently expecting to have this ready by September 15th.

    (The delay was due to a new feature that took much longer to implement than I expected: a condensed JIRA git graph. Finally released it last night. WHEW! Demo here).)

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

    Finally implemented! Version 2017.08.28 supports this.

    Look for "Bit-Booster Settings" menu option in the Repository or Project settings page.

    I recommend leaving it checked for all branches (that's the new default behaviour).

    screen.png

  8. Log in to comment