Skip to content

Commit e567318

Browse files
authored
Use 'main' when referring to default branch (#84463) (#84530)
1 parent f69a10c commit e567318

File tree

8 files changed

+19
-18
lines changed

8 files changed

+19
-18
lines changed

.ci/jobs.t/elastic+elasticsearch+branch-consistency.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
- job:
33
name: elastic+elasticsearch+%BRANCH%+branch-consistency
44
display-name: "elastic / elasticsearch # %BRANCH% - branch consistency"
5-
description: Testing of the Elasticsearch master branch version consistency.
5+
description: Testing of the Elasticsearch %BRANCH% branch version consistency.
66
triggers:
77
- timed: "H 7 * * *"
88
builders:

.ci/packer_cache.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ else
3131
export JAVA15_HOME="${HOME}"/.java/openjdk15
3232
export JAVA16_HOME="${HOME}"/.java/openjdk16
3333

34-
## 6.8 branch is not referenced from any bwc project in master so we need to
34+
## 6.8 branch is not referenced from any bwc project in main so we need to
3535
## resolve its dependencies explicitly
3636
rm -rf checkout/6.8
3737
git clone --reference $(dirname "${SCRIPT}")/../.git https://github.com/elastic/elasticsearch.git --branch 6.8 --single-branch checkout/6.8
@@ -41,6 +41,6 @@ else
4141
fi
4242

4343
## Gradle is able to resolve dependencies resolved with earlier gradle versions
44-
## therefore we run master _AFTER_ we run 6.8 which uses an earlier gradle version
44+
## therefore we run main _AFTER_ we run 6.8 which uses an earlier gradle version
4545
export JAVA_HOME="${HOME}"/.java/${ES_BUILD_JAVA}
4646
./gradlew --parallel clean -s resolveAllDependencies -Dorg.gradle.warning.mode=none

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/BwcVersions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
* At any point in time there will be at least three such versions and potentially four in the case of a staged release.
4141
* <p>
4242
* <ul>
43-
* <li>the current version on the `master` branch</li>
43+
* <li>the current version on the `main` branch</li>
4444
* <li>the staged next <b>minor</b> on the `M.N` branch</li>
4545
* <li>the unreleased <b>bugfix</b>, `M.N-1` branch</li>
4646
* <li>the unreleased <b>maintenance</b>, M-1.d.e ( d &gt; 0, e &gt; 0) on the `(M-1).d` branch</li>
@@ -54,7 +54,7 @@
5454
* We can reliably figure out which the unreleased versions are due to the convention of always adding the next unreleased
5555
* version number to server in all branches when a version is released.
5656
* E.x when M.N.c is released M.N.c+1 is added to the Version class mentioned above in all the following branches:
57-
* `M.N`, and `master` so we can reliably assume that the leafs of the version tree are unreleased.
57+
* `M.N`, and `main` so we can reliably assume that the leafs of the version tree are unreleased.
5858
* This convention is enforced by checking the versions we consider to be unreleased against an
5959
* authoritative source (maven central).
6060
* We are then able to map the unreleased version to branches in git and Gradle projects that are capable of checking
@@ -133,8 +133,8 @@ public void forPreviousUnreleased(Consumer<UnreleasedVersionInfo> consumer) {
133133

134134
private String getBranchFor(Version version) {
135135
if (version.equals(currentVersion.elasticsearch)) {
136-
// Just assume the current branch is 'master'. It's actually not important, we never check out the current branch.
137-
return "master";
136+
// Just assume the current branch is 'main'. It's actually not important, we never check out the current branch.
137+
return "main";
138138
} else {
139139
return version.getMajor() + "." + version.getMinor();
140140
}

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/DependenciesInfoTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ protected String getLicenseType(final String group, final String name) throws IO
196196
if (licenseInfo.spdxLicense() == false) {
197197
// License has not be identified as SPDX.
198198
// As we have the license file, we create a Custom entry with the URL to this license file.
199-
final String gitBranch = System.getProperty("build.branch", "master");
199+
final String gitBranch = System.getProperty("build.branch", "main");
200200
final String githubBaseURL = "https://raw.githubusercontent.com/elastic/elasticsearch/" + gitBranch + "/";
201201
licenseType = licenseInfo.identifier()
202202
+ ";"

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/InternalDistributionBwcSetupPlugin.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,9 +235,10 @@ static void createBuildBwcTask(
235235
} else {
236236
c.getOutputs().files(expectedOutputFile);
237237
}
238-
c.getOutputs().cacheIf("BWC distribution caching is disabled on 'master' branch", task -> {
238+
c.getOutputs().cacheIf("BWC distribution caching is disabled on 'main' branch", task -> {
239239
String gitBranch = System.getenv("GIT_BRANCH");
240-
return BuildParams.isCi() && (gitBranch == null || gitBranch.endsWith("master") == false);
240+
return BuildParams.isCi()
241+
&& (gitBranch == null || gitBranch.endsWith("master") == false || gitBranch.endsWith("main") == false);
241242
});
242243
c.args(projectPath.replace('/', ':') + ":" + assembleTaskName);
243244
if (project.getGradle().getStartParameter().isBuildCacheEnabled()) {

build-tools-internal/src/main/resources/changelog-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://github.com/elastic/elasticsearch/tree/master/docs/changelog",
3+
"$id": "https://github.com/elastic/elasticsearch/tree/main/docs/changelog",
44
"$ref": "#/definitions/Changelog",
55
"definitions": {
66
"Changelog": {

build-tools-internal/src/test/groovy/org/elasticsearch/gradle/internal/BwcVersionsSpec.groovy

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class BwcVersionsSpec extends Specification {
4141
(v('7.16.2')): new UnreleasedVersionInfo(v('7.16.2'), '7.16', ':distribution:bwc:bugfix'),
4242
(v('7.17.0')): new UnreleasedVersionInfo(v('7.17.0'), '7.17', ':distribution:bwc:staged'),
4343
(v('8.0.0')): new UnreleasedVersionInfo(v('8.0.0'), '8.0', ':distribution:bwc:minor'),
44-
(v('8.1.0')): new UnreleasedVersionInfo(v('8.1.0'), 'master', ':distribution')
44+
(v('8.1.0')): new UnreleasedVersionInfo(v('8.1.0'), 'main', ':distribution')
4545
]
4646
bwc.wireCompatible == [v('7.17.0'), v('8.0.0'), v('8.1.0')]
4747
bwc.indexCompatible == [v('7.14.0'), v('7.14.1'), v('7.14.2'), v('7.15.0'), v('7.15.1'), v('7.15.2'), v('7.16.0'), v('7.16.1'), v('7.16.2'), v('7.17.0'), v('8.0.0'), v('8.1.0')]
@@ -70,7 +70,7 @@ class BwcVersionsSpec extends Specification {
7070
(v('7.16.1')): new UnreleasedVersionInfo(v('7.16.1'), '7.16', ':distribution:bwc:bugfix'),
7171
(v('7.17.0')): new UnreleasedVersionInfo(v('7.17.0'), '7.17', ':distribution:bwc:staged'),
7272
(v('8.0.0')): new UnreleasedVersionInfo(v('8.0.0'), '8.0', ':distribution:bwc:minor'),
73-
(v('8.1.0')): new UnreleasedVersionInfo(v('8.1.0'), 'master', ':distribution')
73+
(v('8.1.0')): new UnreleasedVersionInfo(v('8.1.0'), 'main', ':distribution')
7474
]
7575
bwc.wireCompatible == [v('7.17.0'), v('8.0.0'), v('8.1.0')]
7676
bwc.indexCompatible == [v('7.14.0'), v('7.14.1'), v('7.14.2'), v('7.15.0'), v('7.15.1'), v('7.15.2'), v('7.16.0'), v('7.16.1'), v('7.17.0'), v('8.0.0'), v('8.1.0')]
@@ -99,7 +99,7 @@ class BwcVersionsSpec extends Specification {
9999
unreleased == [
100100
(v('7.17.1')): new UnreleasedVersionInfo(v('7.17.1'), '7.17', ':distribution:bwc:bugfix'),
101101
(v('8.0.0')): new UnreleasedVersionInfo(v('8.0.0'), '8.0', ':distribution:bwc:staged'),
102-
(v('8.1.0')): new UnreleasedVersionInfo(v('8.1.0'), 'master', ':distribution')
102+
(v('8.1.0')): new UnreleasedVersionInfo(v('8.1.0'), 'main', ':distribution')
103103
]
104104
bwc.wireCompatible == [v('7.17.0'), v('7.17.1'), v('8.0.0'), v('8.1.0')]
105105
bwc.indexCompatible == [v('7.14.0'), v('7.14.1'), v('7.14.2'), v('7.15.0'), v('7.15.1'), v('7.15.2'), v('7.16.0'), v('7.16.1'), v('7.17.0'), v('7.17.1'), v('8.0.0'), v('8.1.0')]
@@ -126,7 +126,7 @@ class BwcVersionsSpec extends Specification {
126126
then:
127127
unreleased == [
128128
(v('7.17.1')): new UnreleasedVersionInfo(v('7.17.1'), '7.17', ':distribution:bwc:bugfix'),
129-
(v('8.0.0')): new UnreleasedVersionInfo(v('8.0.0'), 'master', ':distribution'),
129+
(v('8.0.0')): new UnreleasedVersionInfo(v('8.0.0'), 'main', ':distribution'),
130130
]
131131
bwc.wireCompatible == [v('7.17.0'), v('7.17.1'), v('8.0.0')]
132132
bwc.indexCompatible == [v('7.14.0'), v('7.14.1'), v('7.14.2'), v('7.15.0'), v('7.15.1'), v('7.15.2'), v('7.16.0'), v('7.16.1'), v('7.17.0'), v('7.17.1'), v('8.0.0')]
@@ -154,7 +154,7 @@ class BwcVersionsSpec extends Specification {
154154
then:
155155
unreleased == [
156156
(v('7.17.1')): new UnreleasedVersionInfo(v('7.17.1'), '7.17', ':distribution:bwc:maintenance'),
157-
(v('8.0.1')): new UnreleasedVersionInfo(v('8.0.1'), 'master', ':distribution'),
157+
(v('8.0.1')): new UnreleasedVersionInfo(v('8.0.1'), 'main', ':distribution'),
158158
]
159159
bwc.wireCompatible == [v('7.17.0'), v('7.17.1'), v('8.0.0'), v('8.0.1')]
160160
bwc.indexCompatible == [v('7.14.0'), v('7.14.1'), v('7.14.2'), v('7.15.0'), v('7.15.1'), v('7.15.2'), v('7.16.0'), v('7.16.1'), v('7.17.0'), v('7.17.1'), v('8.0.0'), v('8.0.1')]
@@ -184,7 +184,7 @@ class BwcVersionsSpec extends Specification {
184184
unreleased == [
185185
(v('7.17.1')): new UnreleasedVersionInfo(v('7.17.1'), '7.17', ':distribution:bwc:maintenance'),
186186
(v('8.0.1')): new UnreleasedVersionInfo(v('8.0.1'), '8.0', ':distribution:bwc:bugfix'),
187-
(v('8.1.0')): new UnreleasedVersionInfo(v('8.1.0'), 'master', ':distribution')
187+
(v('8.1.0')): new UnreleasedVersionInfo(v('8.1.0'), 'main', ':distribution')
188188
]
189189
bwc.wireCompatible == [v('7.17.0'), v('7.17.1'), v('8.0.0'), v('8.0.1'), v('8.1.0')]
190190
bwc.indexCompatible == [v('7.14.0'), v('7.14.1'), v('7.14.2'), v('7.15.0'), v('7.15.1'), v('7.15.2'), v('7.16.0'), v('7.16.1'), v('7.17.0'), v('7.17.1'), v('8.0.0'), v('8.0.1'), v('8.1.0')]

distribution/bwc/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ BuildParams.getBwcVersions().forPreviousUnreleased { unreleasedVersion ->
1919
t -> t.args("resolveAllDependencies", "-Dorg.gradle.warning.mode=none")
2020
}
2121
if (currentVersion.getMinor() == 0 && currentVersion.getRevision() == 0) {
22-
// We only want to resolve dependencies for live versions of master, without cascading this to older versions
22+
// We only want to resolve dependencies for live versions of main, without cascading this to older versions
2323
tasks.named("resolveAllDependencies").configure {
2424
dependsOn(resolveAllBwcDepsTaskProvider)
2525
}

0 commit comments

Comments
 (0)