Update existing GitRefs in CreateDockerWorkerVersion
Closes #1641 (closed)
I stumbled upon multiple other issues while trying to fix this:
-
Retrying a CI pipeline that calls
arkindex workers publishcould cause this endpoint to move refs backwards. For example, you push commit A then commit B onmaster, and then retry the pipeline on commit A: the last API call will be for commit A, so in Arkindex, branchmasterwill appear to be on commit A. Fixing this possibly requires raw SQL or changing the serializer fields. -
Git allows a branch and a tag to have the same name, but we don't. You could hit this if you had a
1.0branch that then becomes the1.0tag. This can lead to incomprehensible behaviors where one of the two refs is ignored, or a tag is moved to where a branch should be. -
GitRefs are not sorted in any API response that returns revisions, which could lead to intermittent test failures. I hit this locally when writing a new test, but it had never happened on other tests for this endpoint.
-
There is a possibility that the API response of this endpoint might not return the correct GitRefs for an existing revision (the new case introduced in !2152 (merged)), I still need to test this.