Add delete_remote_manifest function that deletes the existing Docker manifest via the registry v2 API before pushing. Works around Gitea bug #31964 where pushing an existing tag fails with HTTP 500.
REQ-1: delete_remote_manifest function using Docker registry v2 API
REQ-2: Called before each docker push in push_image
REQ-3: Credentials passed from main to push_image
REQ-4: Errors don't block the push (returns True on failure)
REQ-5: 100% test coverage
Closes DEVX-158
## Summary
Add `delete_remote_manifest` function that deletes the existing Docker manifest via the registry v2 API before pushing. Works around Gitea bug #31964 where pushing an existing tag fails with HTTP 500.
- REQ-1: `delete_remote_manifest` function using Docker registry v2 API
- REQ-2: Called before each `docker push` in `push_image`
- REQ-3: Credentials passed from `main` to `push_image`
- REQ-4: Errors don't block the push (returns True on failure)
- REQ-5: 100% test coverage
Closes DEVX-158
Gitea 1.27 fails with HTTP 500 when pushing a tag that already exists.
Add delete_remote_manifest() to delete the existing manifest via the
Docker registry v2 API before each push.
Implements: REQ-1, REQ-2, REQ-3, REQ-4, REQ-5
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Closing — superseded by master. The push-first strategy with HTTP 500 retry (tenacity) and conditional delete-on-"already exists" was implemented directly on master (commit DEVX-164 + follow-ups). This PR's preemptive-delete-before-push approach is actually a regression — it deletes manifests unnecessarily on every push. Master now has:
PushHTTP500Error + _run_push with 500 detection
Tenacity retry (5 attempts, exponential backoff)
Push-first: only calls delete_remote_manifest when push fails with "already exists"
The delete_remote_manifest function from this PR was kept and is used by the push-first strategy.
Closing — superseded by master. The push-first strategy with HTTP 500 retry (tenacity) and conditional delete-on-"already exists" was implemented directly on master (commit DEVX-164 + follow-ups). This PR's preemptive-delete-before-push approach is actually a regression — it deletes manifests unnecessarily on every push. Master now has:
- `PushHTTP500Error` + `_run_push` with 500 detection
- Tenacity retry (5 attempts, exponential backoff)
- Push-first: only calls `delete_remote_manifest` when push fails with "already exists"
- Comprehensive tests (`test_no_delete_on_success_with_creds`, `test_delete_and_retry_on_already_exists`, `test_retry_also_fails`, etc.)
The `delete_remote_manifest` function from this PR was kept and is used by the push-first strategy.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
Add
delete_remote_manifestfunction that deletes the existing Docker manifest via the registry v2 API before pushing. Works around Gitea bug #31964 where pushing an existing tag fails with HTTP 500.delete_remote_manifestfunction using Docker registry v2 APIdocker pushinpush_imagemaintopush_imageCloses DEVX-158
Closing — superseded by master. The push-first strategy with HTTP 500 retry (tenacity) and conditional delete-on-"already exists" was implemented directly on master (commit DEVX-164 + follow-ups). This PR's preemptive-delete-before-push approach is actually a regression — it deletes manifests unnecessarily on every push. Master now has:
PushHTTP500Error+_run_pushwith 500 detectiondelete_remote_manifestwhen push fails with "already exists"test_no_delete_on_success_with_creds,test_delete_and_retry_on_already_exists,test_retry_also_fails, etc.)The
delete_remote_manifestfunction from this PR was kept and is used by the push-first strategy.Pull request closed