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

Rename Solidus default branch to main #5042

Merged
merged 2 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ commands:
keys:
- solidus-gems-v3-{{checksum ".ruby-version"}}-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- solidus-gems-v3-{{checksum ".ruby-version"}}-{{ .Branch }}
- solidus-gems-v3-{{checksum ".ruby-version"}}-master
- solidus-gems-v3-{{checksum ".ruby-version"}}-main
- solidus-gems-v3-{{checksum ".ruby-version"}}

- run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/prepare_post_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Prepare post-release"
on:
pull_request:
branches:
- master
- main
- v*
types:
- closed
Expand Down Expand Up @@ -31,17 +31,17 @@ jobs:
cd dev_tools/ && bin/bump-to-dev-version \
${{ steps.pipeline_context.outputs.next_candidate_dev_version }}
- name: "Bump previous solidus minor version"
if: github.ref_name == 'master'
if: github.ref_name == 'main'
run: |
cd dev_tools/ && bin/bump-previous-minor-version \
${{ steps.pipeline_context.outputs.candidate_minor_version }}
- name: "Bump to the development version in docker-compose"
if: github.ref_name == 'master'
if: github.ref_name == 'main'
run: |
cd dev_tools/ && bin/bump-docker-image-to-dev-version \
${{ steps.pipeline_context.outputs.next_candidate_dev_version }}
- name: "Bump installer starter frontend version"
if: github.ref_name == 'master'
if: github.ref_name == 'main'
run: |
cd dev_tools/ && bin/bump-starter-frontend-version \
main
Expand All @@ -52,14 +52,14 @@ jobs:
${{ github.repository }} \
${{ steps.pipeline_context.outputs.candidate_tag }}
- name: "Create patch branch"
if: github.ref_name == 'master'
if: github.ref_name == 'main'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to backport any of these workflow changes to old versions branches? I'm assuming each branch will use the file they contain to spin up GitHub workflows but I'm not sure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. It won't make a difference, as those branches are not called either master or main, but we can backport the changes for consistency.

