feat: add support for container registry tag protection rules

Description

This Merge Request adds support for GitLab's Container Registry Tag Protection Rules API. This allows users to configure and manage tag protection rules for their container registries, preventing unintended pushes or deletions of specific tags in a project.

GitLab API Reference: https://docs.gitlab.com/api/container_registry_protection_tag_rules/

Changes

  • New Service: Added ContainerRegistryTagProtectionRulesService inside container_registry_tag_protection_rules.go with the following API endpoints:
    • ListContainerRegistryTagProtectionRules (GET /projects/:id/registry/protection/tag/rules)
    • CreateContainerRegistryTagProtectionRule (POST /projects/:id/registry/protection/tag/rules)
    • UpdateContainerRegistryTagProtectionRule (PATCH /projects/:id/registry/protection/tag/rules/:rule_id)
    • DeleteContainerRegistryTagProtectionRule (DELETE /projects/:id/registry/protection/tag/rules/:rule_id)
  • Wiring: Registered the service on Client and initialized it in NewAuthSourceClient in gitlab.go.
  • Mocks & Testing Client: Regenerated mock interfaces and maps to include the new service.
  • Unit Tests: Added comprehensive test coverage in container_registry_tag_protection_rules_test.go covering listing, creating, updating, and deleting rules.

Ticket reference: #2258

Merge request reports

Loading