Skip to content

Commit

Permalink
Merge pull request #101 from hipstersmoothie/no-release
Browse files Browse the repository at this point in the history
Change `no-release` to `skip-release`
  • Loading branch information
hipstersmoothie authored Dec 18, 2018
2 parents e49e9d2 + 2d780f9 commit 83463e3
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 74 deletions.
26 changes: 13 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

# 0.33.6 (Mon Dec 17 2018)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- url isn't required for pr or pr-check [#99](https://github.com/intuit/auto-release/pull/99) ([@hipstersmoothie](https://github.com/hipstersmoothie))

Expand All @@ -24,7 +24,7 @@

# 0.33.5 (Mon Dec 17 2018)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- pr-check wasn't getting semver labelTexts correctly [#98](https://github.com/intuit/auto-release/pull/98) ([@hipstersmoothie](https://github.com/hipstersmoothie))

Expand All @@ -36,7 +36,7 @@

# 0.33.4 (Mon Dec 17 2018)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- Change slack flag to boolean [#96](https://github.com/intuit/auto-release/pull/96) ([@hipstersmoothie](https://github.com/hipstersmoothie))

Expand All @@ -48,7 +48,7 @@

# 0.33.3 (Sun Dec 16 2018)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- only error if there are actually missing args [#95](https://github.com/intuit/auto-release/pull/95) ([@hipstersmoothie](https://github.com/hipstersmoothie))

Expand All @@ -60,17 +60,17 @@

# 0.33.1 (Sun Dec 16 2018)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- missed adding no release labels to `pr-check` [#89](https://github.com/intuit/auto-release/pull/89) ([@hipstersmoothie](https://github.com/hipstersmoothie))
- update deps [#85](https://github.com/intuit/auto-release/pull/85) ([@hipstersmoothie](https://github.com/hipstersmoothie))

#### 🏠 Internal
#### 🏠 Internal

- fix version number [#92](https://github.com/intuit/auto-release/pull/92) ([@hipstersmoothie](https://github.com/hipstersmoothie))
- only publish docs with documentation label [#86](https://github.com/intuit/auto-release/pull/86) ([@hipstersmoothie](https://github.com/hipstersmoothie))

#### 📝 Documentation
#### 📝 Documentation

- fix docs publish [#88](https://github.com/intuit/auto-release/pull/88) ([@hipstersmoothie](https://github.com/hipstersmoothie))
- Clearer wording [#87](https://github.com/intuit/auto-release/pull/87) ([@hipstersmoothie](https://github.com/hipstersmoothie))
Expand All @@ -83,7 +83,7 @@

# 0.33.0 (Sun Dec 16 2018)

#### 🚀 Enhancement
#### 🚀 Enhancement

- Default `label` to last merged PR [#83](https://github.com/intuit/auto-release/pull/83) ([@hipstersmoothie](https://github.com/hipstersmoothie))

Expand All @@ -95,11 +95,11 @@

# 0.32.2 (Sun Dec 16 2018)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- unneeded long desc on chengelog cli [#81](https://github.com/intuit/auto-release/pull/81) ([@hipstersmoothie](https://github.com/hipstersmoothie))

#### 📝 Documentation
#### 📝 Documentation

- doc ordering [#80](https://github.com/intuit/auto-release/pull/80) ([@hipstersmoothie](https://github.com/hipstersmoothie))

Expand All @@ -111,11 +111,11 @@

# 0.32.1 (Sun Dec 16 2018)

#### 🐛 Bug Fix
#### 🐛 Bug Fix

- Formatted Changelogs [#79](https://github.com/intuit/auto-release/pull/79) ([@hipstersmoothie](https://github.com/hipstersmoothie))

#### 📝 Documentation
#### 📝 Documentation

- Document process for onboarding an already published repo [#78](https://github.com/intuit/auto-release/pull/78) ([@hipstersmoothie](https://github.com/hipstersmoothie))

Expand Down Expand Up @@ -193,7 +193,7 @@

#### 📝 Documentation

- Add docs for `noReleaseLabels` [#57](https://github.com/intuit/auto-release/pull/57) ([@hipstersmoothie](https://github.com/hipstersmoothie))
- Add docs for `skipReleaseLabels` [#57](https://github.com/intuit/auto-release/pull/57) ([@hipstersmoothie](https://github.com/hipstersmoothie))
- Badge [#56](https://github.com/intuit/auto-release/pull/56) ([@hipstersmoothie](https://github.com/hipstersmoothie))

#### Authors: 1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CI/CD helpers for github releases. Generate releases based on semantic version l
Release Features:

- Release every merge to master based on a PR labels
- Skip a release with the `no-release` label
- Skip a release with the `skip-release` label
- Generate a changelog with fancy headers, authors, and monorepo package association
- Generate a Github release

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/auto-pr-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Options
--url string URL to associate with this status
--onlyPublishWithReleaseLabel Only bump version if 'release' label is on pull request
--context string A string label to differentiate this status from others
--noReleaseLabels string[] Labels that will not create a release. Defaults to just 'no-release'
--skipReleaseLabels string[] Labels that will not create a release. Defaults to just 'skip-release'

Global Options

Expand Down
12 changes: 6 additions & 6 deletions docs/pages/auto-version.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Get the semantic version bump for the given changes. Requires all PRs to have la
Options

--onlyPublishWithReleaseLabel Only bump version if 'release' label is on pull request
--noReleaseLabels string[] Labels that will not create a release. Defaults to just 'no-release'
--skipReleaseLabels string[] Labels that will not create a release. Defaults to just 'skip-release'

Global Options

Expand All @@ -22,7 +22,7 @@ Global Options
Examples

Get the new version using the last release to head $ auto version
Skip releases with multiple labels $ auto version --noReleaseLabels documentation CI
Skip releases with multiple labels $ auto version --skipReleaseLabels documentation CI
```
Useful in conjunction with `npm version` to auto-version releases.
Expand All @@ -33,18 +33,18 @@ To create a prerelease add the `prerelease` label to your pull request.
## No Release
To not create a release for a pull request add the `no-release` label. Any pull request with this tag will make `auto version` return `''`.
To not create a release for a pull request add the `skip-release` label. Any pull request with this tag will make `auto version` return `''`.
::: message is-warning
:warning: You must check the return value of `auto version` in a bash script like in the example configuration for the `no-release` label to function properly.
:warning: You must check the return value of `auto version` in a bash script like in the example configuration for the `skip-release` label to function properly.
:::
### Multiple
You can configure multiple labels to skip releasing as well. To do this use the `noReleaseLabels` options. This can also be configured via the [.autorc](./autorc.md#multiple-no-version).
You can configure multiple labels to skip releasing as well. To do this use the `skipReleaseLabels` options. This can also be configured via the [.autorc](./autorc.md#multiple-no-version).
```sh
auto version --noReleaseLabels project-files --noReleaseLabels documentation
auto version --skipReleaseLabels project-files --skipReleaseLabels documentation
```
## Configure Versioning Labels
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/autorc.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ To override the label text used for versioning define new labels in the `.autorc
"major": "Version: Major",
"minor": "Version: Minor",
"patch": "Version: Patch",
"no-release": "NO!",
"skip-release": "NO!",
"release": "Autobots, rollout!",
"prerelease": "beta"
}
Expand All @@ -44,7 +44,7 @@ You can configure multiple labels to skip releases.

```json
{
"noReleaseLabels": ["documentation", "project-files"]
"skipReleaseLabels": ["documentation", "project-files"]
}
```

Expand Down
8 changes: 4 additions & 4 deletions docs/pages/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ To version, changelog, publish and release your code all at the same time, we've

#### Detailed Setup

The simplest workflow to get set up in just the `package.json` is by adding the following to your `package.json`. With this setup your application will not be able to use the `no-release` flag, but everything else will work just fine
The simplest workflow to get set up in just the `package.json` is by adding the following to your `package.json`. With this setup your application will not be able to use the `skip-release` flag, but everything else will work just fine

```json
{
Expand All @@ -94,9 +94,9 @@ The simplest workflow to get set up in just the `package.json` is by adding the
}
```

##### Enabling `no-release` label
##### Enabling `skip-release` label

To use the `no-release` label you have to get a little more involved and use a shell script. We could do the `if` checks in the `package.json`, but this would get messy and hard to read very quickly.
To use the `skip-release` label you have to get a little more involved and use a shell script. We could do the `if` checks in the `package.json`, but this would get messy and hard to read very quickly.

```json
{
Expand All @@ -113,7 +113,7 @@ export PATH=$(npm bin):$PATH

VERSION=`auto version`

## Support for label 'no-release'
## Support for label 'skip-release'
if [ ! -z "$VERSION" ]; then
## Update Changelog
auto changelog
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CI/CD helpers for github releases. Generate releases based on semantic version l
Release Features:

- Release every merge to master based on a PR labels
- Skip a release with the `no-release` label
- Skip a release with the `skip-release` label
- Generate a changelog with fancy headers, authors, and monorepo package association
- Generate a Github release

Expand Down
20 changes: 10 additions & 10 deletions src/__tests__/github-release.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@ describe('GithubRelease', () => {
];

getGitLog.mockReturnValueOnce(commits);
getLabels.mockReturnValueOnce(['no-release', 'patch']);
getLabels.mockReturnValueOnce(['no-release', 'patch']);
getLabels.mockReturnValueOnce(['no-release', 'minor']);
getLabels.mockReturnValueOnce(['skip-release', 'patch']);
getLabels.mockReturnValueOnce(['skip-release', 'patch']);
getLabels.mockReturnValueOnce(['skip-release', 'minor']);

expect(await gh.getSemverBump('1234', '123')).toBe('');
});
Expand All @@ -374,8 +374,8 @@ describe('GithubRelease', () => {

getGitLog.mockReturnValueOnce(commits);
getLabels.mockReturnValueOnce(['patch']);
getLabels.mockReturnValueOnce(['no-release', 'patch']);
getLabels.mockReturnValueOnce(['no-release', 'minor']);
getLabels.mockReturnValueOnce(['skip-release', 'patch']);
getLabels.mockReturnValueOnce(['skip-release', 'minor']);

expect(await gh.getSemverBump('1234', '123')).toBe(SEMVER.minor);
});
Expand All @@ -389,7 +389,7 @@ describe('GithubRelease', () => {
];

getGitLog.mockReturnValueOnce(commits);
getLabels.mockReturnValueOnce(['no-release']);
getLabels.mockReturnValueOnce(['skip-release']);
getLabels.mockReturnValueOnce([]);
getLabels.mockReturnValueOnce([]);

Expand Down Expand Up @@ -502,16 +502,16 @@ describe('GithubRelease', () => {
expect(createLabel).toHaveBeenCalledWith('release', 'deploy');
});

test('should add no-release label not in onlyPublishWithReleaseLabel mode', async () => {
test('should add skip-release label not in onlyPublishWithReleaseLabel mode', async () => {
const gh = new GithubRelease();
const labels = new Map<VersionLabel, string>();
labels.set('no-release', 'no!');
labels.set('skip-release', 'no!');

await gh.addLabelsToProject(labels, true);
expect(createLabel).not.toHaveBeenCalledWith('no-release', 'no!');
expect(createLabel).not.toHaveBeenCalledWith('skip-release', 'no!');

await gh.addLabelsToProject(labels);
expect(createLabel).toHaveBeenCalledWith('no-release', 'no!');
expect(createLabel).toHaveBeenCalledWith('skip-release', 'no!');
});
});
});
10 changes: 5 additions & 5 deletions src/__tests__/semver.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ describe('calculateSemVerBump', () => {
);
});

test('should be able to use multiple labels for no-release', () => {
test('should be able to use multiple labels for skip-release', () => {
expect(
calculateSemVerBump([['no-release', 'major']], defaultLabels, {
noReleaseLabels: ['documentation']
calculateSemVerBump([['skip-release', 'major']], defaultLabels, {
skipReleaseLabels: ['documentation']
})
).toBe(SEMVER.noVersion);

expect(
calculateSemVerBump([['documentation', 'major']], defaultLabels, {
noReleaseLabels: ['documentation']
skipReleaseLabels: ['documentation']
})
).toBe(SEMVER.noVersion);

expect(
calculateSemVerBump([['major']], defaultLabels, {
noReleaseLabels: ['documentation']
skipReleaseLabels: ['documentation']
})
).toBe(SEMVER.major);
});
Expand Down
2 changes: 1 addition & 1 deletion src/auto-rc.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"type": "string",
"description": "Label used to mark a pull request as a patch release"
},
"no-release": {
"skip-release": {
"type": "string",
"description": "Do not create a release for this PR. Is ignored when in `onlyPublishWithReleaseLabel` mode."
},
Expand Down
18 changes: 11 additions & 7 deletions src/cli/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ const message: commandLineUsage.OptionDefinition = {
alias: 'm'
};

const noReleaseLabels: commandLineUsage.OptionDefinition = {
name: 'noReleaseLabels',
const skipReleaseLabels: commandLineUsage.OptionDefinition = {
name: 'skipReleaseLabels',
type: String,
group: 'main',
multiple: true,
description:
"Labels that will not create a release. Defaults to just 'no-release'"
"Labels that will not create a release. Defaults to just 'skip-release'"
};

interface ICommand {
Expand Down Expand Up @@ -206,7 +206,7 @@ const commands: ICommand[] = [
...context,
defaultValue: 'ci/pr-check'
},
noReleaseLabels,
skipReleaseLabels,
...defaultOptions
],
examples: [
Expand Down Expand Up @@ -255,15 +255,19 @@ const commands: ICommand[] = [
{
name: 'version',
summary: 'Get the semantic version bump for the given changes.',
options: [onlyPublishWithReleaseLabel, noReleaseLabels, ...defaultOptions],
options: [
onlyPublishWithReleaseLabel,
skipReleaseLabels,
...defaultOptions
],
examples: [
{
desc: 'Get the new version using the last release to head',
example: '{green $} auto version'
},
{
desc: 'Skip releases with multiple labels',
example: '{green $} auto version --noReleaseLabels documentation CI'
example: '{green $} auto version --skipReleaseLabels documentation CI'
}
]
},
Expand Down Expand Up @@ -521,7 +525,7 @@ export default function parseArgs(testArgs?: string[]) {
}

export interface ISemverArgs {
noReleaseLabels?: string[];
skipReleaseLabels?: string[];
onlyPublishWithReleaseLabel?: boolean;
jira?: string;
slack?: string;
Expand Down
Loading

0 comments on commit 83463e3

Please sign in to comment.