Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/cron-tasks.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
on:
# Once a week or on pushes to master
# Once a week or on pushes to main
schedule:
- cron: "0 3 * * 0"
push:
branches:
- master
- main

jobs:
update_third_party_notices_and_authors:
Expand Down
10 changes: 5 additions & 5 deletions packages/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ Execute the following steps to publish a new release:
Follow the instructions and verify the inferred release version is correct.
6. Wait for Evergreen to finish the publication stage.
7. Close the Jira ticket for the release, post an update in the `#mongosh` Slack channel and ping the docs team.


### Branches and Tags
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:
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:
```
release/v[0-9]+\.[a-zA-Z0-9]+\.[a-zA-Z0-9]+
```
Expand All @@ -56,7 +56,7 @@ See the following image for a general overview on how we handle these branches a
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`.

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.

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).

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).
Expand All @@ -69,7 +69,7 @@ For full details on the project's configuration see the Evergreen configuration
### Evergreen Triggers
Evergreen builds and _patches_ are triggered in multiple ways. The Mongo Shell project is setup to be triggered by:

* New commits on the main branch (currently `master`, i.e. _waterfall builds_
* New commits on the main branch (currently `main`, i.e. _waterfall builds_
* New Pull Requests against the main branch on GitHub (i.e. _patches_)
* 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)
* A new tag matching `v0.0.0` is pushed on the main or a release branch (i.e. a release is to be published)
Expand Down Expand Up @@ -116,7 +116,7 @@ The _Publish_ stage is independent from all other stages. As mentioned at the be
## Package Structure

The package has two major purposes:
* Custom build commands to handle the stages outlined above
* Custom build commands to handle the stages outlined above
* Provide easy helpers to trigger the release process

See [index.ts](./src/index.ts) for the main entry point on the different commands.
2 changes: 1 addition & 1 deletion packages/build/branches-and-tags.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions packages/build/src/config/should-do-public-release.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@ describe('shouldDoPublicRelease', () => {
});


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

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

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

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

it('returns true when version matches commit tag', async() => {
const config: Partial<Config> = { branch: 'master', triggeringGitTag: 'v0.0.3', version: '0.0.3' };
const config: Partial<Config> = { branch: 'main', triggeringGitTag: 'v0.0.3', version: '0.0.3' };
expect(shouldDoPublicRelease(config as any)).to.be.true;
});
});
4 changes: 2 additions & 2 deletions packages/build/src/config/should-do-public-release.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export function shouldDoPublicRelease(config: Config): boolean {
return false;
}

if (config.branch !== 'master') {
console.info('mongosh: skip public release: is not master');
if (config.branch !== 'main') {
console.info('mongosh: skip public release: is not main');
return false;
}

Expand Down
22 changes: 11 additions & 11 deletions packages/build/src/git/repository-status.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ describe('git repository-status', () => {
it('detectes pending file changes', () => {
spawnSync.onFirstCall().returns({
stdout: [
'## master...origin/master',
'## main...origin/main',
'A packages/build/src/helpers/index.ts',
'A packages/build/src/helpers/spawn-sync.spec.ts',
'?? packages/build/src/helpers/test',
Expand All @@ -197,8 +197,8 @@ describe('git repository-status', () => {
const status = getRepositoryStatus('somePath', spawnSync);
expect(status).to.deep.equal({
branch: {
local: 'master',
tracking: 'origin/master',
local: 'main',
tracking: 'origin/main',
diverged: false
},
clean: false,
Expand All @@ -209,7 +209,7 @@ describe('git repository-status', () => {
it('detectes diverging branches', () => {
spawnSync.returns({
stdout: [
'## master...origin/something [ahead 5, behind 3]',
'## main...origin/something [ahead 5, behind 3]',
'A packages/build/src/helpers/index.ts',
'A packages/build/src/helpers/spawn-sync.spec.ts',
'?? packages/build/src/helpers/test',
Expand All @@ -222,7 +222,7 @@ describe('git repository-status', () => {
const status = getRepositoryStatus('somePath', spawnSync);
expect(status).to.deep.equal({
branch: {
local: 'master',
local: 'main',
tracking: 'origin/something',
diverged: true
},
Expand All @@ -234,7 +234,7 @@ describe('git repository-status', () => {
it('detectes missing origin', () => {
spawnSync.returns({
stdout: [
'## master'
'## main'
].join('\n')
});
spawnSync.onSecondCall().returns({
Expand All @@ -244,7 +244,7 @@ describe('git repository-status', () => {
const status = getRepositoryStatus('somePath', spawnSync);
expect(status).to.deep.equal({
branch: {
local: 'master',
local: 'main',
tracking: undefined,
diverged: false
},
Expand All @@ -256,7 +256,7 @@ describe('git repository-status', () => {
it('detects unpushed tags', () => {
spawnSync.onFirstCall().returns({
stdout: [
'## master...origin/master'
'## main...origin/main'
].join('\n')
});
spawnSync.onSecondCall().returns({
Expand All @@ -269,8 +269,8 @@ describe('git repository-status', () => {
const status = getRepositoryStatus('somePath', spawnSync);
expect(status).to.deep.equal({
branch: {
local: 'master',
tracking: 'origin/master',
local: 'main',
tracking: 'origin/main',
diverged: false
},
clean: true,
Expand Down Expand Up @@ -299,7 +299,7 @@ describe('git repository-status', () => {
});

it('returns undefined for non-release branches', () => {
const version = getReleaseVersionFromBranch('master');
const version = getReleaseVersionFromBranch('main');
expect(version).to.be.undefined;
});
});
Expand Down
6 changes: 3 additions & 3 deletions packages/build/src/local/trigger-release-draft.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ describe('local trigger-release-draft', () => {

const cleanRepoStatus: RepositoryStatus = {
branch: {
local: 'master',
tracking: 'origin/master',
local: 'main',
tracking: 'origin/main',
diverged: false
},
clean: true,
Expand Down Expand Up @@ -59,7 +59,7 @@ describe('local trigger-release-draft', () => {
expect(spawnSync.getCall(1)).calledWith('git', ['push', 'origin', 'v0.8.0-draft.8'], sinon.match.any);
});

it('asks for the bump type and pushes a new draft if previous tag was a release on master', async() => {
it('asks for the bump type and pushes a new draft if previous tag was a release on main', async() => {
const latestTag: TaggedCommit = {
commit: 'hash',
tag: {
Expand Down
4 changes: 1 addition & 3 deletions packages/cli-repl/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @mongosh/cli-repl [![Build Status][azure-build-url]][azure-build]
# @mongosh/cli-repl

[Evergreen Build][evergreen-url]

Expand Down Expand Up @@ -252,8 +252,6 @@ npm install --save @mongosh/cli-repl
```

