mirror of
https://github.com/quay/quay.git
synced 2026-01-26 06:21:37 +03:00
This commit implements the core enforcement layer for tag immutability, which prevents immutable tags from being deleted, overwritten, or permanently removed from the time machine. Changes: - Add ImmutableTagException class with tag_name, operation, and repository_id fields for detailed error reporting - Enforce immutability in delete_tag() - raises exception for immutable tags - Enforce immutability in retarget_tag() - prevents overwriting immutable tags, respects raise_on_error parameter - Enforce immutability in remove_tag_from_timemachine() - blocks permanent deletion for both alive and expired immutable tags - Add is_tag_immutable() - returns True/False/None for tag lookup - Add set_tag_immutable() - updates immutability with optimistic locking The immutable column, indexes, and log entry kind were previously added in migration 5b8dc452f5c3. This commit adds the enforcement logic and utility functions that use those database structures. Signed-off-by: Brady Pratt <bpratt@redhat.com> Co-authored-by: Claude <noreply@anthropic.com>