Remove the non-existent name_regex_delete attribute from the projects API docs

What does this MR do and why?

The projects API documentation describes a container expiration policy attribute name_regex_delete that the API neither accepts nor returns. This MR removes it, so the documentation describes what the API does today.

The rename from name_regex to name_regex_delete was proposed in !30108 (closed) (April 2020) and closed without merging — review flagged it as a breaking change with no deprecation path, and the author closed it after discussing it with the PM. It remains an open backlog item in #371404. The documentation was nonetheless written as though the rename had shipped, including an inline note in the example response reading // to be deprecated in GitLab 13.0 in favor of name_regex_delete.

This was reported before, in #300404 (closed) ("name_regex_delete not returned in project API"), which was closed as stale in 2022 without a fix.

The attribute does not exist in any layer

Layer File Contains
REST params lib/api/helpers/projects_helpers.rb#L147-154 cadence, keep_n, older_than, name_regex, name_regex_keep, enabled
REST response lib/api/entities/container_expiration_policy.rb exposes name_regex, name_regex_keep
Model app/models/container_expiration_policy.rb attributes and validations on name_regex, name_regex_keep
GraphQL app/graphql/types/container_expiration_policy_type.rb fields name_regex, name_regex_keep

Because the parameter is never declared, Grape discards it silently — which makes the Accepts: lists for creating and updating a project the most harmful of the eight locations: clients send the documented key and the setting is dropped without an error.

The document was also internally inconsistent. Of its four container_expiration_policy.* attribute tables only one listed name_regex_delete; the other three already matched the serializer. The canonical "Deprecated attributes" section never mentioned name_regex.

Verified against GitLab 19.4.1-ee

Two requests of identical shape, only the key name differs:

PUT /projects/:id?container_expiration_policy_attributes[enabled]=true
                 &container_expiration_policy_attributes[cadence]=1d
                 &container_expiration_policy_attributes[keep_n]=5
                 &container_expiration_policy_attributes[older_than]=14d
                 &container_expiration_policy_attributes[name_regex_keep]=KEEP-ME
                 &container_expiration_policy_attributes[name_regex_delete]=DELETE-ME

→ 200; cadence, enabled, keep_n, older_than and name_regex_keep were all applied,
       name_regex stayed at its default ".*", and the response contained no
       name_regex_delete
… same request with name_regex=DELETE-ME instead

→ 200; name_regex = "DELETE-ME"

Every other key in the first request was accepted, so the request shape is valid — only that one key is discarded. POST /projects behaves the same way.

Relationship to #371404

This MR neither anticipates nor contradicts #371404. It only aligns the documentation with the current implementation. If the rename ships, the deprecation notes belong with it.

Second, unrelated commit

The deprecated attributes table pointed merge_requests_enabled at merge_request_access_level. The parameter is merge_requests_access_level. Kept as a separate commit so it can be dropped independently.

Possible follow-up, deliberately not included here

In the REST layer name_regex is the deletion pattern — its declared description reads "Container expiration policy regex for image removal", while the documentation only says "Regular expression to match container image names". Making that explicit would help readers, but it is an editorial improvement rather than a correction, so I left it out.

The same incorrect deprecation was carried into the Go client, reported as gitlab-org/api/client-go#2303.

Screenshots or screen recordings

Not applicable, documentation only.

How to set up and validate locally

grep -rn "name_regex_delete" doc/api/projects.md lib/ app/

Returns nothing after this change; before it, only the documentation matched.

Merge request reports

Loading
Loading