Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

New repository questions / JIRA integration

Jamie Rogers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2018

Hi

I have a team wanting a new project in Bitbucket but with a couple of restraints put in place around the creation repositories and the initial commit into these. I've tried having a look online but have been unable to determine if these are at all possible so hoping someone on the community can either suggest a solution or simple advise its not possible.

Here are what they're wanting to have put in place:

1. At least two people to "approve" the creation of repositories and somehow incorporate this into an existing ticket.

--- I've thought about possibly creating these via script and execute this on a JIRA transition (with approval conditions wrapped around this in JIRA) but what I'm stuck on it the multiple approvals part - We have something similar with a single approver in JIRA but not multiple. Also never done repo creation via cmd line but appears simple enough - may have to do it via generic account or something.

2. When a new repository is created in Bitbucket the initial/first commit doesn't appear to require a review so the problem this team has is they want every commit including this one to be reviewed.

--- Is this even possible?

Thank you all in advance for any advice or suggestions you might have.

Jamie 

1 answer

1 vote
Julius Davies [bit-booster.com]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2018

 

With enough talent, time and budget, everything is possible.  ;-)

 

1.  Personally, I'd build off Bitbucket Server's own dual-approval system instead of doing anything in JIRA.  Create a special "repo-of-repos" and have your script read from that before it creates new repositories.  Use the Bitbucket Server "default approvers" and "minimum approvals" features to implement the dual-approval part.

 

2.  You are correct that requiring a pull-request against the first commit is awkward.  I'm not sure how possible implementing such is, and how difficult it might be.  But I can think of a cheap workaround:  have your script push an initial empty commit against 'master' whenever a new repository is created: 

git commit --allow-empty -m 'initial empty commit'
git push

 

p.s.  My own company maintains the free Control Freak add-on.  We'd be willing to add a special "First Commit Must Be Empty" rule to our add-on if you think that might be helpful.

Jamie Rogers
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 13, 2018

Thanks G. Sylvie

 

I hadn't considered your suggestion for point 1 so will definitely look into it since it sounds much simpler.

As soon as I posted this my developer (who requested these requirements) also came to me with with that initial commit workaround and in fact they use this already (nice of them to inform me in advance) so can easily incorporate this into a script.

I will also check out that plugin and adding that rule could be useful.

Regards, Jamie 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events