Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-82173

Improve task reports and logs for custom data, task id, and exposing errors

    • MDL-82173-task-custom-data
    • Hide
      1. Install this plugin to help with testing
        https://github.com/catalyst/moodle-tool_testtasks
      2. Run this to create some test adhoc tasks
        php admin/tool/testtasks/cli/queue_adhoc_tasks.php -n=20 -s=50
      3. Run cron to execute these and make some logs
        php admin/cli/adhoc_task.php -e
      4. While that is running visit 
        admin/tool/task/runningtasks.php
      5. Confirm there is a new column for custom data
      6. Visit /admin/tasklogs.php
      7. Confirm you see all the logs for these tasks
      8. Confirm that roughly half of the tasks have failed and that the failure is shown as a red badge and rows (ignore the bug with some rows not showing the red background see MDL-85523)
      9. Confirm you see a new column exposing the Custom Data
      10. Run the normal cron to populate the logs with many different types of tasks
        php admin/cli/cron.php
      11. Confirm you see them all in /admin/tasklogs.php
      12. Confirm you can filter to just one task eg Task ID 'is equal to' = 769
      13. Remove that filter
      14. Confirm you can filter tasks based on custom data, eg Custom Data,  contains = 'loopdelay'
      Show
      Install this plugin to help with testing https://github.com/catalyst/moodle-tool_testtasks Run this to create some test adhoc tasks php admin/tool/testtasks/cli/queue_adhoc_tasks.php -n=20 -s=50 Run cron to execute these and make some logs php admin/cli/adhoc_task.php -e While that is running visit  admin/tool/task/runningtasks.php Confirm there is a new column for custom data Visit /admin/tasklogs.php Confirm you see all the logs for these tasks Confirm that roughly half of the tasks have failed and that the failure is shown as a red badge and rows (ignore the bug with some rows not showing the red background see MDL-85523 ) Confirm you see a new column exposing the Custom Data Run the normal cron to populate the logs with many different types of tasks php admin/cli/cron.php Confirm you see them all in /admin/tasklogs.php Confirm you can filter to just one task eg Task ID 'is equal to' = 769 Remove that filter Confirm you can filter tasks based on custom data, eg Custom Data,  contains = 'loopdelay'
    • Hide

      Fails against automated checks.

      Checked MDL-82173 using repository: https://github.com/brendanheywood/moodle

      Should these errors be fixed?

      Built on: Mon May 19 03:55:49 UTC 2025

      Show
      Fails against automated checks. Checked MDL-82173 using repository: https://github.com/brendanheywood/moodle main [branch: MDL-82173-task-custom-data | CI Job ] Error: The MDL-82173 -task-custom-data branch at https://github.com/brendanheywood/moodle does not apply clean to origin/main Error: Merge conflict(s) in file(s): Error: version.php Should these errors be fixed? Built on: Mon May 19 03:55:49 UTC 2025
    • Show
      Launching automatic jobs for branch MDL-82173 -task-custom-data https://ci.moodle.org/view/Testing/job/DEV.02%20-%20Developer-requested%20PHPUnit/17253/ PHPUnit (sqlsrv) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/58792/ Behat (NonJS - boost and classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/58793/ Behat (Firefox - boost) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/58794/ Behat (Firefox - classic) https://ci.moodle.org/view/Testing/job/DEV.01%20-%20Developer-requested%20Behat/58795/ App tests (stable app version) Built on: Wed Nov 6 04:25:13 AM UTC 2024

      Lets say we have a plugin that does stuff and queues up an adhoc task, and it has custom data of {course: 12345}

      In it's own logs it knows that the custom data was, it would be very nice to be able to deep link into the task logs page filtered to just the specific tasks we are interested in:

      /admin/tasklogs.php?customdata=course:123

      This would show all the instances of this task type with that specific custom data.

      Or you should be able to search by the adhoc task id and see all the instance of that run (maybe is failed twice and then ran) like this:

      /admin/tasklogs.php?taskid=2641

      This is blocked by report builder generally not having deep links (see MDL-73292), and specifically here by not being able to filter via either the adhoc task id, or the custom data.

            brendanheywood Brendan Heywood
            brendanheywood Brendan Heywood
            Djarran Cotleanu Djarran Cotleanu
            Paul Holden Paul Holden
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.