Skip to content

Protected packages: Reference regex directly in package protection rule

What does this MR do and why?

  • Reference required regex module Gitlab::Regex::Packages::Protection::Rules directly instead of using Gitlab::Regex
  • Extracted test for package-related regex in a subdirectory
  • Apply learnings from a discussion in a another MR that integrated the regex in ContainerRegistry::Protection::Rule, see !135972 (comment 1707866556)

🛠 with at Siemens

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

MR Checklist (@gerardo-navarro)

Screenshots or screen recordings

Only backend -related changes. No frontend changes.

How to set up and validate locally

  1. Execute the tests to ensure that it works as expected
bundle exec rspec spec/lib/gitlab/regex/packages/protection/rules_spec.rb  spec/lib/gitlab/regex_requires_app_spec.rb spec/models/packages/protection/rule_spec.rb 

Related to #416382

Edited by Gerardo Navarro

Merge request reports

Loading