Control Freak blocks initial creation of the development branch

Issue #97 resolved
David Catteuw created an issue

Hi,

I’m evaluating Control Freak (and possible PR Booster) for my company, and having an issue

Context

My Bitbucket project is configured to use:

Development branch: develop
Production branch: master

Control Freak is configured to have new branches match the 'Repository’s Branching Model'

My new empty repository inherits all these settings, does not override anything.

Issue

When I initialize the repository I first create master and add e.g. a .gitignore file.
This went fine.

When I then try to create develop I run into issues:

remote: Control Freak: Push rejected branch name: "develop".        
remote: 
remote: Control Freak        
remote: -----        
remote: Push rejected branch name: "develop".        
remote: New branches must comply with this repository's branching-model.        
remote: Allowed names: bugfix/*, feature/*, hotfix/*, release/*        
remote: 
remote: Note: current branching-model defines "development" as: master        
remote: -----        
remote: 

The issue is also present when trying to create develop through the Bitbucket Web UI.

In the Branching Model configuration of my repository, I see following note in red under the Development branch configuration:

This branch does not exist in this repository. The default branch will be used instead.

So we might have some kind of chicken/egg issue here: I can’t create the develop branch because it does not exist yet…

What would be the best way to fix or work around this?

Thanks in advance!

David

Comments (15)

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

    What version of Control Freak and Bitbucket are you using?

    If you setup your “branching model” at the project level (instead of repository level), you can avoid the chicken/egg issue. With Control Freak 2019.10.12, here’s what happens for me if “develop” is the development branch as defined at the project level, and I then push an empty repo under this project (with “[x] - Check Empty Repos” enabled):

    remote: Control Freak
    remote: -----
    remote: Push rejected branch name: "branch".
    remote: New branches must comply with this repository's branching-model.
    remote: Allowed names: master, develop, prod, bugfix/*, feature/*, hotfix/*, release/*
    remote: -----
    

    In this example the soon-to-be-not-empty-anymore repo contained a branch called “branch”, hence the rejection, since that doesn’t match anything in the branching model (as defined at the “project” level).

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

    Note: if your repository does override the branching model, then you are correct, it becomes a chicken/egg issue.

    My suggested remedy in that case is to add your name to the “exemptions” list of Control Freak, push “develop”, then remove your name from the exemptions list. Only repository admins can adjust the exemptions list. One day I would like to add a “15-minute-exemption” button for the current user… what do you think of that idea? (Exempt current user from all control-freak controls for 15 minutes only for the current repository only).

  3. David Catteuw reporter

    I also have no branching model overrides in my repositories. The branching model is defined on the project level, all Control Freak config is on the global level (no overrides in projects or repositories)

  4. David Catteuw reporter

    For now I’ve disabled the New Branch Names Must Match Repository's Branching Model check. and also the New Branch Names Must Match Jira Ticket check, because that one also prevented me creating a develop branch

  5. David Catteuw reporter

    Might the difference have something to do with me using Use branch name?

    Do you know what would be the Development and Production branches when I use Use default branch?

  6. David Catteuw reporter

    Just updated to the latest version of Control Freak, but I still have the same issue.

    The master and develop branches specified on the project level are not allowed to be created, except when pushing to an empty repo. There is no specific config on the repo level.

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

    Yes, sorry, v2019.10.20 did not include any fix for this issue. I plan to deal with this issue this week.

  8. David Catteuw reporter

    Thx @Julius Davies [bit-booster.com] , looking forward to it, I’ll test when a new version is available 🙂

  9. Puddleglum

    Hi, we have the same problem. I suggest adding a “freetext” name field option for self-defined branch names in the Control Freak configuration section of branch names. Even better with the option of adding more than one (like we use to define not only “develop” but a few “exceptional” admin controlled other branch names…)

  10. Sebastian M.

    I can confirm that we have exactly the same issue. I really would appreciate a fix for this, as it is a very annoying bug. A workaroud is to match branch names to a regex instead branch model.

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

    Fixed in version v2020.09.21 - use the “always allowed branches” control to specify branch names that are ALWAYS allowed for new branches (defaults to: dev, development, prod, production).

  12. Log in to comment