Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy branch configuration from the template #14303

Closed
tomaswarynyca opened this issue Jan 11, 2021 · 19 comments · Fixed by #25889
Closed

Copy branch configuration from the template #14303

tomaswarynyca opened this issue Jan 11, 2021 · 19 comments · Fixed by #25889
Labels
type/enhancement An improvement of existing functionality type/proposal The new feature has not been accepted yet but needs to be discussed first.
Milestone

Comments

@tomaswarynyca
Copy link
Contributor

Description

Having a configuration for the main branch in a template should be copied when one creates a repository from that template.
This was discussed at the time in #9126 but it was left abandoned, I create these issues to see if it can be reactivated because it is a functionality that is very useful to devops.

@a1012112796 a1012112796 added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Jan 12, 2021
@zeripath
Copy link
Contributor

are you sure that this is not already the case following #10803?

@tomaswarynyca
Copy link
Contributor Author

I refer to the Branch Protection configuration. I have a template repository with x rules in the main branch, when I create a repository based on the template and copy the branch, the protection settings of that branch must be copied to the new repository.

@jolheiser
Copy link
Member

jolheiser commented Jan 13, 2021

Hello! I am currently working on this (and I will re-open #9126, I forgot to keep the stalebot away 😓 )

One caveat is whitelisted users/teams, as those could be infeasible depending on who is using the template and what type of access they have compared to the template owner.
For the initial version I don't think those will be carried over.
Some fancy code could probably determine an intersection of valid values, but that's likely more complex than necessary.
A follow-up could be made to add the intersection, if needed. 🙂

@lunny
Copy link
Member

lunny commented Jan 13, 2021

You can read the template repositories, but maybe you have no permissions knows how the protected branches configured because this is a feature of owners of that repository.

@jolheiser I think this is a point we should be careful.

@tomaswarynyca
Copy link
Contributor Author

Not all should be copied, but the main protected files, required approvals, status check, among others.
Captura de pantalla_área-de-selección_20210113142343

@tomaswarynyca
Copy link
Contributor Author

Hi, I saw that the pr was already made but was abandoned, it is a tool that I need at work, is it possible to implement it now?

@jolheiser
Copy link
Member

What makes you think #14334 is abandoned? 🤔

@tomaswarynyca
Copy link
Contributor Author

What makes you think #14334 is abandoned?

The last commit was 13 days ago, I thought it was already finished
As I had no news about the pr or issues I decided to send the message

@jolheiser
Copy link
Member

We are currently in a freeze to get 1.14 polished up, and the reference PR is slated for 1.15 as a result.
It may take a while for it to get reviewed. 🙂

@tomaswarynyca
Copy link
Contributor Author

When is it planned to release the final v1.14 to start with v1.15?
I'm sorry if I'm pushing too hard, but I'm needing the function for several projects at work.

@jolheiser
Copy link
Member

jolheiser commented Jan 29, 2021

Unfortunately it's very hard to pin down a day. We are entirely run by volunteer time, so the best we can do is a general timeframe.

The milestone for 1.14 is past due by 4 days (at time of this writing), however there will still need to be RCs prior to a stable release, etc.

If you are needing this sooner than later, I would suggest instead writing a script to copy branch protection from one repo to another in the interim.
You can use the API to get branch protection from a repo, and then use the API to create branch protection for another repo.

@tomaswarynyca
Copy link
Contributor Author

Ohh great I hadn't considered the option of using the API.
So thanks for the functionality and I look forward to v1.15 to try it out.

@ztrnr
Copy link

ztrnr commented Sep 12, 2022

@tomaswarynyca have you created this script? I'm looking for the same functionality at my work.

@GregJCook
Copy link

I just stumbled across this missing feature as well. Any update on getting branch protection policies to carry forward from a template?

@Calvin-Hill
Copy link

Is this still in the works? Just stumbled on this issue when creating a repo from my template and realising none of my branch protection rules had copied over

@Barsay
Copy link

Barsay commented Mar 6, 2023

Any news on this? same as @Calvin-Hill , found this while setting up a template

@w4dd325
Copy link

w4dd325 commented Jul 7, 2023

Any further developments on this? Interested to get this setup...

@fuzunspm
Copy link

this is a must have feature. I would like to copy master/main rule set from a repository to all other repositories

@lunny lunny added the type/enhancement An improvement of existing functionality label Jul 14, 2023
@lunny lunny added this to the 1.21.0 milestone Jul 14, 2023
@lmandon
Copy link

lmandon commented Jul 18, 2023

Hello,
This would be beneficial to our teams as well, looking forward to the implementation.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/enhancement An improvement of existing functionality type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet