Skip to content

Commit 60f5f90

Browse files
plamutgcf-owl-bot[bot]
authored andcommitted
chore: migrate default branch to main (#283)
* chore: migrate default branch from master to main * Remove additional references to `master` * Add replacements to owlbot.py to persist changes * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 1039459 commit 60f5f90

File tree

6 files changed

+71
-23
lines changed

6 files changed

+71
-23
lines changed

packages/google-cloud-bigquery-storage/.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:

packages/google-cloud-bigquery-storage/.kokoro/build.sh

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

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

packages/google-cloud-bigquery-storage/.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

packages/google-cloud-bigquery-storage/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-bigquery-storage
5151
# repository into your local repository.
5252
$ git remote add upstream [email protected]:googleapis/python-bigquery-storage.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-bigquery-storage``. 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-bigquery-storage/blob/master/CONTRIBUTING.rst``)
212+
``https://github.com/googleapis/python-bigquery-storage/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-bigquery-storage
@@ -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-bigquery-storage/blob/master/noxfile.py
237+
.. _config: https://github.com/googleapis/python-bigquery-storage/blob/main/noxfile.py
238238

239239

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

packages/google-cloud-bigquery-storage/docs/conf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
# The encoding of source files.
7777
# source_encoding = 'utf-8-sig'
7878

79-
# The master toctree document.
80-
master_doc = "index"
79+
# The root toctree document.
80+
root_doc = "index"
8181

8282
# General information about the project.
8383
project = "google-cloud-bigquery-storage"
@@ -280,7 +280,7 @@
280280
# author, documentclass [howto, manual, or own class]).
281281
latex_documents = [
282282
(
283-
master_doc,
283+
root_doc,
284284
"google-cloud-bigquery-storage.tex",
285285
"google-cloud-bigquery-storage Documentation",
286286
author,
@@ -315,7 +315,7 @@
315315
# (source start file, name, description, authors, manual section).
316316
man_pages = [
317317
(
318-
master_doc,
318+
root_doc,
319319
"google-cloud-bigquery-storage",
320320
"google-cloud-bigquery-storage Documentation",
321321
[author],
@@ -334,7 +334,7 @@
334334
# dir menu entry, description, category)
335335
texinfo_documents = [
336336
(
337-
master_doc,
337+
root_doc,
338338
"google-cloud-bigquery-storage",
339339
"google-cloud-bigquery-storage Documentation",
340340
author,

packages/google-cloud-bigquery-storage/owlbot.py

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@
2626

2727
for library in s.get_staging_dirs(default_version):
2828
# Work around gapic generator bug https://github.com/googleapis/gapic-generator-python/issues/902
29-
s.replace(library / f"google/cloud/bigquery_storage_{library.name}/types/arrow.py",
30-
r""".
29+
s.replace(
30+
library / f"google/cloud/bigquery_storage_{library.name}/types/arrow.py",
31+
r""".
3132
Attributes:""",
32-
r""".\n
33+
r""".\n
3334
Attributes:""",
3435
)
3536

@@ -99,11 +100,12 @@
99100
# The append_rows method doesn't contain keyword arguments that build request
100101
# objects, so flattened tests are not needed and break with TypeError.
101102
s.replace(
102-
library / f'tests/unit/gapic/bigquery_storage_{library.name}*/test_big_query_write.py',
103+
library
104+
/ f"tests/unit/gapic/bigquery_storage_{library.name}*/test_big_query_write.py",
103105
r"(@[a-z.()\n]*\n)?(async )?"
104106
r"def test_append_rows_flattened[_a-z]*\(\):\n"
105107
r"( {4}.*|\n)+",
106-
'\n',
108+
"\n",
107109
)
108110

109111
s.move(
@@ -148,5 +150,51 @@
148150

149151
python.py_samples(skip_readmes=True)
150152

153+
# Remove the replacements below once
154+
# https://github.com/googleapis/synthtool/pull/1188 is merged
155+
156+
# Update googleapis/repo-automation-bots repo to main in .kokoro/*.sh files
157+
s.replace(
158+
".kokoro/*.sh",
159+
"repo-automation-bots/tree/master",
160+
"repo-automation-bots/tree/main",
161+
)
162+
163+
# Customize CONTRIBUTING.rst to replace master with main
164+
s.replace(
165+
"CONTRIBUTING.rst",
166+
"fetch and merge changes from upstream into master",
167+
"fetch and merge changes from upstream into main",
168+
)
169+
170+
s.replace(
171+
"CONTRIBUTING.rst", "git merge upstream/master", "git merge upstream/main",
172+
)
173+
174+
s.replace(
175+
"CONTRIBUTING.rst",
176+
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"master\"""",
177+
"""export GOOGLE_CLOUD_TESTING_BRANCH=\"main\"""",
178+
)
179+
180+
s.replace(
181+
"CONTRIBUTING.rst", "remote \(``master``\)", "remote (``main``)",
182+
)
183+
184+
s.replace(
185+
"CONTRIBUTING.rst", "blob/master/CONTRIBUTING.rst", "blob/main/CONTRIBUTING.rst",
186+
)
187+
188+
s.replace(
189+
"CONTRIBUTING.rst", "blob/master/noxfile.py", "blob/main/noxfile.py",
190+
)
191+
192+
s.replace(
193+
"docs/conf.py", "master_doc", "root_doc",
194+
)
195+
196+
s.replace(
197+
"docs/conf.py", "# The master toctree document.", "# The root toctree document.",
198+
)
151199

152-
s.shell.run(["nox", "-s", "blacken"], hide_output=False)
200+
s.shell.run(["nox", "-s", "blacken"], hide_output=False)

0 commit comments

Comments
 (0)