-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Accept an optional fail-script parammeter #1374
Comments
We already have a
The other bullet points seem way outside the scope of lerna itself, and would be more appropriate as a piped utility. |
Keep seeing `--no-bail` in the issues, but it is not clearly documented. lerna#1374 lerna#1364
@evocateur |
Exit codes are not exactly correlated to
|
Yeah that's what Im seeing I can PR it but it's obviously a change in behavior. |
Dang, that's what I was afraid of. I can't think of a workaround off the top of my head, short of not passing I'd even argue that it's a proper bug fix to propagate the non-zero exit code. Despite technically being a breaking change, it's actually the expected result of the feature. I guess we could add another flag, like |
Got here for the same exit code issue. I started using |
@spalladino @evocateur I'll create a separate issue for this |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hello,
Lerna is a great tool, we do use it on our company on a daily basis. However, it seems to be focused on executing it from an interactive terminal by a human. The recent additions of auto-confirmation and that stuff have increased it's usability on automated scenarios, but there is still lacking some features for continuous integration environments.
For example, some errors are thrown, while some others are just displayed and the exit code is successful to the OS. This leads to pipelines that have some lerna/npm failure that are reported as successful, but this is just half of the story.
When something fails on an npm command you usually want to know why and maybe do something about it. Npm usually collects information about the error on log files, that are not showed by default. Of course it is impossible for lerna to provide an error handling behavior that satisfies all the users on all the possible scenarios.
That is why I'm proposing to accept an optional fail script that will be executed when some lerna command fails, no matter the reason (usually npm).
When lerna fails you just see some error trace and the usual node error that a rejected promise has not been caught. Since this is a rejected promise that will contain the error, I think it may be easy to attach a custom error handler for it, and allowing the end-user to provide this error handler will provide great flexibility.
I think the easiest approach would be to require this error-handling script to be a javascript file exposing a single function intended to receive and handle the error. This can allow the following scenarios:
Those are just some ideas I can come with, I'm pretty sure that allowing this kind of flexibility will make more people to come with smarter solutions.
Regard
The text was updated successfully, but these errors were encountered: