Skip to content

Commit 51847c4

Browse files
authored
Change branch master to main (#128)
1 parent bb59c62 commit 51847c4

17 files changed

+104
-90
lines changed

.ci/inc/fetch_ci_scripts.bash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function fetch_ci_scripts() {
44
local inc_dir
55
local inc_url
66
inc_dir="$(dirname "$0")/inc"
7-
inc_url="${PMD_CI_SCRIPTS_URL:-https://raw.githubusercontent.com/pmd/build-tools/master/scripts}/inc"
7+
inc_url="${PMD_CI_SCRIPTS_URL:-https://raw.githubusercontent.com/pmd/build-tools/main/scripts}/inc"
88

99
mkdir -p "${inc_dir}"
1010

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
- master
87
tags:
98
- '**'
109
pull_request:
@@ -40,7 +39,7 @@ jobs:
4039
run: |
4140
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
4241
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3" >> $GITHUB_ENV
43-
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV
42+
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/26/scripts" >> $GITHUB_ENV
4443
- name: Check Environment
4544
shell: bash
4645
run: |

.github/workflows/manual-integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: |
3333
echo "LANG=en_US.UTF-8" >> $GITHUB_ENV
3434
echo "MAVEN_OPTS=-Dmaven.wagon.httpconnectionManager.ttlSeconds=180 -Dmaven.wagon.http.retryHandler.count=3" >> $GITHUB_ENV
35-
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/master/scripts" >> $GITHUB_ENV
35+
echo "PMD_CI_SCRIPTS_URL=https://raw.githubusercontent.com/pmd/build-tools/main/scripts" >> $GITHUB_ENV
3636
- name: Check Environment
3737
shell: bash
3838
run: |

History.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
## New and Noteworthy
44

5+
#### New Git default branch - "main"
6+
7+
We are joining the Git community and updating "master" to "main". Using the term "master" for the main
8+
development branch can be offensive to some people. Existing versions of Git have been always capable of
9+
working with any branch name and since 2.28.0 (July 2020) the default initial branch is configurable
10+
(`init.defaultBranch`). Since October 2020, the default branch for new repositories on GitHub
11+
is "main". Finally, PMD will also use this new name for the main branch in all our own repositories.
12+
13+
Note: The regression tester will also use branch `main` by default now for fetching repositories from the list of
14+
projects. You might need to add `<tag>master</tag>` for some projects.
15+
516
## Enhancements
617
* [#123](https://github.com/pmd/pmd-regression-tester/pull/123): Support ruby 3.3.0
718
* [#125](https://github.com/pmd/pmd-regression-tester/pull/125): Update rubocop configuration

README.rdoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ home :: https://pmd.github.io
44
code :: https://github.com/pmd/pmd-regression-tester
55
bugs :: https://github.com/pmd/pmd-regression-tester/issues
66

7-
build-status :: {<img src="https://github.com/pmd/pmd-regression-tester/workflows/build/badge.svg?branch=master" alt="Build Status" />}[https://github.com/pmd/pmd-regression-tester/actions?query=workflow%3Abuild]
7+
build-status :: {<img src="https://github.com/pmd/pmd-regression-tester/workflows/build/badge.svg?branch=main" alt="Build Status" />}[https://github.com/pmd/pmd-regression-tester/actions?query=workflow%3Abuild]
88

99
gem-version :: {<img src="https://badge.fury.io/rb/pmdtester.svg" alt="Gem Version" />}[https://rubygems.org/gems/pmdtester]
1010

@@ -29,9 +29,9 @@ on a list of standard projects(Spring Framework, Hibernate, Solr, etc.)
2929
-l, --list-of-project path to the file which contains the list of standard projects
3030
-m, --mode the mode of the tool: 'local', 'online' or 'single'
3131
single: Set this option to 'single' if your patch branch contains changes
32-
for any option that can't work on master/base branch
32+
for any option that can't work on main/base branch
3333
online: Set this option to 'online' if you want to download
34-
the PMD report of master/base branch rather than generating it locally
34+
the PMD report of main/base branch rather than generating it locally
3535
local: Default option is 'local', PMD reports for the base and patch branches are generated locally.
3636

3737
-t, --threads Sets the number of threads used by PMD. Set threads to 0 to disable multi-threading processing.
@@ -49,15 +49,15 @@ on a list of standard projects(Spring Framework, Hibernate, Solr, etc.)
4949

5050
==== Run local mode
5151

52-
pmdtester -b master -p YOUR_DEVELOPMENT_BRANCH -r PATH_TO_LOCAL_PMD_REPO -a
52+
pmdtester -b main -p YOUR_DEVELOPMENT_BRANCH -r PATH_TO_LOCAL_PMD_REPO -a
5353

5454
==== Run single mode
5555

5656
pmdtester -p YOUR_DEVELOPMENT_BRANCH -pc CONFIG_ONLY_CONTAINS_NEW_PMD_JAVA_RULE -m single
5757

5858
==== Run online mode
5959

60-
pmdtester -b master -p YOUR_DEVELOPMENT_BRANCH -r PATH_TO_LOCAL_PMD_REPO -m online -a
60+
pmdtester -b main -p YOUR_DEVELOPMENT_BRANCH -r PATH_TO_LOCAL_PMD_REPO -m online -a
6161

6262
=== Output
6363
The tool creates the following folders:
@@ -159,7 +159,7 @@ The tool creates the following folders:
159159
* Update History.md and lib/pmdtester.rb for the next development version,
160160
run again "bundle exec rake verify"
161161
* Commit ("Prepare next development version x.y.z-SNAPSHOT").
162-
* Push to master.
162+
* Push to main.
163163
* Push the tag. Github Actions will build and publish the new gem
164164
* A github release is automatically created, verify it on https://github.com/pmd/pmd-regression-tester/releases
165165
* To make pmd's main CI use the new version (in [pmd/pmd](https://github.com/pmd/pmd/)), go to the root directory and run `bundle lock --update`. Commit these changes.

lib/pmdtester/builders/pmd_report_builder.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,13 @@ def initialize(projects, options, branch_config, branch_name)
2525
def get_pmd_binary_file
2626
logger.info "#{@pmd_branch_name}: Start packaging PMD"
2727
Dir.chdir(@local_git_repo) do
28-
build_branch_sha = Cmd.execute_successfully("git rev-parse #{@pmd_branch_name}^{commit}")
29-
3028
checkout_build_branch # needs a clean working tree, otherwise fails
3129

30+
# first checkout the build branch - that might create a local branch from remote, if
31+
# a local branch doesn't exist yet. The following "git rev-parse" command only works
32+
# for local branches.
33+
build_branch_sha = Cmd.execute_successfully("git rev-parse #{@pmd_branch_name}^{commit}")
34+
3235
raise "Wrong branch #{get_last_commit_sha}" unless build_branch_sha == get_last_commit_sha
3336

3437
distro_path = saved_distro_path(build_branch_sha)

lib/pmdtester/parsers/options.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ def parse(argv)
7575
mode_message = <<-DOC
7676
the mode of the tool: 'local', 'online' or 'single'
7777
single: Set this option to 'single' if your patch branch contains changes
78-
for any option that can't work on master/base branch
78+
for any option that can't work on main/base branch
7979
online: Set this option to 'online' if you want to download
80-
the PMD report of master/base branch rather than generating it locally
80+
the PMD report of main/base branch rather than generating it locally
8181
local: Default option is 'local', PMD reports for the base and patch branches are generated locally.
8282
DOC
8383

lib/pmdtester/project.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def initialize(project) # rubocop:disable Metrics/CyclomaticComplexity, Metrics/
2828
@type = project.at_xpath('type').text
2929
@connection = project.at_xpath('connection').text
3030

31-
@tag = project.at_xpath('tag')&.text || 'master'
31+
@tag = project.at_xpath('tag')&.text || 'main'
3232

3333
webview_url_element = project.at_xpath('webview-url')
3434
@webview_url = default_webview_url

test/integration_test_pmd_report_builder.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ def setup
1010
`rake clean`
1111
end
1212

13-
# Tests whether we can build successfully PMD from the sources of the master branch.
14-
# The master branch should always be buildable by the regression tester. For older
13+
# Tests whether we can build successfully PMD from the sources of the main branch.
14+
# The main branch should always be buildable by the regression tester. For older
1515
# versions, we can rely on baselines.
1616
#
1717
# Note 1: Although a base branch is configured here, this is not used. Only the patch
1818
# branch is built.
1919
# Note 2: We use a limited set of projects and rules, to make the test faster.
20-
def test_build_master_branch
20+
def test_build_main_branch
2121
argv = ['-r', 'target/repositories/pmd',
2222
'-b', 'pmd_releases/6.55.0',
23-
'-p', 'master',
23+
'-p', 'main',
2424
'-c', 'test/resources/integration_test_pmd_report_builder/pmd7-config.xml',
2525
'-l', 'test/resources/integration_test_pmd_report_builder/project-test.xml',
2626
'--error-recovery',
@@ -34,6 +34,6 @@ def test_build_master_branch
3434
builder.build
3535

3636
assert_equal(0, $CHILD_STATUS.exitstatus)
37-
assert_path_exist('target/reports/master/checkstyle/pmd_report.xml')
37+
assert_path_exist('target/reports/main/checkstyle/pmd_report.xml')
3838
end
3939
end

test/integration_test_runner.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ def setup
1010

1111
def test_local_mode
1212
argv = '-r target/repositories/pmd -b pmd_releases/6.41.0 -bc config/design.xml ' \
13-
'-p master -pc config/design.xml -l test/resources/integration_test_runner/project-test.xml ' \
13+
'-p main -pc config/design.xml -l test/resources/integration_test_runner/project-test.xml ' \
1414
'--threads ' + Etc.nprocessors.to_s
1515

1616
system("bundle exec bin/pmdtester #{argv}")
1717

1818
assert_equal(0, $CHILD_STATUS.exitstatus)
19-
assert_path_exist('target/reports/master/checkstyle/pmd_report.xml')
20-
assert_path_exist('target/reports/master/pmd/pmd_report.xml')
19+
assert_path_exist('target/reports/main/checkstyle/pmd_report.xml')
20+
assert_path_exist('target/reports/main/pmd/pmd_report.xml')
2121
assert_path_exist('target/reports/pmd_releases_6.41.0/checkstyle/pmd_report.xml')
2222
assert_path_exist('target/reports/pmd_releases_6.41.0/checkstyle/config.xml')
2323
assert_path_exist('target/reports/pmd_releases_6.41.0/pmd/pmd_report.xml')

0 commit comments

Comments
 (0)