Skip to content

Task configuration does not work as expected

I'm trying to test the debusine:task-configuration mechanism and it doesn't seem to work as expected.

I was expecting the sbuild work requests and the reverse_dependencies_autopkgtest workflow to have their changes applied but there's nothing:

  • the web interface shows "Task data after applying task configuration: Work request is not configured." (cf screenshot below) for both
  • looking up in the database, the configured_task_data is effectively unset, and dynamic_task_data does not contain any task_configuration_id

I then made a second test and restarted a workflow where I explicitly passed task_configuration=default@debusine:task-configuration, but it did not help: https://debusine.debian.net/debian/developers/work-request/132153/

The field is visible in task_data but still no task_configuration_id in dynamic_task_data and still no configured_task_data.

I can only explain this behaviour by this part of WorkRequest.configure_for_worker:

        # Instantiate the unconfigured task
        task = self.get_task(worker=worker)
        if not (task_configuration := task.data.task_configuration):
            # We have no configuration to apply: recompute dynamic_task_data
            # for this worker
            dynamic_task_data = task.compute_dynamic_data(TaskDatabase(self))
            self.dynamic_task_data = model_to_json_serializable_dict(
                dynamic_task_data, exclude_unset=True
            )
            return

We don't get any task.data.task_configuration to start with. But that doesn't make sense and shouldn't even be possible. In #508 (comment 577240) I tried to hint that we needed a default value for that field so that we could enable some configuration for all workflows where we made nothing special. I could not find any other reference to this, yet in my mind I remember suggesting default or default@debusine:task-configuration as the default value to use... so probably my fault for having not been clear on this.

From there I see multiple problems:

  1. Looking in BaseTaskData (in debusine/tasks/models.py) we are missing that default value. (done in !2160 (merged))
  2. WorkRequest.create_child() fails to pass the task_configuration to its child work requests so even when we set the configuration explicitly in the root workflow, the child work requests don't get it (or they get the default value instead of the value passed by the user, once we set a default value). (done in !2161 (merged))
  3. If we stick to a model where we don't set configured_task_data when the lookup of task_configuration fails, then we need to change the work request view (in the Internals tab) to make it clear that the task is configured but it just had no task_configuration changes applied. (done in !2163 (merged))

/cc @enrico

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