Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Delete all user repositories from bitbucket (stash)

michael_giroux March 16, 2016

As contractors come and go, we end up with dead forks in Stash.  That is, forks in user repositories that are never going to be incorporated.  We would like to delete all repositories in the user's personal space.

Our users are configured using LDAP. Once the user is dropped from LDAP, the user is no longer visible in the user's admin page of Stash.  However, we can still go to the users list of repositories via http://stash/users/user_name.

Is there a convenient way to remove all personal repositories for these users?

6 answers

1 vote
Johannes Kilian
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.
March 16, 2016

There isn't a convenient way -  at least no way I know.

As a central git-server is generally used as a long-time archive, there even shouldn't be a convenient way IMHO to do mass destruction operations (which might be easily done by incident ...)

You might achieve your goal using the REST API.This needs a little scripting, but should be easy enough though.

 

avsaditya February 17, 2021

@Johannes Kilian Thank you very much.

This is a life saver.

0 votes
Johannes Kilian
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.
March 17, 2016

I just wanted to point out, how "freeing licenses when using LDAP" works ...- I was aware that was not part of @michael_giroux's question - therefore I added it as a comment - and not as an answer wink

Tim Crall: Thanks - wasn't aware of this. My insights have been a result of discussion on https://answers.atlassian.com/questions/195495 As I don't have access on our ActiveDirectory contents, the dynamic "Separate Group" solution is not a way to go for me yet sad

 

0 votes
Tim Crall
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.
March 17, 2016

yeah, I know licenses weren't your issue, but Johannes's aside about deleting accounts from LDAP being the only way to retrieve licenses seemed odd to me.

0 votes
michael_giroux March 17, 2016

The license is not the issue.  Some of these folks forked several repos, and/or created their own repositories.  We want to every repository created by a contractor once they are removed from LDAP.

 

Johannes Kilian has proposed a nice solution using the Rest API.  We will look into that.

0 votes
Tim Crall
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.
March 17, 2016

We have our server configured so that only members of a particular AD group can login to Stash, and removing them from that group frees up the license.

0 votes
Johannes Kilian
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.
March 16, 2016

@michael_giroux: "Once the user is dropped from LDAP, the user is no longer visible in the user's admin page of Stash"

Just for information: This is the only way to free the Bitbucket-licenses of LDAP users. Each LDAP user is able to login into Bitbucket server. As soon as the LDAP user initially logs in, he eats up one license out of your license pool. Bitbucket does not offer a possibility to remove the user from the license pool again to free the license (as can be done with Internal Bitbucket Users). The only way to free licenses of LDAP users is removing them from LDAP - after this Bitbucket automatically should free the users license.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events