Protected packages: Reference regex directly in package protection rule
requested to merge gitlab-community/gitlab:416382-protected-packages-add-format-validation-for-package-name-pattern-follow-up-reference-package-regex-directly into master
What does this MR do and why?
- Reference required regex module
Gitlab::Regex::Packages::Protection::Rules
directly instead of usingGitlab::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)
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)
-
Changelog entry added, if necessary -
Documentation created/updated via this MR -
Documentation reviewed by technical writer or follow-up review issue created -
Tests added for this feature/bug -
Tested in all supported browsers -
Conforms to the code review guidelines -
Conforms to the merge request performance guidelines -
Conforms to the style guides -
Conforms to the javascript style guides -
Conforms to the database guides
Screenshots or screen recordings
Only backend -related changes. No frontend changes.
How to set up and validate locally
- 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