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

Rename "master" branch to "main" #21749

Closed
sftim opened this issue Jun 14, 2020 · 39 comments
Closed

Rename "master" branch to "main" #21749

sftim opened this issue Jun 14, 2020 · 39 comments
Assignees
Labels
priority/backlog Higher priority than priority/awaiting-more-evidence. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. wg/naming Categorizes an issue or PR as relevant to WG Naming.

Comments

@sftim
Copy link
Contributor

sftim commented Jun 14, 2020

This is a Feature Request

What would you like to be added
Rename the master branch to main

Why is this needed
Our live website builds from the master branch
I suggest serving the website from a (new) branch called main instead.

This change avoids using a term linked with controversy (especially in the United States of America).

/kind cleanup

@sftim
Copy link
Contributor Author

sftim commented Jun 15, 2020

/priority awaiting-more-evidence
/sig contributor-experience

@k8s-ci-robot k8s-ci-robot added priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. labels Jun 15, 2020
@celestehorgan
Copy link
Contributor

@sftim it's looking likely that we're going to wait to see what GitHub rolls out before making any moves ourselves, just fyi

@sftim
Copy link
Contributor Author

sftim commented Jun 24, 2020

Yep, I've intentionally set this to /priority awaiting-more-evidence

@sftim
Copy link
Contributor Author

sftim commented Jun 26, 2020

Duplicated by issue #22069

@celestehorgan
Copy link
Contributor

/wg naming

@k8s-ci-robot k8s-ci-robot added the wg/naming Categorizes an issue or PR as relevant to WG Naming. label Jul 1, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 29, 2020
@nikhita
Copy link
Member

nikhita commented Sep 30, 2020

/remove-lifecycle stale
xref kubernetes/org#2222

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 30, 2020
@justaugustus
Copy link
Member

Celeste to get more info:
/assign @celestehorgan

@celestehorgan
Copy link
Contributor

Per our last SIG Docs meeting: @sftim is on board with the idea of renaming master branch to main instead.

/rename Rename "master" branch to "main"

@sftim
Copy link
Contributor Author

sftim commented Dec 2, 2020

/retitle Rename "master" branch to "main"

@k8s-ci-robot k8s-ci-robot changed the title Rename “master” branch to “live” Rename "master" branch to "main" Dec 2, 2020
@sftim
Copy link
Contributor Author

sftim commented Dec 2, 2020

@celestehorgan feel free to /triage accepted and adjust priority too.

@celestehorgan
Copy link
Contributor

/triage accpeted
/priority important-soon

From an implementation perspective, there are three major steps here. One is (to me) ambiguous:

  1. Rename the branch
  2. Ensure tooling (namely, Netlify) point to main and not master (this is easy)
  3. Ensure extended tooling (autogenerated docs, mainly) are not affected. (this is hard)

@k8s-ci-robot
Copy link
Contributor

@celestehorgan: The label(s) triage/accpeted cannot be applied, because the repository doesn't have them

In response to this:

/triage accpeted
/priority important-soon

From an implementation perspective, there are three major steps here. One is (to me) ambiguous:

  1. Rename the branch
  2. Ensure tooling (namely, Netlify) point to main and not master (this is easy)
  3. Ensure extended tooling (autogenerated docs, mainly) are not affected. (this is hard)

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Dec 2, 2020
@celestehorgan
Copy link
Contributor

/remove priority-awaiting-more-evidence

@sftim
Copy link
Contributor Author

sftim commented Dec 2, 2020

BTW we can start by mirroring the master branch to the main branch. Branch mirroring makes transitions less painful.

@sftim
Copy link
Contributor Author

sftim commented Dec 2, 2020

What do we do about all the in-flight PRs? Does GitHub automatically update their base branch?

@celestehorgan
Copy link
Contributor

@sftim I suspect we'll have to start by mirroring.

I tested this out on an old repository of mine:

  1. created a branch main
  2. Set it to the main branch for the repository
  3. Observed what happened to an in-flight pull request opened against master.

The results were:

  • master cannot be deleted because an open PR depends on it
  • The open PR does not automatically switch to main

Ergo, we'd have to create main, switch Netlify over to it, encourage as many inflight PRs to merge against main as possible, and merge master into main regularly, like a release branch, for some period of time until no new PRs are open against it.

@sftim
Copy link
Contributor Author

sftim commented Dec 2, 2020

merge master into main regularly

We could block merges to master and then automatically mirror all new commits from main to master, until all open PRs are dealt with.

https://github.com/google/mirror-branch-action can help here.

@sftim
Copy link
Contributor Author

sftim commented Dec 2, 2020