env:
GH_TOKEN: ${{ github.token }}
run: |
candidate_patch_branch="${{ steps.pipeline_context.outputs.candidate_patch_branch }}"
git checkout -b $candidate_patch_branch
git push --set-upstream origin $candidate_patch_branch
- name: "Create PR for master"
- name: "Create PR for main"
uses: ./.github/actions/commit_and_submit_pull_request
with:
labels: changelog:skip
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ jobs:
cd dev_tools/ && bin/bump-version \
${{ steps.pipeline_context.outputs.candidate_version }}
- name: "Bump docker image version"
if: github.ref_name == 'master'
if: github.ref_name == 'main'
run: |
cd dev_tools/ && bin/bump-docker-image-version \
${{ steps.pipeline_context.outputs.candidate_version }}
- name: "Bump installer starter frontend version"
if: github.ref_name == 'master'
if: github.ref_name == 'main'
run: |
cd dev_tools/ && bin/bump-starter-frontend-version \
${{ steps.pipeline_context.outputs.candidate_patch_branch }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_release_draft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Update Release Draft on GitHub"
on:
pull_request_target:
branches:
- master
- main
- v*
types:
- closed
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ Spree::Price.where(amount: nil).any?

If the above code returns `false`, you don't need to do anything else.
Otherwise, copy [the
task](https://github.com/solidusio/solidus/blob/master/core/lib/tasks/solidus/delete_prices_with_nil_amount.rake)
task](https://github.com/solidusio/solidus/blob/main/core/lib/tasks/solidus/delete_prices_with_nil_amount.rake)
into your code, and deploy & execute it. Another option is to execute it
manually in your console in production. However, be extremely careful when
doing that!! :warning: :warning: :warning:
Expand Down Expand Up @@ -3417,4 +3417,4 @@ See https://github.com/solidusio/solidus/releases/tag/v1.0.1

## Solidus 1.0.0 (2015-08-11)

See https://github.com/solidusio/solidus/releases/tag/v1.0.0
See https://github.com/solidusio/solidus/releases/tag/v1.0.0
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

# Solidus

[![Circle CI](https://circleci.com/gh/solidusio/solidus/tree/master.svg?style=shield)](https://circleci.com/gh/solidusio/solidus/tree/master)
[![codecov](https://codecov.io/gh/solidusio/solidus/branch/master/graph/badge.svg)](https://codecov.io/gh/solidusio/solidus/branch/master)
[![Circle CI](https://circleci.com/gh/solidusio/solidus/tree/main.svg?style=shield)](https://circleci.com/gh/solidusio/solidus/tree/main)
[![codecov](https://codecov.io/gh/solidusio/solidus/branch/main/graph/badge.svg)](https://codecov.io/gh/solidusio/solidus/branch/main)
[![Gem](https://img.shields.io/gem/v/solidus.svg)](https://rubygems.org/gems/solidus)
[![License](http://img.shields.io/badge/license-BSD-yellowgreen.svg)](LICENSE.md)
[![Reviewed by Hound](https://img.shields.io/badge/Reviewed_by-Hound-8E64B0.svg)](https://houndci.com)
Expand Down
2 changes: 1 addition & 1 deletion core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Solidus system depends.

Core models
-----------
Solidus implements over 200 [models](https://github.com/solidusio/solidus/tree/master/core/app/models/spree),
Solidus implements over 200 [models](https://github.com/solidusio/solidus/tree/main/core/app/models/spree),
and thus a deep inspection of each in this README would be overkill. Instead,
let's take a quick look at the fundamental models upon which all else depend.
Currently, these models remain in the Spree namespace as part of the legacy of
Expand Down
2 changes: 1 addition & 1 deletion core/solidus_core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ $ bin/rails g solidus:update
Please, don't forget to look at the CHANGELOG to see what has changed and
whether you need to perform other tasks.

https://github.com/solidusio/solidus/blob/master/CHANGELOG.md
https://github.com/solidusio/solidus/blob/main/CHANGELOG.md

Please report any issues at:
- https://github.com/solidusio/solidus/issues
Expand Down
2 changes: 1 addition & 1 deletion dev_tools/lib/solidus/pipeline_context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Solidus
#
# @api private
class PipelineContext
MAIN_BRANCH = 'master'
MAIN_BRANCH = 'main'

VERSION_PREFIX = 'v'

Expand Down
26 changes: 13 additions & 13 deletions dev_tools/spec/lib/solidus/pipeline_context_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
it 'ignores tags that do not match a full stable version number' do
context = described_class.new(
tags: %w[v3.0.0 v3.0 v3.0 v3 v3.0.0.beta invalid v.3.0.0],
base_branch: 'master'
base_branch: 'main'
)

expect(context.tags).to eq(['v3.0.0'])
end

it 'raises when tags is empty' do
expect {
described_class.new(tags: [], base_branch: 'master')
described_class.new(tags: [], base_branch: 'main')
}.to raise_error(ArgumentError, 'tags cannot be empty')
end

Expand All @@ -37,7 +37,7 @@
it 'returns the highest tag' do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v2.0.1 v2.0.2 v3.0.0],
base_branch: 'master'
base_branch: 'main'
)

expect(context.current_tag).to eq('v3.0.0')
Expand All @@ -46,7 +46,7 @@
it 'compares tags as versions' do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v3.0.0.alpha v3.0.0],
base_branch: 'master'
base_branch: 'main'
)

expect(context.current_tag).to eq('v3.0.0')
Expand Down Expand Up @@ -81,7 +81,7 @@
it 'returns the current tag adjusted to its first patch version' do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v2.0.1 v2.0.2 v3.0.0 v3.0.1],
base_branch: 'master'
base_branch: 'main'
)

expect(context.current_diff_source_tag).to eq('v3.0.0')
Expand Down Expand Up @@ -118,7 +118,7 @@
it "returns the next minor level tag when not tracking a major release" do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v2.0.1 v2.0.2],
base_branch: 'master',
base_branch: 'main',
tracking_major: false
)

Expand All @@ -128,7 +128,7 @@
it "returns the next major level tag when tracking a major release" do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v2.0.1 v2.0.2],
base_branch: 'master',
base_branch: 'main',
tracking_major: true
)

Expand All @@ -141,7 +141,7 @@
it 'returns the candidate tag without the patch level' do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v2.0.1 v2.0.2],
base_branch: 'master',
base_branch: 'main',
tracking_major: false
)

Expand All @@ -153,7 +153,7 @@
it 'returns the candidate tag without the tag prefix' do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v2.0.1 v2.0.2],
base_branch: 'master',
base_branch: 'main',
tracking_major: false
)

Expand All @@ -165,7 +165,7 @@
it 'returns the candidate version without the patch segment' do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v2.0.1 v2.0.2],
base_branch: 'master',
base_branch: 'main',
tracking_major: false
)

Expand All @@ -190,7 +190,7 @@
it "returns the next minor level version after the candidate when last_minor is false" do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v2.0.1 v2.0.2],
base_branch: 'master',
base_branch: 'main',
tracking_major: false,
last_minor: false
)
Expand All @@ -201,7 +201,7 @@
it "returns the next major level version after the candidate when last_minor is true" do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v2.0.1 v2.0.2],
base_branch: 'master',
base_branch: 'main',
tracking_major: false,
last_minor: true
)
Expand All @@ -215,7 +215,7 @@
it "returns the next candidate tag without the tag prefix and with '.dev' appended" do
context = described_class.new(
tags: %w[v1.0.0 v1.0.1 v1.1.0 v2.0.0 v2.0.1 v2.0.2],
base_branch: 'master',
base_branch: 'main',
tracking_major: false,
last_minor: false
)
Expand Down
12 changes: 6 additions & 6 deletions dev_tools/spec/lib/solidus/release_drafter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,47 +50,47 @@ def add_pr(pr_number:, labels: [])
client.add_pr(pr_number: 1, labels: ['changelog:solidus_core'])

