CreateDockerWorkerVersion should allow adding refs to a revision of an existing version
Let's say you push a new tag on the master
branch of a worker. GitLab will run two CI pipelines, one for the commit on master
, and one for the same commit on your new tag. In the future, both pipelines will be running arkindex workers publish
to publish the new worker. Only one of the two commands will be successful though, because they will both call CreateDockerWorkerVersion
with the same arguments, except for revision_refs
which will be set to one branch ref in one pipeline, and one tag ref in the other. When CreateDockerWorkerVersion
finds that a worker version already exists on a revision, it fails:
{"__all__": ["A worker version already exists on this revision and this worker slug."]}
To support pushing on multiple branches or to support tags, we need to have CreateDockerWorkerVersion
support creating a new GitRef
on a revision of an existing worker version. We could also introduce a new CreateGitRef
endpoint, but the command would have to list every single worker version, find the one matching its arguments, take its revision ID and create the ref itself, which is a lot of work that the backend can do much more easily.