intuit / intuit/auto

Error combining magic-zero with either npm or conventional-commits

Open
#1,941 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
2.5k
Forks
221
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

When adding the `magic-zero` plugin, and _either or both_ `npm` or `conventional-commits`, Auto fails with a traceback claiming the config file has not loaded.

**To Reproduce**

Set the following in your auto.config.js file (after installing the necessary plugins with npm):

```
plugins: [
"magic-zero",
"npm",
],
```

Or:

```
plugins: [
"conventional-commits",
"magic-zero",
],
```

Then run any Auto command, like `auto version` or `auto shipit --dry-run`

**Expected behavior**

I'd expect the magic-zero behavior (translating 'minor' to the third integer and 'major' to the second when the first is `0`) would be combined with either `npm` versions or the conventional-commit version bump calculations.

Instead, the follow error is printed:

```
$ auto version
Error: Auto is not initialized! Make sure the have run Auto.loadConfig
at Auto.createErrorMessage (/.../node_modules/@auto-it/core/src/auto.ts:2038:12)
at Auto.prefixRelease (/.../node_modules/@auto-it/core/src/auto.ts:2028:18)
at getPreviousVersion (/.../node_modules/@auto-it/npm/src/index.ts:296:16)
```

When `magic-zero` is removed, or all plugins other than `magic-zero` are removed, it runs successfully without a traceback.

**Environment information:**

```
"auto" version: v10.25.0
"git" version: v2.24.3 (Apple Git-128)
"node" version: v14.16.0
GHE version: v2.22.7
```

(Issue also occurred on Node 12.x and 10.x.)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.