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

Executing a dev/task should print a "Task completed, time taken %s" after completion. #7992

Closed
silbinarywolf opened this issue Apr 11, 2018 · 5 comments

Comments

@silbinarywolf
Copy link
Contributor

The problem

On an internal poll, it was found that developers preferred the use of the web interface for running dev/tasks, however various third party modules or old code doesn't actually echo a message when a dev/task has completed properly.

In the CLI this is not much of an issue as there won't be a PHP timeout and you'll know when the execution is complete and you'll be able to type in a new command.

In web however, a PHP timeout could occur and you'll be stuck with zero indication on whether the task completed properly or not. I also already understand that ideally a dev/task shouldn't be failing / timing out at all but in practice this generally ends up being a problem.

The solution

Add a message after running the BuildTask::run() that says something like "Task completed. Time taken: %s". (We could measure how long it took as a sort of bonus feature of adding this in)

@silbinarywolf silbinarywolf changed the title Executing a dev/task should print a "Task completed, time taken %s" or similar message. Executing a dev/task should print a "Task completed, time taken %s" after completion. Apr 11, 2018
@robbieaverill
Copy link
Contributor

I'd be keen on this idea, but not (to make it any worse) until we have a better CLI system to be honest. Related: #5542

That being said, the way build tasks output is messy already, so adding something like this wouldn't make much of a difference in my opinion.

What do others think?

@torleif
Copy link
Contributor

torleif commented Apr 25, 2018

We use an extension of the build task which has some extra functionality. We get around the time out issue by having a task which will splits the task into bit sized chunks.

it's handy because if you're running on cli it will behave like normal, but in the browser the user will see a nice window like this:

image

Our approach is much more user friendly (and looks a lot better 😃). if a task is manual, it's better to have the browser as a first class citizen. Some environments are not geared up for cli, and it's easier for non technical users to run them.

I'd love to see SilverStripe with a BuildTask extension which would poll the completion status as opposed to simply timing out.

@maxime-rainville
Copy link
Contributor

@torleif Is this something you guys did yourself or are you using a third party package to accomplish this?

@torleif
Copy link
Contributor

torleif commented Apr 30, 2018

@maxime-rainville it's something we built in house. we do use bootstrap to make the style (especially the progress bar) look nice

Edit: we open sourced some of it here: https://github.com/otago/remote-asset-download

keep in mind the task is not generic here, it's specific to a remote asset downloading

@robbieaverill
Copy link
Contributor

I think we should move this to an idea on the RFC for a Symfony based console instead, it's unlikely to be done in the 4.x release line without that being implemented first

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

4 participants