Allow setting arbitrary integer values for keep_n_duplicated_package_files for package registry cleanup
Proposal
Allow setting arbitrary values for keep_n_duplicated_package_files
in Packages::Cleanup::Policy
.
Currently, you can only set this to specific values in a list, and these are validated by the GraphQL mutation and the model.
Rationale
Customer has approached GitLab Support asking whether it's possible to set this value to an arbitrary number (eg 2
), as they only want to keep 2 duplicate assets.
The list of accepted values is currently duplicated in many places:
-
KEEP_N_DUPLICATED_PACKAGE_FILES_OPTIONS
: https://gitlab.com/gitlab-org/gitlab/-/blob/f0f337cad16993cb4ae61390b7d7ab9067d5b559/app/assets/javascripts/packages_and_registries/settings/project/constants.js#L86-94 -
Types::Packages::Cleanup::KeepDuplicatedPackageFilesEnum
: https://gitlab.com/gitlab-org/gitlab/-/blob/f0f337cad16993cb4ae61390b7d7ab9067d5b559/app/graphql/types/packages/cleanup/keep_duplicated_package_files_enum.rb#L9-17 -
KEEP_N_DUPLICATED_PACKAGE_FILES_VALUES
: https://gitlab.com/gitlab-org/gitlab/-/blob/f0f337cad16993cb4ae61390b7d7ab9067d5b559/app/models/packages/cleanup/policy.rb#L8