qiwi / semantic-release-monorepo-hooks

Workarounds to handle `semantic-release-monorepo` multipublishing
MIT License
33 stars 4 forks source link

TypeError: hooks is not a function, and tags are committed before all packages are parsed #12

Open good-idea opened 5 years ago

good-idea commented 5 years ago

I've set up my repo following the instructions, and matching the @qiwi/substrate repo as closely as possible - but I can't seem to get this to work.

At the end of each log in Travis, I see:

[release-hooks]: err= TypeError: hooks is not a function
    at Object.<anonymous> (/home/travis/build/good-idea/sane-shopify/.releaserc.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    ...etc

I have been able to publish a single package, but it is unable to authenticate with Github for later packages. Here is an example of a build that included a single fix commit, in one of the packages, then is unable to authenticate.

Here is the next build, which included multiple fix commits. (But, I pushed these commits before the previous build had made it's chore(release) commit back to the repo - so, semantic release said The local branch master is behind the remote one, therefore a new version won't be published.). Maybe not too relevant --- but you'll see at the end that hooks is not a function

Here is the next build. This included fix commits for the server, sanity-plugin, and sync-utils packages -- but, it found a change in types from the previous tag, and deployed that instead.

Finally, this build was run after adding GH_USER to the environment variables -- which then breaks here.

I'm not sure about the hooks is not a function problem, but, as far as the other issues go - I'm guessing that one problem is that the tags are being added to the repo before the rest of the packages have been figured out by semantic-release. I guess I'm a little lost overall - - am I missing something obvious?

antongolub commented 5 years ago

@good-idea, thanks for the report. It looks we finally ran into async problem similar to #1 and #48, but I can’t say for sure.

Here's the plan:

good-idea commented 5 years ago

Thanks for your quick reply. For now, I'm rolling back and just going to use Lerna as I was before. I've removed all of my tags & commits generated while working on this from my master branch, but if you'd like to see what my config looked like when I left off, it's on this branch:

https://github.com/good-idea/sane-shopify/tree/release-config

Also, thanks for all of your work putting this together! I'm not super familiar with how semantic release works, but I'd be happy to help out with a PR when I can -- I'll keep an eye on the issues.

antongolub commented 4 years ago

@good-idea. Experience has shown that we lack the resources to support several monorepo release tools, sorry. In defense, I can say that we have made significant progress in another project — dhoulb/multi-semantic-release. MSR covers all of our cases.