1.6 KiB
DEVX-158: Fix build-images workflow: delete existing manifest before push
Problem
Gitea 1.27 has a known bug (#31964) where pushing a Docker image tag that
already exists in the container registry fails with HTTP 500 "package
version already exists." The build-images workflow has been failing for weeks because
every push to ci-base:latest, ci-quality:latest, and ci-full:latest
hits this error.
Approach
Add a delete_remote_manifest function that deletes the existing manifest
via the Docker registry v2 API before pushing. This works around the Gitea
bug by ensuring the tag doesn't exist when the push starts.
REQ-1: Add delete_remote_manifest function using Docker registry v2 API
REQ-2: Call delete_remote_manifest before each docker push in push_image
REQ-3: Pass registry credentials from main to push_image
REQ-4: Handle errors gracefully — never block the push if delete fails
REQ-5: 100% test coverage for new code
Test Plan
- Unit tests for
delete_remote_manifest(success, 404, 500, network error) - Unit tests for
push_imagewith and without credentials - Verify existing tests still pass
Deploy Plan
- Merge to master, auto-release new devx version
- The build-images workflow will use the new code on the next run
Rollback Plan
- Revert the merge commit
Acceptance Criteria
- REQ-1:
delete_remote_manifestfunction added - REQ-2: Called before each push in
push_image - REQ-3: Credentials passed from
maintopush_image - REQ-4: Errors don't block the push (returns True on failure)
- REQ-5: 100% test coverage