Skip to content

Commit 79a6e24

Browse files
authored
chore: rename default branch to main MONGOSH-245 (#821)
1 parent fed2e87 commit 79a6e24

File tree

11 files changed

+35
-37
lines changed

11 files changed

+35
-37
lines changed

.github/workflows/cron-tasks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
on:
2-
# Once a week or on pushes to master
2+
# Once a week or on pushes to main
33
schedule:
44
- cron: "0 3 * * 0"
55
push:
66
branches:
7-
- master
7+
- main
88

99
jobs:
1010
update_third_party_notices_and_authors:

packages/build/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ Execute the following steps to publish a new release:
3737
Follow the instructions and verify the inferred release version is correct.
3838
6. Wait for Evergreen to finish the publication stage.
3939
7. Close the Jira ticket for the release, post an update in the `#mongosh` Slack channel and ping the docs team.
40-
40+
4141

4242
### Branches and Tags
43-
Typically, a release is always created from the main branch (currently `master`). The only exception are _patch releases_, i.e. when we need to fix an issue for an already published, already superseeded release. Patch releases are created from _release branches_ that match the following pattern:
43+
Typically, a release is always created from the main branch (currently `main`). The only exception are _patch releases_, i.e. when we need to fix an issue for an already published, already superseeded release. Patch releases are created from _release branches_ that match the following pattern:
4444
```
4545
release/v[0-9]+\.[a-zA-Z0-9]+\.[a-zA-Z0-9]+
4646
```
@@ -56,7 +56,7 @@ See the following image for a general overview on how we handle these branches a
5656
We use two different types of tags for the automated release process: draft and release tags. A release tag has the form `v<major>.<minor>.<patch>`, e.g. `v0.8.0`. A draft tag is `v<major>.<minor>.<patch>-draft.<draft>`, e.g. `v0.8.0-draft.0`.
5757

5858
Draft tags are used to trigger the automated release process. Every draft tag in the end leads to the generation of _potentially_ distributable packages with compiled binaries.
59-
59+
6060
Release tags are used to trigger the publication of a release and its corresponding distributable packages. A release tag must referenced the commit with the most recent draft tag for that release version (example: `v0.8.0` must reference the commit with the highest `v0.8.0-draft.x` tag).
6161

6262
The automated release process for publication of a release will re-use the compiled binaries and packages that were created in the most recent draft tag. Thus, every release tag requires a prior draft tag to be present. The release automation process is handled by [Evergreen](#evergreen-ci).
@@ -69,7 +69,7 @@ For full details on the project's configuration see the Evergreen configuration
6969
### Evergreen Triggers
7070
Evergreen builds and _patches_ are triggered in multiple ways. The Mongo Shell project is setup to be triggered by:
7171

72-
* New commits on the main branch (currently `master`, i.e. _waterfall builds_
72+
* New commits on the main branch (currently `main`, i.e. _waterfall builds_
7373
* New Pull Requests against the main branch on GitHub (i.e. _patches_)
7474
* A new tag matching `v0.0.0-draft.0` is pushed on the main or a release branch (i.e. a draft build is triggered)
7575
* A new tag matching `v0.0.0` is pushed on the main or a release branch (i.e. a release is to be published)
@@ -116,7 +116,7 @@ The _Publish_ stage is independent from all other stages. As mentioned at the be
116116
## Package Structure
117117

118118
The package has two major purposes:
119-
* Custom build commands to handle the stages outlined above
119+
* Custom build commands to handle the stages outlined above
120120
* Provide easy helpers to trigger the release process
121121

122122
See [index.ts](./src/index.ts) for the main entry point on the different commands.

packages/build/branches-and-tags.svg

Lines changed: 1 addition & 1 deletion
Loading

packages/build/src/config/should-do-public-release.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@ describe('shouldDoPublicRelease', () => {
99
});
1010

1111

12-
it('returns false when branch is not master', async() => {
12+
it('returns false when branch is not main', async() => {
1313
const config: Partial<Config> = { branch: 'feature' };
1414
expect(shouldDoPublicRelease(config as any)).to.be.false;
1515
});
1616

17-
it('returns false when branch is master but not tagged', async() => {
18-
const config: Partial<Config> = { branch: 'master' };
17+
it('returns false when branch is main but not tagged', async() => {
18+
const config: Partial<Config> = { branch: 'main' };
1919
expect(shouldDoPublicRelease(config as any)).to.be.false;
2020
});
2121

2222
it('returns false when current version does not match draft commit tag', async() => {
23-
const config: Partial<Config> = { branch: 'master', triggeringGitTag: 'v0.0.4-draft.0', version: '0.0.4' };
23+
const config: Partial<Config> = { branch: 'main', triggeringGitTag: 'v0.0.4-draft.0', version: '0.0.4' };
2424
expect(shouldDoPublicRelease(config as any)).to.be.false;
2525
});
2626

2727
it('returns false when current version does not match release commit tag', async() => {
28-
const config: Partial<Config> = { branch: 'master', triggeringGitTag: 'v0.0.5', version: '0.0.4' };
28+
const config: Partial<Config> = { branch: 'main', triggeringGitTag: 'v0.0.5', version: '0.0.4' };
2929
expect(shouldDoPublicRelease(config as any)).to.be.false;
3030
});
3131

3232
it('returns true when version matches commit tag', async() => {
33-
const config: Partial<Config> = { branch: 'master', triggeringGitTag: 'v0.0.3', version: '0.0.3' };
33+
const config: Partial<Config> = { branch: 'main', triggeringGitTag: 'v0.0.3', version: '0.0.3' };
3434
expect(shouldDoPublicRelease(config as any)).to.be.true;
3535
});
3636
});

packages/build/src/config/should-do-public-release.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export function shouldDoPublicRelease(config: Config): boolean {
1717
return false;
1818
}
1919

20-
if (config.branch !== 'master') {
21-
console.info('mongosh: skip public release: is not master');
20+
if (config.branch !== 'main') {
21+
console.info('mongosh: skip public release: is not main');
2222
return false;
2323
}
2424

packages/build/src/git/repository-status.spec.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ describe('git repository-status', () => {
184184
it('detectes pending file changes', () => {
185185
spawnSync.onFirstCall().returns({
186186
stdout: [
187-
'## master...origin/master',
187+
'## main...origin/main',
188188
'A packages/build/src/helpers/index.ts',
189189
'A packages/build/src/helpers/spawn-sync.spec.ts',
190190
'?? packages/build/src/helpers/test',
@@ -197,8 +197,8 @@ describe('git repository-status', () => {
197197
const status = getRepositoryStatus('somePath', spawnSync);
198198
expect(status).to.deep.equal({
199199
branch: {
200-
local: 'master',
201-
tracking: 'origin/master',
200+
local: 'main',
201+
tracking: 'origin/main',
202202
diverged: false
203203
},
204204
clean: false,
@@ -209,7 +209,7 @@ describe('git repository-status', () => {
209209
it('detectes diverging branches', () => {
210210
spawnSync.returns({
211211
stdout: [
212-
'## master...origin/something [ahead 5, behind 3]',
212+
'## main...origin/something [ahead 5, behind 3]',
213213
'A packages/build/src/helpers/index.ts',
214214
'A packages/build/src/helpers/spawn-sync.spec.ts',
215215
'?? packages/build/src/helpers/test',
@@ -222,7 +222,7 @@ describe('git repository-status', () => {
222222
const status = getRepositoryStatus('somePath', spawnSync);
223223
expect(status).to.deep.equal({
224224
branch: {
225-
local: 'master',
225+
local: 'main',
226226
tracking: 'origin/something',
227227
diverged: true
228228
},
@@ -234,7 +234,7 @@ describe('git repository-status', () => {
234234
it('detectes missing origin', () => {
235235
spawnSync.returns({
236236
stdout: [
237-
'## master'
237+
'## main'
238238
].join('\n')
239239
});
240240
spawnSync.onSecondCall().returns({
@@ -244,7 +244,7 @@ describe('git repository-status', () => {
244244
const status = getRepositoryStatus('somePath', spawnSync);
245245
expect(status).to.deep.equal({
246246
branch: {
247-
local: 'master',
247+
local: 'main',
248248
tracking: undefined,
249249
diverged: false
250250
},
@@ -256,7 +256,7 @@ describe('git repository-status', () => {
256256
it('detects unpushed tags', () => {
257257
spawnSync.onFirstCall().returns({
258258
stdout: [
259-
'## master...origin/master'
259+
'## main...origin/main'
260260
].join('\n')
261261
});
262262
spawnSync.onSecondCall().returns({
@@ -269,8 +269,8 @@ describe('git repository-status', () => {
269269
const status = getRepositoryStatus('somePath', spawnSync);
270270
expect(status).to.deep.equal({
271271
branch: {
272-
local: 'master',
273-
tracking: 'origin/master',
272+
local: 'main',
273+
tracking: 'origin/main',
274274
diverged: false
275275
},
276276
clean: true,
@@ -299,7 +299,7 @@ describe('git repository-status', () => {
299299
});
300300

301301
it('returns undefined for non-release branches', () => {
302-
const version = getReleaseVersionFromBranch('master');
302+
const version = getReleaseVersionFromBranch('main');
303303
expect(version).to.be.undefined;
304304
});
305305
});

packages/build/src/local/trigger-release-draft.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ describe('local trigger-release-draft', () => {
1313

1414
const cleanRepoStatus: RepositoryStatus = {
1515
branch: {
16-
local: 'master',
17-
tracking: 'origin/master',
16+
local: 'main',
17+
tracking: 'origin/main',
1818
diverged: false
1919
},
2020
clean: true,
@@ -59,7 +59,7 @@ describe('local trigger-release-draft', () => {
5959
expect(spawnSync.getCall(1)).calledWith('git', ['push', 'origin', 'v0.8.0-draft.8'], sinon.match.any);
6060
});
6161

62-
it('asks for the bump type and pushes a new draft if previous tag was a release on master', async() => {
62+
it('asks for the bump type and pushes a new draft if previous tag was a release on main', async() => {
6363
const latestTag: TaggedCommit = {
6464
commit: 'hash',
6565
tag: {

packages/cli-repl/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# @mongosh/cli-repl [![Build Status][azure-build-url]][azure-build]
1+
# @mongosh/cli-repl
22

33
[Evergreen Build][evergreen-url]
44

@@ -252,8 +252,6 @@ npm install --save @mongosh/cli-repl
252252
```
253253
254254
[mongosh]: https://github.com/mongodb-js/mongosh
255-
[azure-build-url]: https://dev.azure.com/team-compass/mongosh/_apis/build/status/mongodb-js.mongosh?branchName=master
256-
[azure-build]: https://dev.azure.com/team-compass/mongosh/_build/latest?definitionId=5&branchName=master
257255
[evergreen-url]: https://evergreen.mongodb.com/waterfall/mongosh
258256
[pino-js]: https://github.com/pinojs/pino
259257
[object-id]: https://docs.mongodb.com/manual/reference/method/ObjectId/

packages/types/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0-dev.0",
44
"description": "Types for mongosh internals",
55
"author": "Anna Henningsen <[email protected]>",
6-
"homepage": "https://github.com/mongodb-js/mongosh/tree/master/packages/types#readme",
6+
"homepage": "https://github.com/mongodb-js/mongosh/tree/main/packages/types#readme",
77
"license": "Apache-2.0",
88
"main": "lib/index.js",
99
"types": "lib/index.d.ts",

scripts/docker/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Docker test images
22

3-
This folder contains scripts and Dockerfiles to test the master build of mongosh on different linux distributions.
3+
This folder contains scripts and Dockerfiles to test the main branch build of mongosh on different linux distributions.
44

55
## Usage
66

@@ -10,4 +10,4 @@ bash scripts/docker/build.sh centos8-rpm
1010

1111
```
1212
bash scripts/docker/run.sh centos8-rpm arg1 arg2 ...
13-
```
13+
```

0 commit comments

Comments
 (0)