expect(
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'master').content
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'main').content
).to match(/#{Regexp.escape("## Solidus Core\n* PR number 1 by @alice in https://github.com/fake/solidus/pull/1")}/)
end

it 'adds the PR under more than one matching label' do
client.add_pr(pr_number: 1, labels: %w[changelog:solidus_core changelog:solidus_api])

expect(
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'master').content
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'main').content
).to match(/#{Regexp.escape("## Solidus Core\n* PR number 1 by @alice in https://github.com/fake/solidus/pull/1")}.*#{Regexp.escape("## Solidus API\n* PR number 1 by @alice in https://github.com/fake/solidus/pull/1")}/m)
end

it 'ignores if no matching label is present' do
client.add_pr(pr_number: 1, labels: %w[other])

expect(
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'master')
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'main')
).to be(nil)
end

it 'ignores if the skipping label is present' do
client.add_pr(pr_number: 1, labels: %w[changelog:solidus_core changelog:skip])

expect(
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'master')
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'main')
).to be(nil)
end

it 'adds a non-edit warning' do
client.add_pr(pr_number: 1, labels: %w[changelog:solidus_core changelog:solidus_api])

expect(
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'master').content
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'main').content
).to include("don't edit manually")
end

it 'adds a link to the full Changelog' do
client.add_pr(pr_number: 1, labels: %w[changelog:solidus_core changelog:solidus_api])

expect(
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'master').content
subject.call(pr_number: 1, current_diff_source_tag: 'v3.0.0', candidate_tag: 'v3.1.0', branch: 'main').content
).to include("**Full Changelog**: https://github.com/fake/solidus/compare/v3.0.0...v3.1.0")
end
end
Expand Down