Protected packages: Adding finder for PackageProtectionRule [Follow-up]
Summary
The following discussion from !124776 (merged) should be addressed, see discussion.
Currently, the evaluation of package protection rules is done in the class PackagePolicy
. This could be refactored because: =
- Logic for matching package protection rules cannot be reused by other components
- Complexity
PackagePolicy
is unnecessarily high
Related to Protected packages: Add basic model and migrati... (#416382)
Improvements
When extracting this in a dedicated finder service class, e.g. PackageProtectionRuleFinder
, PackageProtectionRuleEvaluator
, etc.
Risks
- This refactoring will involve the evaluation of the package protection rules.
- Existing test for
PackagePolicy
will not be changed and ensure expected behavior - New tests will be added for respective finder service class
Involved components
Packages::PackagePolicy
Optional: Intended side effects
Optional: Missing test coverage
Edited by Gerardo Navarro