-
Notifications
You must be signed in to change notification settings - Fork 185
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
fix: melos exec --order-dependents
does not run in all packages
#610
Comments
@mspb1g12 you wrote that feature right? Was the intention that it should filter too? |
I didn't add any extra filtering that wouldn't be normally part of If that's not what you're seeing then it sounds like a bug, have you got an example package structure that causes this? I've tried with a very basic 3 package repo and |
Looks like there's something else weird happening here, it's not filtering the packages, but the command is not run in all packages. If I run
If I run
With I didn't notice it was behaving weirdly, because there were no errors (just a quiet exit), and the command I was originally running wasn't a simple "echo" (although it happens with that too). Unfortunately, I can't share the project, but I'll try to debug what's happening and create a reproducible case. Any hints on how to debug Melos? |
melos exec --order-dependents
does not run in all packages
Good find!
I don't think melos produces any logs or something that would be helpful here, I think the only way to really get to know what is happening is to run a modified version of melos with extra logging or stepping through it with the debugger. It's probably something around here that is wrong. |
I debugged this a little bit, and figured out why it's failing. We have a bit of a strange dependency thing going on with some of our packages, where:
So, one of the tests in package I created a simple Dart project, and packages
With the above dependency structure, I can understand if you don't want to support this kind of dependency structure, it is a little bit weird. But it would be nice to at least have some sort of error message (and non-zero exit code) here, now this went unnoticed for us for a while. |
Well investigated!
Does it still happen if you don't use path dependencies? You don't need path dependencies for packages within the same monorepo, since that is what |
We actually don't use Melos for dependency management at all, so we're not running Our current (somewhat custom) dependency management pre-dates our use of Melos. We might transition to using Melos for dependency management as well at some point, but we currently don't have plans for that. We would have to make sure the dependencies work with Renovate, etc., so it would be a bit of a project. I'll check in the test project if it happens without path dependencies. |
Renovate doesn't yet support melos common dependencies, but you don't have to use common dependencies for linking local packages so it doesn't affect this issue. One thing you have to make sure though is that you also run bootstrap in the pipeline, with for example the melos-action. |
Just checked this in the test project, and it also happens without path dependencies (using |
I was afraid it would, thanks for checking! |
This comment was marked as off-topic.
This comment was marked as off-topic.
Hi Max 👋 |
Is there an existing issue for this?
Version
3.3.0
Description
Running some simple command like
melos exec echo
with or without--order-dependents
gives a different list of packages. Naturally, the order changes, but--order-dependents
also filters the list, apparently only to the dependent packages.Based on the parameter name and the description in
melos exec --help
, I would expect--order-dependents
to only order the list of packages, so that the command is run in dependent packages first, but it also filters the list to only the dependent packages.I'm not a 100 % sure if this is a bug or intended behavior, but at the very least the documentation could be clarified about this.
Steps to reproduce
melos exec
with or without--order-dependents
melos exec echo
runs in all packagesmelos exec --order-dependents echo
orders the dependent packages first, but does not run in all packagesExpected behavior
melos exec --order-dependents
should only order packages, not also filter them.Screenshots
No response
Additional context and comments
No response
The text was updated successfully, but these errors were encountered: