Repository: intuit/auto
Pull request #797 (2019-12-14 23:00:05)

Fix `none` releases: they were not handling extra labels

<!-- GITHUB_RELEASE PR BODY: canary-version -->
Published PR with canary version: <details><summary>Published under canary scope @auto-canary</summary>
- `@auto-canary/auto@8.1.2-canary.797.10492.0`
- `@auto-canary/core@8.1.2-canary.797.10492.0`
- `@auto-canary/all-contributors@8.1.2-canary.797.10492.0`
- `@auto-canary/chrome@8.1.2-canary.797.10492.0`
- `@auto-canary/conventional-commits@8.1.2-canary.797.10492.0`
- `@auto-canary/crates@8.1.2-canary.797.10492.0`
- `@auto-canary/first-time-contributor@8.1.2-canary.797.10492.0`
- `@auto-canary/git-tag@8.1.2-canary.797.10492.0`
- `@auto-canary/jira@8.1.2-canary.797.10492.0`
- `@auto-canary/maven@8.1.2-canary.797.10492.0`
- `@auto-canary/npm@8.1.2-canary.797.10492.0`
- `@auto-canary/omit-commits@8.1.2-canary.797.10492.0`
- `@auto-canary/omit-release-notes@8.1.2-canary.797.10492.0`
- `@auto-canary/released@8.1.2-canary.797.10492.0`
- `@auto-canary/s3@8.1.2-canary.797.10492.0`
- `@auto-canary/slack@8.1.2-canary.797.10492.0`
- `@auto-canary/twitter@8.1.2-canary.797.10492.0`
- `@auto-canary/upload-assets@8.1.2-canary.797.10492.0`</details>
<!-- GITHUB_RELEASE PR BODY: canary-version -->



Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dc53a5d2..1c836e55 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,16 +1,3 @@
-# v8.1.1 (Sat Dec 14 2019)
-
-#### 📝  Documentation
-
-- `@auto-it/npm`
-  - add diagrams [#795](https://github.com/intuit/auto/pull/795) ([@hipstersmoothie](https://github.com/hipstersmoothie))
-
-#### Authors: 1
-
-- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
-
----
-
 # v8.1.0 (Sat Dec 14 2019)
 
 #### 🚀  Enhancement
diff --git a/Formula/auto.rb b/Formula/auto.rb
index 925a0d9f..570ab349 100644
--- a/Formula/auto.rb
+++ b/Formula/auto.rb
@@ -1,8 +1,8 @@
 class Auto < Formula
   desc "Generate releases based on semantic version labels on pull requests."
   homepage "https://intuit.github.io/auto/home.html"
-  url "https://github.com/intuit/auto/releases/download/v8.1.1/auto-macos.gz"
-  sha256 "ebbf9f069c2fc2a1b03fbe04475db9d44450a466140dbb1e41f2697970a4349d"
+  url "https://github.com/intuit/auto/releases/download/v8.1.0/auto-macos.gz"
+  sha256 "3cafc9f8c05c2ecd772a9ddaa9a2f82f820e3414e0fe666e39860a040eac10c4"
 
   def install
     libexec.install Dir["*"]
diff --git a/lerna.json b/lerna.json
index 1bf1be3d..be3601ac 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,5 +1,5 @@
 {
-  "version": "8.1.1",
+  "version": "8.1.0",
   "npmClient": "yarn",
   "useWorkspaces": true,
   "packages": [
diff --git a/packages/cli/package.json b/packages/cli/package.json
index c178539a..c79143ac 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -2,7 +2,7 @@
   "name": "auto",
   "bin": "dist/bin/auto.js",
   "description": "CLI tools to help facilitate semantic versioning based on GitHub PR labels",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "author": {
     "name": "Andrew Lisowski",
     "email": "lisowski54@gmail.com"
diff --git a/packages/core/package.json b/packages/core/package.json
index e0b10b59..b9f51727 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/core",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "description": "Node API for using auto.",
   "main": "dist/auto.js",
   "author": {
diff --git a/packages/core/src/auto.ts b/packages/core/src/auto.ts
index d1c9f1d6..f561e5cd 100644
--- a/packages/core/src/auto.ts
+++ b/packages/core/src/auto.ts
@@ -246,10 +246,10 @@ export default class Auto {
    */
   async loadConfig() {
     const configLoader = new Config(this.logger);
-    const config = this.hooks.modifyConfig.call({
+    const config = {
       ...(await configLoader.loadConfig(this.options)),
       baseBranch: this.baseBranch
-    });
+    };
 
     this.logger.verbose.success('Loaded `auto` with config:', config);
 
@@ -257,6 +257,7 @@ export default class Auto {
     this.labels = config.labels;
     this.semVerLabels = getVersionMap(config.labels);
     this.loadPlugins(config);
+    this.config = this.hooks.modifyConfig.call(config)
     this.hooks.beforeRun.call(config);
 
     const repository = await this.getRepo(config);
diff --git a/packages/core/src/semver.ts b/packages/core/src/semver.ts
index 0bdceff0..ca74439f 100644
--- a/packages/core/src/semver.ts
+++ b/packages/core/src/semver.ts
@@ -44,14 +44,16 @@ export function calculateSemVerBump(
 ) {
   const labelSet = new Set<string>();
   const skipReleaseLabels = labelMap.get('skip') || [];
-  const noReleaseLabels = labelMap.get('none') || [];
 
   labels.forEach(pr => {
     pr.forEach(label => {
       const userLabel = [...labelMap.entries()].find(pair =>
         pair[1].includes(label)
       );
-      labelSet.add(userLabel ? userLabel[0] : label);
+
+      if (userLabel) {
+        labelSet.add(userLabel[0]);
+      }
     });
   });
 
@@ -67,9 +69,8 @@ export function calculateSemVerBump(
 
   // If PRs only have none or skip labels, skip the release
   const onlyNoReleaseLabels = [...labelSet].reduce(
-    (condition, label) =>
-      condition &&
-      (noReleaseLabels.includes(label) || skipReleaseLabels.includes(label)),
+    (condition, releaseType) =>
+      condition && (releaseType === 'none' || releaseType === 'skip'),
     true
   );
 
diff --git a/plugins/all-contributors/package.json b/plugins/all-contributors/package.json
index f8829f50..3a80e67a 100644
--- a/plugins/all-contributors/package.json
+++ b/plugins/all-contributors/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/all-contributors",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Automatically add contributors as changelogs are produced.",
   "author": {
diff --git a/plugins/chrome/package.json b/plugins/chrome/package.json
index f13807e3..f174e6cf 100644
--- a/plugins/chrome/package.json
+++ b/plugins/chrome/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/chrome",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Chrome publishing plugin for auto",
   "author": {
diff --git a/plugins/conventional-commits/package.json b/plugins/conventional-commits/package.json
index cf202aeb..8d2da2bf 100644
--- a/plugins/conventional-commits/package.json
+++ b/plugins/conventional-commits/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/conventional-commits",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Conventional commit plugin for auto",
   "author": {
diff --git a/plugins/crates/package.json b/plugins/crates/package.json
index 150b462f..20612fbc 100644
--- a/plugins/crates/package.json
+++ b/plugins/crates/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/crates",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Deploy Rust crates to crates.io",
   "author": {
diff --git a/plugins/first-time-contributor/package.json b/plugins/first-time-contributor/package.json
index d68e3b55..72df0018 100644
--- a/plugins/first-time-contributor/package.json
+++ b/plugins/first-time-contributor/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/first-time-contributor",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Thank first time contributors for their work right in your release notes.",
   "author": {
diff --git a/plugins/git-tag/package.json b/plugins/git-tag/package.json
index ab46ed49..1bfc37f5 100644
--- a/plugins/git-tag/package.json
+++ b/plugins/git-tag/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/git-tag",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Manage your projects version through just a git tag",
   "author": {
diff --git a/plugins/jira/package.json b/plugins/jira/package.json
index 11f38d7f..596bf98e 100644
--- a/plugins/jira/package.json
+++ b/plugins/jira/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/jira",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Jira plugin for auto",
   "author": {
diff --git a/plugins/maven/package.json b/plugins/maven/package.json
index 1a7b9705..be074cc7 100644
--- a/plugins/maven/package.json
+++ b/plugins/maven/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/maven",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Maven publishing plugin for auto",
   "author": {
diff --git a/plugins/npm/CHANGELOG.md b/plugins/npm/CHANGELOG.md
index 2b7a5e2e..bc14cbde 100644
--- a/plugins/npm/CHANGELOG.md
+++ b/plugins/npm/CHANGELOG.md
@@ -1,15 +1,3 @@
-# v8.1.1 (Sat Dec 14 2019)
-
-#### 🐛  Bug Fix
-
-- remove docs  ([@hipstersmoothie](https://github.com/hipstersmoothie))
-
-#### Authors: 1
-
-- Andrew Lisowski ([@hipstersmoothie](https://github.com/hipstersmoothie))
-
----
-
 # v8.1.0 (Sat Dec 14 2019)
 
 #### 🐛  Bug Fix
diff --git a/plugins/npm/package.json b/plugins/npm/package.json
index c72f676b..3f91d501 100644
--- a/plugins/npm/package.json
+++ b/plugins/npm/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/npm",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "NPM publishing plugin for auto",
   "author": {
diff --git a/plugins/omit-commits/package.json b/plugins/omit-commits/package.json
index cd061fa6..4b5799e3 100644
--- a/plugins/omit-commits/package.json
+++ b/plugins/omit-commits/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/omit-commits",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Omit commits plugin for auto",
   "author": {
diff --git a/plugins/omit-release-notes/package.json b/plugins/omit-release-notes/package.json
index 1b41a20e..e6bfd386 100644
--- a/plugins/omit-release-notes/package.json
+++ b/plugins/omit-release-notes/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/omit-release-notes",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Omit release notes plugin for auto",
   "author": {
diff --git a/plugins/released/package.json b/plugins/released/package.json
index 5b9df4c0..2be932e4 100644
--- a/plugins/released/package.json
+++ b/plugins/released/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/released",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Released plugin for auto. Comments with version + extra",
   "author": {
diff --git a/plugins/s3/package.json b/plugins/s3/package.json
index 8f5306d2..2a9c9b5d 100644
--- a/plugins/s3/package.json
+++ b/plugins/s3/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/s3",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Post your built artifacts to s3",
   "author": {
diff --git a/plugins/slack/package.json b/plugins/slack/package.json
index 754173e3..7b4ab07f 100644
--- a/plugins/slack/package.json
+++ b/plugins/slack/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/slack",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Slack plugin for auto",
   "author": {
diff --git a/plugins/twitter/package.json b/plugins/twitter/package.json
index 3fedd1f4..f52c8a98 100644
--- a/plugins/twitter/package.json
+++ b/plugins/twitter/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/twitter",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Twitter plugin for auto",
   "author": {
diff --git a/plugins/upload-assets/package.json b/plugins/upload-assets/package.json
index b418cd06..c1fd6c08 100644
--- a/plugins/upload-assets/package.json
+++ b/plugins/upload-assets/package.json
@@ -1,6 +1,6 @@
 {
   "name": "@auto-it/upload-assets",
-  "version": "8.1.1",
+  "version": "8.1.0",
   "main": "dist/index.js",
   "description": "Upload assets plugin for auto",
   "author": {


Test patch:
diff --git a/packages/core/src/__tests__/semver.test.ts b/packages/core/src/__tests__/semver.test.ts
index 68f9a051..8b881124 100644
--- a/packages/core/src/__tests__/semver.test.ts
+++ b/packages/core/src/__tests__/semver.test.ts
@@ -32,6 +32,10 @@ describe('calculateSemVerBump', () => {
     expect(calculateSemVerBump([['none', 'major']], semverMap)).toBe(
       SEMVER.major
     );
+
+    expect(
+      calculateSemVerBump([['none'], ['unknown'], ['documentation']], semverMap)
+    ).toBe(SEMVER.noVersion);
   });
 
   test('should not skip things before none', () => {