[mongosh]: https://github.com/mongodb-js/mongosh
[azure-build-url]: https://dev.azure.com/team-compass/mongosh/_apis/build/status/mongodb-js.mongosh?branchName=master
[azure-build]: https://dev.azure.com/team-compass/mongosh/_build/latest?definitionId=5&branchName=master
[evergreen-url]: https://evergreen.mongodb.com/waterfall/mongosh
[pino-js]: https://github.com/pinojs/pino
[object-id]: https://docs.mongodb.com/manual/reference/method/ObjectId/
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.0.0-dev.0",
"description": "Types for mongosh internals",
"author": "Anna Henningsen <anna.henningsen@mongodb.com>",
"homepage": "https://github.com/mongodb-js/mongosh/tree/master/packages/types#readme",
"homepage": "https://github.com/mongodb-js/mongosh/tree/main/packages/types#readme",
"license": "Apache-2.0",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions scripts/docker/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Docker test images

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

## Usage

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

```
bash scripts/docker/run.sh centos8-rpm arg1 arg2 ...
```
```
2 changes: 1 addition & 1 deletion scripts/docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
cd "$(dirname "$0")"

if [ x"$ARTIFACT_URL" = x"" ]; then
SHA=`git rev-parse origin/master`
SHA=`git rev-parse origin/main`
VERSION=`git show ${SHA}:lerna.json | grep version | cut -d ":" -f 2 | cut -d '"' -f 2`
if echo "$1" | grep -q -- deb.Dockerfile; then
ARTIFACT_URL="https://s3.amazonaws.com/mciuploads/mongosh/${SHA}/mongosh_${VESRION}_amd64.deb"
Expand Down