Backport of "Make CI cache limit per job configurable by admins"

What does this MR do and why?

Backport of !239413 into 18-11-stable-ee for the 18.11 patch release.

Makes the CI cache limit per job configurable by admins. Previously, the number of cache entries a single CI/CD job could define was hardcoded to a maximum of 4. For some users, this limit was too restrictive, while for others a higher limit can cause pipeline creation performance issues (because cache:key:files triggers Gitaly calls).

This MR introduces a new instance-level application setting, ci_max_caches_per_job, that lets administrators tune this limit:

  • Adds the ci_max_caches_per_job CI/CD application setting (default: 4, must be > 0).
  • Replaces the hardcoded MULTIPLE_CACHE_LIMIT = 4 in Gitlab::Ci::Config::Entry::Caches with the configured value from Gitlab::CurrentSettings.
  • Removes the corresponding maxItems: 4 constraint from the build_metadata_config_options JSON schema so the runtime setting is the source of truth.
  • Exposes the setting in the Admin Area UI (Admin > Settings > CI/CD > Continuous Integration) with a Beta badge and explanatory copy.
  • Exposes the setting through the Application Settings API (PUT /application/settings) and updates the OpenAPI spec.
  • Adds user-facing documentation under doc/administration/settings/continuous_integration.md.
  • Updates specs (model validations, feature spec for the admin UI, and Caches entry spec) and the locale .pot file.

Related issue: #421962.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

  • This MR is backporting a bug fix, documentation update, or spec fix, previously merged in the default branch.
  • The MR that fixed the bug on the default branch has been deployed to GitLab.com (not applicable for documentation or spec changes).
  • The MR title is descriptive (e.g. "Backport of 'title of default branch MR'"). This is important, since the title will be copied to the patch blog post.
  • Required labels have been applied to this merge request
  • This MR has been approved by a maintainer (only one approval is required).
  • Ensure the e2e:test-on-omnibus-ee job has succeeded, or if it has failed, investigate the failures. If you determine the failures are unrelated, you may proceed. If you need assistance investigating, request help in the #s_developer_experience Slack channel to confirm the failures are unrelated to the merge request.

Note to the merge request author and maintainer

If you have questions about the patch release process, please:

Edited by Mayra Cabrera

Merge request reports

Loading