Skip to content

Commit cfd8bc2

Browse files
authored
chore: migrate to main branch (googleapis#549)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-spanner/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Unsure how to update https://github.com/googleapis/python-spanner/blob/master/pylint.config.py#L25-L28, filed googleapis#548 to keep track of it. Fixes googleapis#547 🦕
1 parent 3c2d3a7 commit cfd8bc2

6 files changed

Lines changed: 42 additions & 13 deletions

File tree

.github/sync-repo-settings.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# https://github.com/googleapis/repo-automation-bots/tree/master/packages/sync-repo-settings
2-
# Rules for master branch protection
1+
# https://github.com/googleapis/repo-automation-bots/tree/main/packages/sync-repo-settings
2+
# Rules for main branch protection
33
branchProtectionRules:
44
# Identifies the protection rule pattern. Name of the branch to be protected.
5-
# Defaults to `master`
6-
- pattern: master
5+
# Defaults to `main`
6+
- pattern: main
77
requiresCodeOwnerReviews: true
88
requiresStrictStatusChecks: true
99
requiredStatusCheckContexts:

.github/workflows/integration-tests-against-emulator.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
on:
22
push:
33
branches:
4-
- master
4+
- main
55
pull_request:
66
name: Run Spanner integration tests against emulator
77
jobs:

.kokoro/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ python3 -m pip install --upgrade --quiet nox
4444
python3 -m nox --version
4545

4646
# If this is a continuous build, send the test log to the FlakyBot.
47-
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
47+
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
4848
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
4949
cleanup() {
5050
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot

.kokoro/test-samples-impl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ for file in samples/**/requirements.txt; do
8080
EXIT=$?
8181

8282
# If this is a periodic build, send the test log to the FlakyBot.
83-
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
83+
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
8484
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
8585
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
8686
$KOKORO_GFILE_DIR/linux_amd64/flakybot

CONTRIBUTING.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ You'll have to create a development environment using a Git checkout:
5050
# Configure remotes such that you can pull changes from the googleapis/python-spanner
5151
# repository into your local repository.
5252
$ git remote add upstream git@github.com:googleapis/python-spanner.git
53-
# fetch and merge changes from upstream into master
53+
# fetch and merge changes from upstream into main
5454
$ git fetch upstream
55-
$ git merge upstream/master
55+
$ git merge upstream/main
5656

5757
Now your local repo is set up such that you will push changes to your GitHub
5858
repo, from which you can submit a pull request.
@@ -110,12 +110,12 @@ Coding Style
110110
variables::
111111

112112
export GOOGLE_CLOUD_TESTING_REMOTE="upstream"
113-
export GOOGLE_CLOUD_TESTING_BRANCH="master"
113+
export GOOGLE_CLOUD_TESTING_BRANCH="main"
114114

115115
By doing this, you are specifying the location of the most up-to-date
116116
version of ``python-spanner``. The the suggested remote name ``upstream``
117117
should point to the official ``googleapis`` checkout and the
118-
the branch should be the main branch on that remote (``master``).
118+
the branch should be the main branch on that remote (``main``).
119119

120120
- This repository contains configuration for the
121121
`pre-commit <https://pre-commit.com/>`__ tool, which automates checking
@@ -209,7 +209,7 @@ The `description on PyPI`_ for the project comes directly from the
209209
``README``. Due to the reStructuredText (``rst``) parser used by
210210
PyPI, relative links which will work on GitHub (e.g. ``CONTRIBUTING.rst``
211211
instead of
212-
``https://github.com/googleapis/python-spanner/blob/master/CONTRIBUTING.rst``)
212+
``https://github.com/googleapis/python-spanner/blob/main/CONTRIBUTING.rst``)
213213
may cause problems creating links or rendering the description.
214214

215215
.. _description on PyPI: https://pypi.org/project/google-cloud-spanner
@@ -234,7 +234,7 @@ We support:
234234

235235
Supported versions can be found in our ``noxfile.py`` `config`_.
236236

237-
.. _config: https://github.com/googleapis/python-spanner/blob/master/noxfile.py
237+
.. _config: https://github.com/googleapis/python-spanner/blob/main/noxfile.py
238238

239239

240240
We also explicitly decided to support Python 3 beginning with version 3.6.

owlbot.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,32 @@ def place_before(path, text, *before_text, escape=None):
249249
)
250250

251251
s.shell.run(["nox", "-s", "blacken"], hide_output=False)
252+
253+
# ----------------------------------------------------------------------------
254+
# Main Branch migration
255+
# ----------------------------------------------------------------------------
256+
257+
s.replace(
258+
"*.rst",
259+
"master",
260+
"main"
261+
)
262+
263+
s.replace(
264+
"*.rst",
265+
"google-cloud-python/blob/main",
266+
"google-cloud-python/blob/master"
267+
)
268+
269+
s.replace(
270+
"CONTRIBUTING.rst",
271+
"kubernetes/community/blob/main",
272+
"kubernetes/community/blob/master"
273+
)
274+
275+
s.replace(
276+
".kokoro/*",
277+
"master",
278+
"main"
279+
)
280+

0 commit comments

Comments
 (0)