Skip to content

Commit

Permalink
chore: Change primary branch from master to main (#14463)
Browse files Browse the repository at this point in the history
  • Loading branch information
dazuma authored Oct 25, 2021
1 parent 719c421 commit d473d30
Show file tree
Hide file tree
Showing 11 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ rebaseMergeAllowed: true
squashMergeAllowed: true
mergeCommitAllowed: false
branchProtectionRules:
- pattern: master
- pattern: main
isAdminEnforced: false
requiredStatusCheckContexts:
- 'cla/google'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: CI
on:
pull_request:
branches:
- master
- main
push:
branches:
- master
- main
schedule:
- cron: "20 8 * * *"
workflow_dispatch:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: release-please-label
on:
pull_request_target:
branches:
- master
- main
types:
- opened
jobs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
on:
push:
branches:
- master
- main
paths:
- 'google-cloud-spanner*/**'
pull_request:
Expand Down
2 changes: 1 addition & 1 deletion .kokoro/presubmit/acceptance.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ env_vars: {

env_vars: {
key: "EXTRA_CI_ARGS"
value: "--base=master --max-gem-count=4 --acceptance"
value: "--base=main --max-gem-count=4 --acceptance"
}
2 changes: 1 addition & 1 deletion .kokoro/presubmit/samples.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ env_vars: {

env_vars: {
key: "EXTRA_CI_ARGS"
value: "--base=master --max-gem-count=4 --samples-master"
value: "--base=main --max-gem-count=4 --samples-master"
}
2 changes: 1 addition & 1 deletion CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Kokoro configurations for the three test trigger types (presubmit, continuous, a

For example: continuous and nightly tests both run on both the oldest and newest Ruby. There is only one [continuous acceptance test config](.kokoro/continuous/acceptance.cfg), and it sets `$RUBY_VERSIONS` to `"OLDEST NEWEST"` indicating that the _one_ Kokoro job should run against both Ruby versions in sequence. However, there are two separate configs for nightly acceptance tests, [one for oldest Ruby](.kokoro/nightly/acceptance-oldest.cfg) and [one for newest Ruby](.kokoro/nightly/acceptance-newest.cfg). These set `$RUBY_VERSIONS` to only one value each: `"OLDEST"`, and `"NEWEST"`, respectively. Hence, each of these separate Kokoro jobs runs against a different Ruby version, and they run concurrently. (We should note, by the way, that the symbolic values `"OLDEST"` and `"NEWEST"` are mapped to specific Ruby versions in [`integration.sh`](.kokoro/integration.sh).) Therefore, if we want to change which versions of Ruby are run sequentially, we can modify this environment variable in the Kokoro configs. If we want to change versions of Ruby run concurrently in separate Kokoro jobs, we need to add or remove Kokoro config files (again, both here and in Google's internal source control.)

The `$EXTRA_CI_ARGS` environment variable contains command line arguments passed directly to `toys ci`, as documented above. For example, presubmit tests analyze the changes between the PR and the master branch by setting `--base=master`, continuous tests analyze the changes since the previous commit by setting `--base=HEAD^`, and nightly tests test all libraries by setting `--all-gems`. These command line arguments can be modified to change the behavior of the various tests.
The `$EXTRA_CI_ARGS` environment variable contains command line arguments passed directly to `toys ci`, as documented above. For example, presubmit tests analyze the changes between the PR and the main branch by setting `--base=main`, continuous tests analyze the changes since the previous commit by setting `--base=HEAD^`, and nightly tests test all libraries by setting `--all-gems`. These command line arguments can be modified to change the behavior of the various tests.

Of note: the _actual_ trigger of Kokoro tests (i.e. whether it's a presubmit triggered by a PR, a continuous test triggered by pushes to the main branch, or a nightly test triggered by a cron) is controlled by the config files in the internal Google source control. For example, the time setting for the cron can be edited only in the internal config.

Expand Down
8 changes: 4 additions & 4 deletions KOKORO.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#### Continuous

- Run when a PR is merged to master. They run all unit tests. They run acceptance tests for a gem if the commit on master which triggered the build contains changes to that gem.
- Run when a PR is merged to main. They run all unit tests. They run acceptance tests for a gem if the commit on main which triggered the build contains changes to that gem.

#### Nightly

Expand All @@ -40,11 +40,11 @@

##### Continuous

- Run when a PR is merged to master.
- Run when a PR is merged to main.

- Runs all tests for every sample.

- Installs gems from master branch.
- Installs gems from main branch.

##### Nightly

Expand Down Expand Up @@ -88,7 +88,7 @@

### Updating ruby versions

1. Update the `RUBY_VERSIONS` in the [testing-infra-docker](https://github.com/googleapis/testing-infra-docker) ruby/multi/Dockerfile. When your PR is merged, the images will rebuild automatically. (Note: The windows image is not rebuilt automatically and needs to be handled manually.) This update must be in master to proceed.
1. Update the `RUBY_VERSIONS` in the [testing-infra-docker](https://github.com/googleapis/testing-infra-docker) ruby/multi/Dockerfile. When your PR is merged, the images will rebuild automatically. (Note: The windows image is not rebuilt automatically and needs to be handled manually.) This update must be in main to proceed.
1. Run `bundle exec rake kokoro:build` which will update .kokoro/osx.sh to use the ruby versions set above.
1. Open a PR.
1. Create the internal configs by following the steps [outlined here](https://docs.google.com/document/d/17Wg3ar8wlFTtut2CcAV9Geg8K9x28MK_UtUsYoyEx2s/edit#heading=h.o8nsr6d5n4va)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Idiomatic Ruby client for [Google Cloud Platform](https://cloud.google.com/) services.

[![Coverage Status](https://codecov.io/gh/googleapis/google-cloud-ruby/branch/master/graph/badge.svg)](https://codecov.io/gh/googleapis/google-cloud-ruby)
[![Coverage Status](https://codecov.io/gh/googleapis/google-cloud-ruby/branch/main/graph/badge.svg)](https://codecov.io/gh/googleapis/google-cloud-ruby)
[![Gem Version](https://badge.fury.io/rb/google-cloud.svg)](http://badge.fury.io/rb/google-cloud)

* [Homepage](https://googleapis.github.io/google-cloud-ruby/)
Expand Down
20 changes: 10 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ end
require_relative "rakelib/devsite/devsite_builder"

namespace :docs do
desc "Builds documentation for all gems on current branch (assumes master)"
desc "Builds documentation for all gems on current branch (assumes main)"
task :build_master do
DevsiteBuilder.new(__dir__).build_master
end
Expand All @@ -147,7 +147,7 @@ namespace :docs do
DevsiteBuilder.new(__dir__).rebuild_tag(tag)
end

desc "Builds documentation for all tags and current branch (assumes master)"
desc "Builds documentation for all tags and current branch (assumes main)"
task :republish_all do
DevsiteBuilder.new(__dir__).republish_all
end
Expand Down Expand Up @@ -350,7 +350,7 @@ task :changes, [:gem] do |t, args|
valid_gems.each do |gem|
begin
tag = current_release_tag gem
stats = (`git diff --stat #{tag}..master #{gem}`).split("\n")
stats = (`git diff --stat #{tag}..main #{gem}`).split("\n")
if stats.empty?
puts "#{gem}: no changes"
else
Expand All @@ -368,7 +368,7 @@ namespace :changes do
valid_gems.each do |gem|
begin
tag = current_release_tag gem
stats = (`git diff --stat #{tag}..master #{gem}/lib`).split("\n")
stats = (`git diff --stat #{tag}..main #{gem}/lib`).split("\n")
if stats.empty?
puts "#{gem}: no changes in lib"
else
Expand All @@ -384,14 +384,14 @@ namespace :changes do
task :diff, [:gem] do |t, args|
gem = args[:gem]
tag = current_release_tag gem
sh "git diff #{tag}..master #{gem}"
sh "git diff #{tag}..main #{gem}"
end

desc "Print the logs of changes since the last release."
task :log, [:gem] do |t, args|
gem = args[:gem]
tag = current_release_tag gem
sh "git log #{tag}..master #{gem}"
sh "git log #{tag}..main #{gem}"
end

desc "Print the stats of changes since the last release."
Expand All @@ -402,7 +402,7 @@ namespace :changes do
begin
header gem
tag = current_release_tag gem
sh "git diff --stat #{tag}..master #{gem}"
sh "git diff --stat #{tag}..main #{gem}"
rescue => e
puts e
end
Expand All @@ -417,7 +417,7 @@ namespace :changes do
begin
header gem
tag = current_release_tag gem
sh "git log --pretty=format:\"%h%x09%an%x09%ad%x09%s\" --date=relative #{tag}..master #{gem}"
sh "git log --pretty=format:\"%h%x09%an%x09%ad%x09%s\" --date=relative #{tag}..main #{gem}"
rescue => e
puts e
end
Expand All @@ -431,7 +431,7 @@ namespace :changes do
end

def oldest_commit_since_release gem, tag
commit_dates = (`git log --pretty=format:\"%ad\" --date=relative #{tag}..master #{gem}`).split("\n")
commit_dates = (`git log --pretty=format:\"%ad\" --date=relative #{tag}..main #{gem}`).split("\n")
commit_dates.last
end
end
Expand Down Expand Up @@ -661,7 +661,7 @@ end

# Returns [gem_name, gem_version]
def split_tag str
return [nil, str] if str == "master" # Support use of "master" even without gem name
return [nil, str] if str == "main" # Support use of "main" even without gem name
fail "'tag' must be in the format <gem>/<version> Actual: #{str}" unless str.include?("/")
parts = str.split("/")
fail "'tag' must be in the format <gem>/<version>. Actual: #{str}" unless parts.length == 2
Expand Down
2 changes: 1 addition & 1 deletion rakelib/kokoro/kokoro.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def nightly

def post
job_info
git_commit = ENV.fetch "KOKORO_GITHUB_COMMIT", "master"
git_commit = ENV.fetch "KOKORO_GITHUB_COMMIT", "main"

markdown_files = Dir.glob "**/*.md"
broken_markdown_links = check_links markdown_files,
Expand Down

0 comments on commit d473d30

Please sign in to comment.