(after that's set up, anyone who has a PR targeting master can switch the merge base of their PR to main)

@sftim
Copy link
Contributor Author

sftim commented Feb 2, 2021

/remove-priority awaiting-more-evidence
/priority backlog

@k8s-ci-robot k8s-ci-robot added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed priority/awaiting-more-evidence Lowest priority. Possibly useful, but not yet enough support to actually get it done. labels Feb 2, 2021
@celestehorgan
Copy link
Contributor

@justaugustus – Are individual repos in the org now free to go ahead and start renaming their main branches, or are we still investigating?

@nikhita
Copy link
Member

nikhita commented Apr 25, 2021

Are individual repos in the org now free to go ahead and start renaming their main branches, or are we still investigating?

Yes, individual repos can rename their branch if they are interested. https://k8s.dev/rename has more details. Having said that, we've only renamed low-volume repos until now.

@spiffxp do you know if the issue with webhooks getting triggered on all issues/PRs has been fixed? If yes, can we trial this on k/website?

cc @mrbobbytables @cblecker

@jimangel
Copy link
Member

I think we have the ability to make this change ASAP. I will send something out to the mailing list and bring it up at this weeks SIG Docs meeting. If there's no objection, I can open the non-disruptive PRs and we can plan a date. Thanks!

@justaugustus
Copy link
Member

Awesome to see!
Jim we're going to assign you.

/unassign @celestehorgan
/assign @jimangel

@spiffxp
Copy link
Member

spiffxp commented May 17, 2021

@spiffxp do you know if the issue with webhooks getting triggered on all issues/PRs has been fixed? If yes, can we trial this on k/website?

I believe so, yes. There is a relevant test-infra issue for this

@spiffxp
Copy link
Member

spiffxp commented May 17, 2021

kubernetes/test-infra#20829 should be fixed as of two months ago

@mrbobbytables
Copy link
Member

FYI - we have done the switch for another repo that was using netlify. It will throw an error if the master branch is gone if someone triggers a rebuild before it's config is updated. The good news is, updating is easy in the netlify UI and it takes effect immediately. 👍

@jimangel
Copy link
Member

jimangel commented Jun 15, 2021

Changes pre-rename

  • presubmit or postsubmit prowjob triggers (N/A)
  • milestone_applier prow config references the master branch (only targets dev-x.xx)
  • branch_protection prow config references the master branch (only targets release-x.xx)

Just before rename

  • periodic prowjobs (N/A)
  • prowjob mentions master in its name (N/A)
  • prowjob calls scripts or code in your repo (N/A)
  • review github actions for branch specifics (none found)
  • repo has netlify configured (...can do at anytime)

I don't believe we have anything other then netlify to tweak.

Approval

  • Once all non-disruptive tasks have been completed and disruptive tasks have been identified, assign the GitHub Management team (@kubernetes/owners) for approval.

Rename the default branch

  • Rename the default branch from master to main using the GitHub UI by following the official instructions.

Other

  • docs reference the master branch, update to main (URLs will be automatically redirected).
  • Ensure that CI and PR tests work fine.
  • Trial the local development experience with a pre-rename clone.
  • Send a notice about the branch rename to your SIG’s mailing list. Include the link to the GitHub instructions to rename your local branch.

Lessons learned:

  • If there's an open PR with a deleted fork/branch the PR is auto-closed (no problem)
  • It appears that your local GitHub contributions graph doubles (?)
  • Had to update Build hooks for netlify due to only being able to config the branch on setup (used for scheduled deploys)
  • Renamed Netlify site name due to the auto-generated (based on site name) URL using the old branch name.

@mrbobbytables
Copy link
Member

+1 as github admin 👍

@sftim
Copy link
Contributor Author

sftim commented Jun 17, 2021

Should we open an issue about the docs update, get a held PR open for that?

@jimangel
Copy link
Member

jimangel commented Jun 17, 2021

Should we open an issue about the docs update, get a held PR open for that?

Edit: Sorry, misread, I'm not sure it will make a difference considering the change is through the GUI.

@sftim
Copy link
Contributor Author

sftim commented Jun 17, 2021

I was thinking about pages like the guide to contributing and https://kubernetes.io/docs/contribute/new-content/open-a-pr/#create-a-branch

@jimangel
Copy link
Member

jimangel commented Jun 17, 2021

@sftim oh! Double misunderstood, heh. Yes, opening a tracking issue / PR to resolve lingering docs would be fantastic!

I have a feeling some of it will just take time to flow through localization strategies too.

@sftim
Copy link
Contributor Author

sftim commented Jun 17, 2021

Tracking issue: #28462

@kbhawkey
Copy link
Contributor

👀

@jimangel
Copy link
Member

@k8s-ci-robot
Copy link
Contributor

@jimangel: Closing this issue.

In response to this:

Renaming is complete. Ref: https://groups.google.com/g/kubernetes-sig-docs/c/s98sr2appP4/m/M-r7gANqAgAJ
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@chrisnegus
Copy link
Contributor

Quick note: My open PRs seemed to transition properly to main. However, if there has not been a new commit to regenerate the Netlify build, the old Netlify link is listed at the bottom of the PR. I was able to see the new Netlify by simply changing master to main in the URL. For example, changing https://deploy-preview-28367--kubernetes-io-master-staging.netlify.app/ to https://deploy-preview-28367--kubernetes-io-main-staging.netlify.app/

@sftim
Copy link
Contributor Author

sftim commented Jun 21, 2021

Website admins can manually retrigger a build to fix that - I haven't looked into automating this though, as it's a one-off change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/backlog Higher priority than priority/awaiting-more-evidence. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/contributor-experience Categorizes an issue or PR as relevant to SIG Contributor Experience. wg/naming Categorizes an issue or PR as relevant to WG Naming.
Projects
None yet
Development

No branches or pull requests