dhoulb / multi-semantic-release

Proof of concept that wraps semantic-release to work with monorepos.
BSD Zero Clause License
203 stars 36 forks source link

Improve algorithm to detect dependency changes #74

Closed reuzel closed 3 years ago

reuzel commented 3 years ago

Hi,

Found a couple of cases where dependencies were not updated correctly. Especially in corner-cases with cyclic dependencies. Added one of them as test-case.

This pull requests replaces the (depth-first) recursive search for changes with a repeated breadth-first approach. How it works: a loop is inserted that triggers release type updates of all packages. In each cycle each package will check its own dependencies (only) and updates its release type if necessary. With each cycle changes are propagated "upward" the dependency graph. The process stops when no package is changing its release type anymore: the graph is stable. This process has no "ignore" lists as part of the search, and as such is better able to capture changes in complex dependency graphs.

Hope this helps, Joost

reuzel commented 3 years ago

Please wait before merging. Seems there is a possibility that the loop doesn't end... checking...

reuzel commented 3 years ago

never mind, block had nothing to do with the changes, but with my Git setup (a token expired ;-) )

antongolub commented 3 years ago

:tada: This PR is included in version 2.8.4 :tada:

The release is available on:

Your semantic-release bot :package::rocket: