Skip to content
This repository has been archived by the owner on Jan 5, 2023. It is now read-only.

Change default branch to "main" #88

Closed
kashifest opened this issue Nov 3, 2021 · 12 comments
Closed

Change default branch to "main" #88

kashifest opened this issue Nov 3, 2021 · 12 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. triage/accepted Indicates an issue is ready to be actively worked on.

Comments

@kashifest
Copy link
Member

Addresses this.

This has already been done in CAPM3 and IPAM. Check these repo's for reference.

@kashifest
Copy link
Member Author

Prerequisites

  • Create an issue in your repo to track the branch rename.
    You can paste this checklist in the issue body.

  • If you are not a root approver for the repo, assign a root
    approver for approval.

  • Once the issue has been approved, send a notice to your SIG's
    mailing list about the potential branch rename.

Changes pre-rename

Make the following changes before renaming the branch the master branch.

Note: There might be additional changes required that have not been
covered in this checklist.

Note: There might be additional information available in the umbrella issue via [kubernetes/org#2222].

Anytime

These changes are non-disruptive and can be made anytime before renaming
the branch.

Just before rename

These changes are disruptive and should be made just before renaming the
branch.

  • For periodic prowjobs, or any prowjob that mentions the master branch
    in base_ref, update them to the main branch. Ensure that these changes
    happen in lock-step with the branch rename (jobs triggered in between landing
    these changes and renaming the branch will fail).

    • For bootstrap-based jobs, ensure the branch is explicitly specified,
      e.g. kubernetes/foo=main. kubernetes/test-infra#20667 may eventually
      allow for non-disruptive changes.
    • For pod-utils based jobs, ensure the branch is explicitly specified,
      e.g. base_ref: main. kubernetes/test-infra#20672 may eventually allow
      for non-disruptive changes.
  • If a prowjob mentions master in its name, rename the job to not include
    the branch name, e.g. pull-repo-verify-master -> pull-repo-verify.
    status-reconciler should automatically migrate PR status contexts to the
    new job name, and retrigger accordingly, but we have anecdotally found it
    sometimes misses changes.

    • NOTE: our infrastructure doesn't understand the concept of job renames, so
      from the perspective of e.g. https://testgrid.k8s.io the job will appear to
      have lost history and start from scratch.
  • If a prowjob calls scripts or code in your repo that explicitly
    reference master, update all references to use main, or auto-detect the
    remote branch

    • e.g. using git to auto-detect
    # for existing clones, update their view of the remote
    git fetch origin
    git remote set-head origin -a
    # for new clones, or those updated as above, this prints "main" post-rename
    echo $(git symbolic-ref refs/remotes/origin/HEAD)
    • e.g. using github's api to auto-detect
    # gh is https://github.com/cli/cli, this will print "main" post-rename
    gh api /repos/kubernetes-sigs/slack-infra | jq -r .default_branch
  • If the repo has netlify configured for it, ask a member of the GitHub
    Management Team to rename the master branch to main in the netlify site config.
    It can't be controlled through the netlify config in the repo.

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.

Changes post-rename

After the default branch has been renamed to main, make the following
changes.

Note: There might be additional changes required that have not been
covered in this checklist.

Prowjobs

  • If a prowjob still references the master branch in the branches field,
    remove the master branch (see kubernetes/test-infra#20669 for an example).

Prow config

  • If the milestone_applier prow config references the master branch,
    remove it from the config.

  • If the branch_protection prow config references the master branch,
    remove it from the config.

Other

  • If any docs reference the master branch, update to main
    (URLs will be automatically redirected).

  • Ensure that CI and PR tests work fine.

    • If there are any outstanding PRs you can /approve to merge, do so to verify
      that presubmits and postsubmits work as expected
  • 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.

@ravipwaghmare
Copy link
Member

@digambar15 @maelk @zaneb @russellb Please take a look, If something is needed from our end, please let us know.

@Rozzii
Copy link
Member

Rozzii commented Feb 4, 2022

/triage accepted
/assign @ravipwaghmare @Ashughorla
please @ravipwaghmare @Ashughorla take a look

@metal3-io-bot metal3-io-bot added the triage/accepted Indicates an issue is ready to be actively worked on. label Feb 4, 2022
@Rozzii
Copy link
Member

Rozzii commented Feb 4, 2022

/assign @ravipwaghmare
/assign @Ashughorla

@metal3-io-bot
Copy link
Collaborator

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

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

/lifecycle stale

@metal3-io-bot metal3-io-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 6, 2022
@metal3-io-bot
Copy link
Collaborator

@Rozzii:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

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.

@metal3-io-bot metal3-io-bot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label May 11, 2022
@Rozzii
Copy link
Member

Rozzii commented Jun 8, 2022

/cc @Ashughorla
/cc @@ravipwaghmare
Please act on this issue, this is a CNCF request and could cause problems for the whole Metal3 community.
/remove-lifecycle stale

@metal3-io-bot metal3-io-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jun 8, 2022
@Ashughorla
Copy link
Member

@Rozzii
We will raise PR for this ASAP.
Apology for late response.

@Rozzii
Copy link
Member

Rozzii commented Aug 31, 2022

I think we are done @kashifest

@kashifest
Copy link
Member Author

I think we are done @kashifest

Yes

@Rozzii
Copy link
Member

Rozzii commented Sep 7, 2022

/close

@metal3-io-bot
Copy link
Collaborator

@Rozzii: Closing this issue.

In response to this:

/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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. triage/accepted Indicates an issue is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

5 participants