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

Switch all googleapis python repos to use a default branch of main #10579

Closed
parthea opened this issue Aug 20, 2021 · 7 comments
Closed

Switch all googleapis python repos to use a default branch of main #10579

parthea opened this issue Aug 20, 2021 · 7 comments
Labels
type: process A process-related concern. May include testing, release, or the like.

Comments

@parthea
Copy link
Contributor

parthea commented Aug 20, 2021

Please follow these steps to change the default branch from master to main:

  1. Before you start the migration add your Github user to the end of the list item to avoid overlapping efforts.
  2. In the majority of python repositories, @googleapis/yoshi-python is listed as the code owner in .github/CODEOWNERS. If there are additional code owners listed, please reach out to the team listed to notify them about the effort.
  3. In the “Settings” section for the Github repository, rename the default branch from master to main. If you don’t see the settings section, you will need to reach out to an admin of the repository to complete this step. Once you’re in the settings section, look for the “Default branch” section under the branches tab. For example, for python-datastream, the link to the branches tab is https://github.com/googleapis/python-datastream/settings/branches
  4. Search the github repo for the term master in the repository. Open a PR in the repo to replace the term master with main. We have automation which will revert changes made to templated files so we also need to add replacements in owlbot.py to replace master with main similar to this PR. See this bash script that I used to create the branch for the linked PR. Note: Once this synthtool PR is merged and the synthtool templates have propagated to the repo via owlbot, we can remove the replacements in owlbot.py added in this step.
  5. Make sure that replacements are not reverted by owlbot
  6. Notify a Googler to complete the remaining steps at go/python-main-branch-migration.
  7. Check the box below when the repo has been successfully migrated and verified that the continuous/nightly builds pass after the migration.
@parthea parthea added the type: process A process-related concern. May include testing, release, or the like. label Aug 20, 2021
This was referenced Aug 23, 2021
@nicain
Copy link
Contributor

nicain commented Aug 24, 2021

@dandhlee @plamut FYI this PR provides a one-liner to pull and run the migration script via cURL; the main-migration branch within google-cloud-python holds the scripts, so if they need to be updated or modified, you will be able to access the most recent versions via cURL.

(for example, I just pushed a PR that uses "chore:" instead of "docs:" for the commit message)

@plamut
Copy link
Contributor

plamut commented Aug 25, 2021

@nicain Thanks, that's useful.

One side note, the name of the remote is hardcoded and assumed to be origin, while I personally use origin for my own forks and refer to the original repo as upstream.

In addition, not all references to master are replaced. Some of them legitimately, e.g. URLs to repos that have not migrated yet, but some others files need extra manual changes (sync-repo-settings.yaml, for example).

Something to keep in mind if anybody else uses a similar setup and if a repo has its own specifics. Best to read the script source first, it's pretty short and straightforward anyway.

@tseaver
Copy link
Contributor

tseaver commented Aug 31, 2021

@dandhlee, @parthea PR needing review: googleapis/python-bigtable#411

This was referenced Sep 1, 2021
@parthea
Copy link
Contributor Author

parthea commented Sep 3, 2021

All task are complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: process A process-related concern. May include testing, release, or the like.
Projects
None yet
Development

No branches or pull requests

5 participants