Public Access
DEVX-158: fix: delete existing manifest before push (Gitea #31964 workaround)
Co-authored-by: emo <emo@oblachno.com>
This commit was merged in pull request #290.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
# 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_image` with 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
|
||||
- [x] REQ-1: `delete_remote_manifest` function added
|
||||
- [x] REQ-2: Called before each push in `push_image`
|
||||
- [x] REQ-3: Credentials passed from `main` to `push_image`
|
||||
- [x] REQ-4: Errors don't block the push (returns True on failure)
|
||||
- [x] REQ-5: 100% test coverage
|
||||
Reference in New Issue
Block a user