Add x-gitlab-tier OpenAPI annotation for endpoint tiers

What does this MR do and why?

EE REST endpoints have no machine-readable way to express which paid subscription tier they require, so consumers of the OpenAPI spec cannot tell a Premium endpoint from an Ultimate one. This registers :tier in the gitlab-grape-openapi annotations config, so route_setting :tier, :premium (or :ultimate) on any EE Grape endpoint emits x-gitlab-tier in the generated OpenAPI v3 spec — reusing the generic annotation pipeline already behind x-gitlab-lifecycle.

The config change is a single mapping entry; the gem's converter and model already handle arbitrary annotation keys, so no gem change is needed. Two endpoints are seeded as working examples: the group epics list (premium) and the vulnerability GET (ultimate) — both tiers are correct for those features. CE endpoints are implicitly Free and carry no annotation.

The API/RouteSettingTier RuboCop cop (already in the tree) restricts values to :premium/:ultimate, so invalid tiers fail lint.

References

Resolves: #593084 (closed) Part of: gitlab-org/quality&366

Screenshots or screen recordings

How to set up and validate locally

Regenerate the spec and confirm the annotation appears only on the seeded EE endpoints:

bundle exec rake gitlab:openapi:v3:generate
grep -n "x-gitlab-tier" doc/api/openapi/openapi_v3.yaml

Expected — exactly three lines (one Ultimate; two Premium for the epics path aliases), and none on CE endpoints:

4589:      x-gitlab-tier: ultimate   # getApiV4VulnerabilitiesId
9166:      x-gitlab-tier: premium    # /api/v4/groups/{id}/epics
9398:      x-gitlab-tier: premium    # /api/v4/groups/{id}/-/epics

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.

Merge request reports

Loading
Loading