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

Provide flag like --force to continue running subsequent tasks, even when a task errored #871

Closed
geekflyer opened this issue Jan 17, 2015 · 9 comments

Comments

@geekflyer
Copy link
Contributor

Hi,

I'm looking for the ability to continue running gulp tasks, even when some of them failed, similar to the --force option in grunt. In addition it would be nice If gulp would report a summary at the end, giving a list of tasks which failed and return a proper non zero exit code if there are some.

Generally it appears the error handling / logging is a bit subpar at the moment (compared to grunt with it's multiple loglevels etc.).

I would be willing to code some stuff and send pull requests to improve this, though I wanted to discuss this here first. For me this a rather important topic as we use gulp a lot for running various types of tests (backend, ui unittest, ui integrationtests) and we don't want to skip all the other tests just because single test or jshint etc. failed. I know I can basically code most tasks in a way that errors generally get handled by the task itself, but that's often ugly, verbose and using this approach gulp will return an exit code of 0, even though some steps actually failed.

Just some observations from my initial research / try out stuff on this topic:

  • the bach module contains settleSeries and settleParallel which could be used to continue running a task chain, even when some failed. (I added it to undertaker and it worked).

So, what are your thoughts? I appreciate any hints for implementing this, If you like such a feature.

@geekflyer geekflyer changed the title [Gulp4] Provide flag like --force to continue running subsequent tasks, even when a task failed [Gulp4] Provide flag like --force to continue running subsequent tasks, even when a task errored Jan 17, 2015
@yocontra
Copy link
Member

Duplicate of #359 and #358

@phated
Copy link
Member

phated commented Jan 18, 2015

My idea was that the CLI flag would swap bach.series/parallel for the settle equivalents. This hasn't been implemented yet.

@phated phated added the gulp4 label Jan 18, 2015
@phated phated added this to the gulp 4 milestone Jan 18, 2015
@yocontra yocontra modified the milestones: gulp 4.1, gulp 4 Jan 27, 2015
@heikki heikki changed the title [Gulp4] Provide flag like --force to continue running subsequent tasks, even when a task errored Provide flag like --force to continue running subsequent tasks, even when a task errored Feb 14, 2015
phated added a commit to gulpjs/undertaker that referenced this issue Mar 14, 2015
@phated
Copy link
Member

phated commented Mar 14, 2015

@geekflyer can you take a look at the 4.0 branch and see if it achieves what you are looking for? I believe I have addressed the issue but I'm not sure of the ideal logging or the command-line flag. Let the bikeshedding commence.

@phated phated modified the milestones: gulp 4, gulp 4.1 Mar 14, 2015
@geekflyer
Copy link
Contributor Author

@phated Just tried it out and it seems pretty cool, thanks! The logging is fine and also it's good that it still returns a non-zero exit code if one of the tasks fails. I'll update my projects to it and use it in production a few days.

@phated
Copy link
Member

phated commented Mar 16, 2015

@geekflyer much appreciated

@phated
Copy link
Member

phated commented Apr 1, 2015

@geekflyer any more feedback on this?

@yocontra
Copy link
Member

yocontra commented Apr 2, 2015

Marking this as done since it seems to work for everyone who requested it

@yocontra yocontra closed this as completed Apr 2, 2015
@geekflyer
Copy link
Contributor Author

@phated The feature works fine on multiple machines - thanks again. Didn't notice any bugs.
I could just think of some enhancements like a list of succeeded and failed tasks at the end, but that's out of scope in this issue.

@geekflyer
Copy link
Contributor Author

just for everyone who looks into this issue again.
The new flag that phated implemented to continue running subsequent tasks, even if previous tasks failed is --continue. It behaves a bit similar to --force from grunt.

usage example: gulp build --continue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants