So we've had this discussion me and Adrian about how we could avoid creating multiple task nodes per site, for the same task. For example, it doesn't make much sense to have multiple "verify" tasks for one site, the verify task should just be retried when we reschedule a verification. That would make things clearer in the UI and would allow neat things like recurrent tasks (#422962: Add Hosting Tasks Schedule module). (Think backups #422966: automated backups (and backups garbage collection), but we also want to periodically verify tasks.)
Older task logs should be stored in revisions, so some UI work will need to be done there. We may also think about garbage-collecting older tasks.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | site_tasks.png | 42.87 KB | univate |
| #8 | hosting_task_collapse.diff | 27.61 KB | adrian |
| #8 | Picture 54.png | 46.24 KB | adrian |
| #6 | hosting-422970-5.patch | 3.6 KB | univate |
| #2 | 0007--422970-implement-proper-revisions-on-task-nodes-s.patch | 1.83 KB | anarcat |
Comments
Comment #1
anarcat commentedI have basically implemented this by enabling proper revisions. There is usually one too many revision created, and the UI could need some help, but that's basically just it. I can't push to CVS or git because of firewalling issue, so I attach a good ol' patch.
Comment #2
anarcat commentedUpload failed, trying again.
Comment #3
Anonymous (not verified) commentedWorks as expected
Comment #4
Anonymous (not verified) commentedComment #5
anarcat commentedSo i worked further on all the tasks stuff on my laptop, but it's stuck there. I'll try to extract that tonight or tomorrow.
Comment #6
univate commentedYou may have already fixed these but there are a couple of issues that I noticed with the current patch that is attached here:
(1) when re-running a task it doesn't move it to the top of the task queue, the obvious change here is to order the task list by the node changed field instead of nid.
(2) the timestamp in the hosting_task_queue doesn't get updated, the main problem with this is if you had a lot of tasks queued you could end up with a case where tasks never get run. The fix is to set the timestamp when running hosting_task_update.
The attached patch rolls these changes into the previous patch.
Comment #7
anarcat commentedActually, the hosting_task_queue table gets completely dropped in a later patch. So the second part isn't necessary. But I agree the first part probably is.
Comment #8
adrian commentedhere's the latest version of the patch, so that non git people can play along.
It's a very good patch and it works as advertised, there are a couple of issues with it, primarily on the user interface level.
1. it's not clear that the task type link will create a task for you
2. some tasks are linked and some aren't, with no rhyme or reason
3. the linked 'executed' column is very confusing, you have no idea what you will be getting when you click on it.
4. the order of the items will be very important to make them useful, at the very least they should be something like :
queued tasks (in order of creation / processing)
completed tasks ( in reverse order of completed)
never queued tasks (alphabetical order).
The user always wants to see what's happening (first priority), what has already happened and then what they can further do.
5. even tho the disable task is queued there is still a link to it. this is a side effect of the text item being a link, you aren't clear if your creation worked or what is happening.
6. It feels kind of weird to have a disable and enable task in the same queue with no way of knowing what the last one was. this is a side effect of 4 and that we have 2 tasks for this, not a toggle.
concerns :
1. how is the permission checking happening in this new format? is the permission to view task logs broken down per task now too ?
2. what happens when someone else schedules a task, do i still get permission to see it? who owns them?
3. i know this is my because of how it is implemented, but the migrate tab on the platform now looks out of place, how about a hook to add additional 'tasks' even if they aren't really tasks?
Comment #9
anarcat commenteduser interface issues:
Well, the confirmation dialog after makes that clear enough. How can it be made clearer?
It depends on the permissions, basically. I decided to show the task anyways, so see what could be possible, but changing this back is a simple fix. I figured that hiding tasks is not necessarly a good practice because then people have no idea what they *can* do (e.g. they don't know that they can delete a site at all).
You're getting the task log. Seems obvious enough for me. Maybe we can put a little "journal" logo or something?
Okay, maybe we can make three separate blocks, but I'm not sure that's actually what "the user" wants... I am perfectly happy with having all tasks together, for example.
Well, it's clear because it's blue, it says "queued" and there's now a link to the task. There was still a tab to the task before this patch: you could queue multiple similar tasks together. This patch doesn't fix that issue (and it's a separate issue for me).
Yeah, this should be a single task, but I consider this a separate issue (although 4. is still an issue here).
Now for your concerns :
Permission checking is completely unchanged, normally, apart that you see all tasks. Normal node-level permissions should still apply.
That is unchanged.
There's a "hook_hosting_tasks()", isn't that enough? I also added "hook_hosting_auto_tasks()" to declare help and description for tasks like install/import that are not handled by the user, maybe we could have a "hook_hosting_pseudo_task()" for ... pseudo tasks like batch migrate...
Comment #10
univate commentedI like this feature a lot, much cleaner way of seeing whats exactly happening with any site.
I think if you are going to divide the table, it should just be into 2 parts, task that you can add to the queue and tasks that are disable.
There are a couple of small changes I would suggest for the task table:
* leaving the executed column for dates (e.g. even if the backup is queued, its still useful to be able to see when the last backup was done).
* change the 'action' column to something more like 'status' and still use that for adding the "re-run/retry" task buttons on a failed task, but also use that as the place to display the state of any task like the message "queued". I can also see that column being used for other messages, like "scheduled" for tasks that get run automatically (e.g. backups).
I have attached a mock-up to illustrate better what I am meaning.
Comment #11
anarcat commentedThis code was merged into CVS. At this point, the only remaining issues I saw raised here where user interface issues that diverge from the original issues, so I'll close this issue and discussion can move on #454400: streamline the task interface or new issues.