Implement changes for sub-workflow coordination
Please implement the design in https://freexian-team.pages.debian.net/debusine/reference/devel-blueprints/workflow-coordination.html (see !1079 (merged) and !1084 (merged)). We need the following changes:
-
debusine:promisebare data: add category name todebusine.artifacts.models.BareDataCategory, and add a pydantic model for it (we don't have any models for bare data yet, but I guess somewhere indebusine.artifacts.modelswould do; it will needextra = pydantic.Extra.allowin its configuration, plus a root validator to forbid extra names starting withpromise_) -
arrange to validate bare data in collections against pydantic models if available; I guess this could go in CollectionItemManager.create_from_bare_data, maybe? -
change WorkflowInternalManager.do_add_bare_datato forbid names starting withpromise_unless the category isdebusine:promise -
change WorkflowInternalManager.do_add_artifactto copyvariablesinto per-item data, and to forbid names starting withpromise_ -
change WorkflowInternalManager.do_add_artifactto allow an artifact to replace either bare data or another artifact (seeDebianPackageBuildLogsManager.do_add_artifact), so that a real artifact can replace a promise -
change WorkRequest._retry_supersedeto update the work request ID in any promises associated with the work request being retried -
change the scheduler to only call populate_workflowfor root workflows, not sub-workflows (we'll work out the exact way that root workflows populate sub-workflows once we're implementing a real example of such a thing) -
add WorkfloworWorkRequesthelper methods to declare that a work request provides output / requires input (I'm not sure exactly what their signatures should be; let me know if you need more help defining these) -
change SbuildWorkflowto make each of itssbuildtask children providebuild-{architecture}output
The last two tasks here should be done together to make sure that the helper methods have useful interfaces, but the others are mostly independent.
Edited by Colin Watson