Draft: Remove the limit_ml_candidate_graphql_fields feature flag
Warning
Do not merge yet. This MR brings a breaking change to self-managed and Dedicated. Before it merges, the Breaking Change Exception (https://gitlab.com/gitlab-com/Product/-/work_items/14590) needs: the Support sign-off, the public deprecation issue, the deprecations docs entry, the Corporate Communications and Customer Success sign-off, the Support Preparedness issue, and a release post item for the milestone of this MR.
What does this MR do and why?
The GraphQL fields MlCandidate.metrics, params and metadata now resolve for one candidate per operation on every instance, including self-managed and Dedicated. A query that nests them under a candidate list gets an error for each candidate after the first. The limit has run at 100% on GitLab.com behind the limit_ml_candidate_graphql_fields feature flag since 2026-11-05, and this MR removes the flag. Rollback is a revert of this MR.
Design notes
- The three fields in
app/graphql/types/ml/candidate_type.rbuseGitlab::Graphql::Limit::FieldCallCountwithlimit: 1directly, asMlModel.versionsdoes. The subclass that checked the flag (lib/gitlab/graphql/limit/ml_candidate_field_call_count.rb) and its spec are deleted. - The field descriptions drop the flag sentence and keep the limit: "This field can only be resolved for one candidate per operation." The GraphQL reference and both introspection files are regenerated.
- Specs: the flag-off contexts in
spec/requests/api/graphql/ml/experiments_spec.rbandspec/requests/api/graphql/ml/models_spec.rb, and the per-project flag context in the experiments spec, are removed. The enabled-path examples (limit error for the second candidate, one query per child table) stay as they are, so no spec now tests something different. - The flag type is
gitlab_com_derisk, so there is no default-on step before the removal.
Breaking change
Self-managed and Dedicated get the limit for the first time with this MR. API clients that select these fields for several candidates in one query need one query per candidate, or the MLflow-compatible REST API runs/get. The GitLab UI and the MLflow client are not affected. The change uses the performance exemption of the GraphQL deprecation process, with a VP-approved Breaking Change Exception: https://gitlab.com/gitlab-com/Product/-/work_items/14590. The exception names the flag removal as the point where self-managed and Dedicated get the limit.
References
- Related to https://gitlab.com/gitlab-org/gitlab/-/work_items/635197
- MR that added the flag: !263960 (merged)
- Breaking Change Exception: https://gitlab.com/gitlab-com/Product/-/work_items/14590
- Customer impact record: https://gitlab.com/gitlab-org/gitlab/-/work_items/634694
- No sibling MR edits these files.
Screenshots or screen recordings
No UI change.
How to set up and validate locally
-
In any project, go to Deploy > Model registry, select Create model, and create a model.
-
On the model page, select Create new version and create version
1.0.0. Repeat for version1.0.1. -
Open the model page, then the page of version
1.0.0. Expect: both pages load as onmaster, with no error message. -
Open
http://gdk.test:3000/-/graphql-explorerand run the query below with the model ID from the page URL. Expect:versions.nodeshas one version with its candidate'smetrics, and onenullentry in place of the other version.errorshas"metrics" field can be requested only for 1 MlCandidate(s) at a time.query { mlModel(id: "gid://gitlab/Ml::Model/<model_id>") { versions { nodes { version candidate { id metrics { nodes { name value } } } } } } }
No feature flag step is needed: the limit is always on.
More scenarios
- Experiments:
mlExperiment(id: "gid://gitlab/Ml::Experiment/<id>") { candidates { nodes { id params { nodes { name } } } } }on an experiment with two or more candidates returns the params of one candidate,nullfor the others, and the"params"limit error.metadatabehaves the same. - A query that selects
metrics,paramsandmetadatafor one candidate, for examplemlModel { latestVersion { candidate { ... } } }, returns no error.
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.
Database review
Not needed: the change adds and changes no query, index or migration.