Protected packages: Convert attribute `push_protected_up_to_access_level` to enum [Follow-up]
Summary
The following discussion from !124776 (merged) should be addressed:
-
@gerardo-navarro started a discussion: (+2 comments) While applying your reviewer feedback, I realized that the attribute
push_protected_up_to_access_level
could be converted into a rails enum. This way, we might add automatic validations and other utilities for the attribute.enum push_protected_up_to_access_level: { developer: Gitlab::Access::DEVELOPER, maintainer: Gitlab::Access::MAINTAINER, owner: Gitlab::Access::OWNER }, _prefix: :push_protected_up_to
@dmeshcharakou What do you say? I would do this as follow-up MR.
Related to Protected packages: Add basic model and migrati... (#416382)
Improvements
- Attribute
push_protected_up_to_access_level
could be converted into a rails enum - This way, we might add automatic validations and other utilities for the attribute
Risks
- Only low risk as this implementaiton is covered by tests
- The model
PackageProtectionRule
was newly introduced behind a feature flag
Involved components
The model Packages::PackageProtectionRule
Optional: Intended side effects
Optional: Missing test coverage
Edited by Gerardo Navarro