Enforce CI Lint rate limit by default
What does this MR do and why?
Enforce CI Lint rate limit by default
Remove the ci_enforce_ci_lint_rate_limit feature flag so requests over ci_lint_limit_per_user are always rejected with 429, and lint requests are always excluded from the pipeline creation rate limits.
The limit defaults to 0 (unlimited) on every instance after the 19.5 reset migration. Lint requests that don't simulate a pipeline no longer count toward the pipeline creation limits, so on instances that set pipeline creation limits but no CI Lint limit, those requests are no longer rate limited.
Document the GitLab.com value of 400 requests each minute.
Changelog: added
References
Relates to https://gitlab.com/gitlab-org/gitlab/-/work_items/599486 and https://gitlab.com/gitlab-org/gitlab/-/work_items/602468
How to set up and validate locally
-
In the Admin area, go to Settings > Network > Pipeline creation rate limits and set Maximum number of CI Lint requests for a user to
1. Confirm the hint about theci_enforce_ci_lint_rate_limitfeature flag no longer appears under the field. -
Send two lint requests within one minute (replace
<project_id>and<token>, a personal access token with theapiscope for a user with at least the Developer role):for i in 1 2; do curl -s -o /dev/null -w "%{http_code}\n" \ --header "PRIVATE-TOKEN: <token>" --header "Content-Type: application/json" \ --data '{"content": "test:\n script: echo ok"}' \ "http://127.0.0.1:3000/api/v4/projects/<project_id>/ci/lint" doneExpected:
200, then429, without any feature flag enabled. -
Confirm the rejected request is logged as enforced:
grep "CI Lint rate limit exceeded" log/application_json.log | tail -1Expected: the entry includes
"throttled":true. -
Set the CI Lint limit back to
0and repeat step 2. Expected:200both times (no limit). -
To check that Pipeline Editor lint requests no longer count toward the pipeline creation limit, set Max requests per minute per user to
1, keep the CI Lint limit at0, and run this mutation three times in GraphiQL (http://127.0.0.1:3000/-/graphql-explorer):mutation { ciLint(input: { projectPath: "<full/project/path>", content: "test:\n script: echo ok" }) { config { status } errors } }Expected: every call returns
VALIDwith no errors. -
With the same settings, add
dryRun: trueto the mutation input and run it twice. Expected: the first call returnsVALID, the second returnsINVALIDwithToo many pipelines created in the last minute. Try again later.Pipeline simulations still count toward the pipeline creation limit, which shows the limit in step 5 was active. -
Reset both limits to their previous values.
The rate limit is per user and resets every minute. If a step returns an unexpected 429, wait one minute and try again.
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.
Related to #599486