auto with a non-lerna project

Created on 21 Feb 2020  ·  35Comments  ·  Source: intuit/auto

Describe the bug

I setup auto in the https://github.com/react-native-community/hooks repo. We have no lerna.json file, and when I run yarn auto changelog --verbose, I get an error like

✔  success   Calculated SEMVER bump: patch
ℹ  info      Calculated next version to be: 2.0.3
ℹ  info      Old changelog exists, prepending changes.
ℹ  info      Wrote new changelog to filesystem.
ℹ  info      Getting commits from 2.0.2 to HEAD
ℹ  info      Committed new changelog.
✖  error     Called from: Error
    at Object.execPromise [as default] (/Users/pvinis/Source/react-native-community/hooks/node_modules/@auto-it/core/dist/utils/exec-promise.js:15:22)
    at Object.getLernaPackages (/Users/pvinis/Source/react-native-community/hooks/node_modules/@auto-it/core/dist/utils/get-lerna-packages.js:7:34)
    at /Users/pvinis/Source/react-native-community/hooks/node_modules/@auto-it/all-contributors/dist/index.js:82:48
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
Error: Running command 'npx' with args [lerna, ls, -pl] failed

npx: installed 706 in 55.72s
lerna notice cli v3.20.2
lerna ERR! ENOLERNA `lerna.json` does not exist, have you run `lerna init`?

    at ChildProcess.<anonymous> (/Users/pvinis/Source/react-native-community/hooks/node_modules/@auto-it/core/dist/utils/exec-promise.js:49:24)
    at ChildProcess.emit (events.js:321:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

To Reproduce

Expected behavior

If the repo has no lerna configured, it shouldn't need or look for it and error out, right?

Screenshots

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context

bug

All 35 comments

Do you have a branch? Sorry about this. I thought I had fixed this issue in an old version

I'm not able to reproduce with your repo currently

On your repo's master I did the following without any errors:

yarn add auto
yarn auto changelog --from 2.0.1 -d

Output:

#### 🚀  Enhancement

- trying out auto [#60](https://github.com/react-native-community/hooks/pull/60) ([@pvinis](https://github.com/pvinis))

#### 🐛  Bug Fix

- Update README.md [#61](https://github.com/react-native-community/hooks/pull/61) ([@pvinis](https://github.com/pvinis))
- Create LICENSE [#57](https://github.com/react-native-community/hooks/pull/57) ([@pvinis](https://github.com/pvinis))

#### ⚠️  Pushed to master

- aha  ([@pvinis](https://github.com/pvinis))
- fix(sad): its a sad day when you cant make your tools do what you want.  ([@pvinis](https://github.com/pvinis))
- fix(bla) ok  ([@pvinis](https://github.com/pvinis))
- rename  ([@pvinis](https://github.com/pvinis))
- fix(something): i hate this  ([@pvinis](https://github.com/pvinis))
- again  ([@pvinis](https://github.com/pvinis))
- bla  ([@pvinis](https://github.com/pvinis))
- i give up..  ([@pvinis](https://github.com/pvinis))
- try  ([@pvinis](https://github.com/pvinis))
- bump  ([@pvinis](https://github.com/pvinis))
- upg  ([@pvinis](https://github.com/pvinis))
- test  ([@pvinis](https://github.com/pvinis))
- some baaaasic tests  ([@pvinis](https://github.com/pvinis))
- rename repo to be canonical with the rest and fix links  ([@pvinis](https://github.com/pvinis))

#### Authors: 1

- Pavlos Vinieratos ([@pvinis](https://github.com/pvinis))

😭 I cleaned it up a few minutes ago 🤦‍♂️.

I can recreate it tomorrow in a branch, but let me list here what I found out.

I added auto and all-contributors. I then tried auto shipit and even with dry run it would fail because of the lerna error.

I then removed the all-contributors, and tried without it. I had two problems. One was that the ci complained for GitHub.com being unauthorized ip or something. I switched to https on the repository on package.json but it didn't help. The other problem was that gh releases and tags were not happening. At some point I have one version number on package.json, another was tried to be created as a tag, and a third was the npm release. All three numbers were different, which confused me a lot and I gave up.

I'll recreate things tomorrow. Sorry and thanks.

. One was that the ci complained for GitHub.com being unauthorized ip or something.

https://github.com/intuit/auto/blob/master/.circleci/config.yml#L99

This is also in the docs I think. Maybe I should re-open and address #550

does it work without 'from' and 'd'?

yeah it just outputs nothing

I can try to get a PR together and set auto up. I have time. as long as you have tokens set up already I should be able to do it pretty easily

hm strange. ok I guess the only way is to just get my trials back. I'll do a reflog and push it in a branch tomorrow if that's alright.

the ci has tokens set up. that would be amazing. do you wanna talk on discord or something for more direct chat? it's just 1.26 in the morning here and it's been a long day 😬

Go to sleep! I'll get a PR together for hooks and we can pick up tomorrow (or whenever). Chatting here is fine with me. I like keeping discussion in the open

If you could add me as a collaborator on the repo that would be perfect too. I just need to add some git tags (maybe)

@pvinis with #969 users should never run into the known hosts problem! it will now try to auth to the https url or https + token which gets around that particular issue.

I have invited you as collaborator.

Ok, so I merged your PR. I did a PR with no release label, it made only canary, great. I did a PR with the release label, canary worked, merged, then lerna problem https://app.circleci.com/jobs/github/react-native-community/hooks/114 and https://app.circleci.com/jobs/github/react-native-community/hooks/130.

Also, strangely, when I moved the config out to a file, https://github.com/react-native-community/hooks/commit/aaca764128470a1096f84a0bf493a746a2fe5168 there was a git tag added with the prefix 🤔

Up and investigating

we are def on different sides of the world lol

😅 indeed. but I'm up for a while more, I can help you if you need something. in an hour or so I have time.

So I think I actually need admin so I can edit/delete tags. Also:

  1. have a bug fix to fix the all-contributors plugin for single packages https://github.com/intuit/auto/pull/971

  2. I think we should remove the usage of noVersionPrefix.

  • npm docs suggest against it https://docs.npmjs.com/misc/config#tag-version-prefix
  • if you want it we need to add an .npmrc that contains tag-version-prefix="" (making a change to the docs to call this out)

I think the best path forward is having the v in the tags. less setup and more standard

I can make the tags as you want them. yea, I thought so too about the v. I don't like it but I guess it's less friction.

Ok I removed the prefix config, and now we have v2.4.2, so I guess after the lerna fix is done, I could upgrade and that should be all 🤞.

I'm creating the initial all-contributors sections for you. pr will be incoming with new version

In autorc its onlyPublishWithReleaseLabel. In auto.config.js, is it onlyPublishWithReleaseLabel or only-publish-with-release-label?

flags are kebab case, when in an auto rc they are camelCase

It worked! So it was the lerna thing, plus the version prefix thing.

Damn, thank you soooooo much for the help and for this tool! I love open source and the people involved.

Thank you for using auto and helping me make it better for everyone! I always try to improve the tool when new developers hit the rough edges.

closed via #971

I don't think we support .js files https://intuit.github.io/auto/pages/autorc.html. looks like it is only json or yml. This is for GitHub bot related reasons. @zephraph could explain more

Ah. I thought I saw somewhere that it uses cosmicconfig. Alright, .autorc in json it is then.

Yeah, it's just the fact that a js file isn't statically analyzable in the same way that a JSON/yml file is so it makes it challenging to build automation against.

Was this page helpful?
0 / 5 - 0 ratings