Add max limit to fetch query for group secrets
What does this MR do and why?
Group projects have an upper limit of 500, but we only fetch the first 100. This MR updates the query to fetch a maximum of 500 group secrets, since we do not have pagination implemented yet. Performance doesn't seem to be an issue. See How many secrets before Secrets Manager too slow/timeout?.
References
See How many secrets before Secrets Manager too slow/timeout?
Pagination will be tackled after GA, in #590913. This idea is to implement search functionality first so we can implement pagination.
Screenshots or screen recordings
How to set up and validate locally
- Upload a Premium license (or above).
- Set up openbao and enable the secrets manager on your gdk.
- Enable the
secrets_managerandgroup_secrets_managerfeature flags. - Go to your group settings (Settings > General) and expand Permissions and group features. Enable the secrets manager for your group with the settings toggle.
- Run the following on rails console to seed your group with secrets:
user = User.find_by_username('root') group = Group.find_by_name('group-with-500-secrets') Labkit::Correlation::CorrelationId.use_id('perf_test_static') do RequestStore.begin! begin 500.times do |i| SecretsManagement::GroupSecrets::CreateService.new(group, user).execute( name: "SECRET_#{i+1}", description: 'A secret', value: "secret-value-#{i+1}", environment: '*', protected: true ) end ensure RequestStore.end! RequestStore.clear! end end - Go to
/path-to-group/secretsand verify that all 500 secrets are loaded.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.