Resolve admin plan limits by plan_name_uid
What does this MR do and why?
Resolves the plan in the admin plan-limits flow by plan_name_uid instead of
plan_id:
Admin::PlanLimitsControllerlooks up the plan withPlan.find_by_plan_name_uid!only; theplan_idfallback and its permit entry are removed.- The inert
plan_idhidden field is dropped from the CI/CD and package-registry settings partials.
The plans table is being replaced by an application-defined model, so plan
references must stop depending on its environment-specific row ids;
plan_name_uid is the stable identifier that survives the table's removal.
This is safe now because the form has rendered and submitted plan_name_uid
since !235913 (merged) shipped in
19.2, and an unresolvable uid raises RecordNotFound (404) instead of
matching the wrong plan.
The remaining Phase 2 items (model write path, admin REST API, migration helper) are tracked in the issue. No schema change.
Issue: #596997 (closed)
How to set up and validate locally
- Run the touched specs:
bin/rspec spec/controllers/admin/plan_limits_controller_spec.rb \
spec/views/admin/application_settings/_ci_cd.html.haml_spec.rb \
spec/views/admin/application_settings/_package_registry.html.haml_spec.rb-
Go to Admin → Settings → CI/CD, expand Continuous Integration and Deployment, and scroll to the CI/CD limits form at the bottom of the section.
-
Change a limit and save. Confirm the save succeeds and the
POST /admin/plan_limitsparameters inlog/development.logincludeplan_limits[plan_name_uid]and noplan_id.
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.