Skip to content

Record the created artifacts

Original text from #66 (closed):

It seems likely that we will want to be able to (programmatically) figure out what artifacts have been created by a given work request. So we should also modify the API used to report a work request as completed so that we can indicate the list of artifacts that have been created. Or maybe that should be recorded as a side-effect of the artifact creation? I'm not sure.

Plan:

  1. Create a new model: WorkRequestArtifactRelation (only with "work_request" and "artifact". I guess that no "type" of relation on this one)
  2. Create new API endpoints to create WorkRequestArtifactRelation for a WorkRequest - Artifact
  3. Extend debusine client to use the new endpoint for creating WorkRequestArtifactRelation
  4. In Worker._execute_work_request_and_submit_result: pass "work_request.id" to the constructor (unless we prefer to set like what we did with configure_server_access(). Something like self._task_running = Task.class_from_name(work_request.task_name)(work_request.id) (could be an optional parameter anyway).
  5. In Worker, when it's already creating relations between the Artifacts: also create the WorkRequestArtifactRelations as needed
  6. Make the WorkRequestArtifactRelation available (via new API endpoint or enriching the existing work-request status endpoint)

The original text from #66 (closed) says:

So we should also modify the API used to report a work request as completed so that we can indicate the list of artifacts that have been created.

My first thought was to create a new endpoint to list the artifacts for a work request (since we are creating plumbing commands) and a new CLI to list the artifacts for a work request.

Edited by Carles Pina i Estany
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information