Skip to content

Override the priority of a workflow with task configuration

Request

In #973 (closed), we modified the priority of child workflows from reverse_dependencies_autopkgtest to be smaller than the effective priority of the parent workflow.

Instead of hardcoding this in the code like we did, it would be nice if we could control this with some debusine:task-configuration entries.

Implementation plan

We could modify BaseTaskData to add an extra field children_priority_adjustment and then ensure that WorkRequest.create_child applies that adjustment to the priority field of the child work requests that gets created.

For all workflows, the value would default to 0 but for reverse_dependencies_autopkgtest we would override that value to -5.

Open questions

  • The suggested children_priority_adjustment can be confused with the priority_adjustment database field on the WorkRequest object, maybe we should find a better name?
  • Instead of adding a new task_data field, would it make sense to enhance task configuration to be able to inject a value to initialize priority_adjustment directly at the time of creation of the task? Or to tweak the priority field instead?

Notes

This issue description can be modified to integrate feedback from comments and from associated merge requests.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information