Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto with a non-lerna project #966

Closed
pvinis opened this issue Feb 21, 2020 · 35 comments
Closed

auto with a non-lerna project #966

pvinis opened this issue Feb 21, 2020 · 35 comments
Labels
bug Something isn't working

Comments

@pvinis
Copy link

pvinis commented Feb 21, 2020

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

@pvinis pvinis added the bug Something isn't working label Feb 21, 2020
@pvinis
Copy link
Author

pvinis commented Feb 21, 2020

@hipstersmoothie
Copy link
Collaborator

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

@hipstersmoothie
Copy link
Collaborator

I'm not able to reproduce with your repo currently

@hipstersmoothie
Copy link
Collaborator

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

@pvinis
Copy link
Author

pvinis commented Feb 21, 2020

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

@hipstersmoothie
Copy link
Collaborator

hipstersmoothie commented Feb 21, 2020

. 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

@pvinis
Copy link
Author

pvinis commented Feb 21, 2020

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

@hipstersmoothie
Copy link
Collaborator

yeah it just outputs nothing

@hipstersmoothie
Copy link
Collaborator

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

@pvinis
Copy link
Author

pvinis commented Feb 21, 2020

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.

@pvinis
Copy link
Author

pvinis commented Feb 21, 2020

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 😬

@hipstersmoothie
Copy link
Collaborator

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

@hipstersmoothie
Copy link
Collaborator

hipstersmoothie commented Feb 21, 2020

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)

@hipstersmoothie
Copy link
Collaborator

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

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

I have invited you as collaborator.

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

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.

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

Also, strangely, when I moved the config out to a file, react-native-community/hooks@aaca764 there was a git tag added with the prefix 🤔

@hipstersmoothie
Copy link
Collaborator

Up and investigating

@hipstersmoothie
Copy link
Collaborator

we are def on different sides of the world lol

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

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

@hipstersmoothie
Copy link
Collaborator

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 Make all-contributors plugin work for non-lerna packages again #971

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

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

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

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.

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

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

@hipstersmoothie
Copy link
Collaborator

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

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

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

@hipstersmoothie
Copy link
Collaborator

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

@hipstersmoothie
Copy link
Collaborator

https://circleci.com/gh/react-native-community/hooks/139

duke

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

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

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

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

@hipstersmoothie
Copy link
Collaborator

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

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

react-native-community/hooks#74, right?

@hipstersmoothie
Copy link
Collaborator

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

@pvinis
Copy link
Author

pvinis commented Feb 22, 2020

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

@zephraph
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants