Add enforce_ci_builds_pagination_limit feature flag
What does this MR do and why?
Previously enforcement of keyset pagination for Ci::Build
requests
was not active. This commit adds a feature flag that will allow
enforcement of offset pagination limits to prevent slow database
queries.
Relates to https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/24660
How to set up and validate locally
- Check out this branch.
- Log in to your GitLab instance.
- In the browser, try to access:
http://gdk.test:3000/api/v4/projects/1/jobs?page=600&per_page=100
. This should return empty results (assuming you don't have thousands of builds). - In
bin/rails console
, runFeature.enable(:enforce_ci_builds_pagination_limit, Project.find(YOUR-PROJECT-ID)
. - Wait 60 seconds or so and repeat step 3. This should result in an error:
{"error":"Offset pagination has a maximum allowed offset of 50000 for requests that return objects of type Ci::Build. Remaining records can be retrieved using keyset pagination."}
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Merge request reports
Activity
assigned to @stanhu
changed milestone to %16.6
added featureaddition production request typefeature labels
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@25c73e5d
- Resolved by Stan Hu
2 Warnings featureaddition and featureenhancement merge requests normally have a documentation change. Consider adding a documentation update or confirming the documentation plan with the Technical Writer counterpart.
For more information, see:
- The Handbook page on merge request types.
- The definition of done documentation.
This Merge Request needs to be labelled with feature flagexists, feature flag, backend. Please request a reviewer or maintainer to add them. Reviewer roulette
Changes that require review have been detected!
Please refer to the table below for assigning reviewers and maintainers suggested by Danger in the specified category:
Category Reviewer Maintainer backend @Alexand
(UTC+0, 7 hours ahead of author)
@mcelicalderonG
(UTC-5, 2 hours ahead of author)
~"Verify" Reviewer review is optional for ~"Verify" @iamricecake
(UTC+8, 15 hours ahead of author)
Please check reviewer's status!
Feel free to override these selections if you think someone else would be better-suited or use the GitLab Review Workload Dashboard to find other available reviewers.
To read more on how to use the reviewer roulette, please take a look at the Engineering workflow and code review guidelines. Please consider assigning a reviewer or maintainer who is a domain expert in the area of the merge request.
Once you've decided who will review this merge request, assign them as a reviewer! Danger does not automatically notify them for you.
If needed, you can retry the
danger-review
job that generated this comment.Generated by
Dangermarked the checklist item I have evaluated the MR acceptance checklist for this MR. as completed
added grouppipeline execution label
added devopsverify sectionci labels
added 1 commit
- be86c327 - Add enforce_ci_builds_pagination_limit feature flag
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@d0a57040
Allure report
allure-report-publisher
generated test report!e2e-test-on-gdk:
test report for be86c327expand test summary
+------------------------------------------------------------------+ | suites summary | +-------------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +-------------+--------+--------+---------+-------+-------+--------+ | Data Stores | 20 | 0 | 0 | 0 | 20 | ✅ | | Govern | 43 | 0 | 2 | 0 | 45 | ✅ | | Manage | 0 | 0 | 1 | 0 | 1 | ➖ | | Plan | 51 | 0 | 0 | 0 | 51 | ✅ | | Create | 32 | 0 | 5 | 0 | 37 | ✅ | | Verify | 20 | 0 | 0 | 0 | 20 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+ | Total | 166 | 0 | 8 | 0 | 174 | ✅ | +-------------+--------+--------+---------+-------+-------+--------+
e2e-package-and-test:
test report for be86c327expand test summary
+-------------------------------------------------------------+ | suites summary | +--------+--------+--------+---------+-------+-------+--------+ | | passed | failed | skipped | flaky | total | result | +--------+--------+--------+---------+-------+-------+--------+ | Verify | 100 | 0 | 10 | 2 | 110 | ❗ | +--------+--------+--------+---------+-------+-------+--------+ | Total | 100 | 0 | 10 | 2 | 110 | ❗ | +--------+--------+--------+---------+-------+-------+--------+
@mbobin
, thanks for approving this merge request.This is the first time the merge request has been approved. To ensure full test coverage, a new pipeline will be started shortly.
For more info, please refer to the following links:
added pipeline:mr-approved label
mentioned in commit gitlab-org-sandbox/gitlab-jh-validation@743cdbae
enabled an automatic merge when the pipeline for 743cdbae succeeds
mentioned in commit fb3b8cc3
added workflowstaging-canary label
@stanhu This merge request was deployed to the workflowstaging-canary environment. You may want to enable the associated feature flag on this environment with/chatops run feature set enforce_ci_builds_pagination_limit true --staging
.This message was generated automatically. You're welcome to improve it.
@stanhu This merge request was deployed to the workflowcanary environment. You may want to enable the associated feature flag on this environment with/chatops run feature set enforce_ci_builds_pagination_limit true --production
.This message was generated automatically. You're welcome to improve it.
@stanhu This merge request was deployed to the workflowstaging environment. You may want to enable the associated feature flag on this environment with/chatops run feature set enforce_ci_builds_pagination_limit true --staging
.This message was generated automatically. You're welcome to improve it.
@stanhu This merge request was deployed to the workflowproduction environment. You may want to enable the associated feature flag on this environment with/chatops run feature set enforce_ci_builds_pagination_limit true --production
.This message was generated automatically. You're welcome to improve it.
mentioned in merge request !135235 (merged)
added workflowcanary label and removed workflowstaging-canary label
mentioned in issue #429453
added workflowstaging label and removed workflowcanary label
added workflowproduction label and removed workflowstaging label
added workflowpost-deploy-db-staging label and removed workflowproduction label
added workflowpost-deploy-db-production label and removed workflowpost-deploy-db-staging label
mentioned in issue gitlab-com/gl-infra/production#17030 (closed)
added releasedcandidate label
mentioned in merge request kubitus-project/kubitus-installer!2601 (merged)
mentioned in issue gitlab-org/quality/triage-reports#20613 (closed)
mentioned in issue gitlab-org/quality/triage-reports#20978 (closed)
mentioned in issue gitlab-org/quality/triage-reports#21525 (closed)
mentioned in issue gitlab-org/quality/triage-reports#22029