Add a slug to environments
What does this MR do?
Adds a slug
field to the environments
table, populating existing rows and ensuring that new rows will get an entry.
Cleaning examples:
-
review/foo
=>review-foo-5gghdf
-
review-foo
=>review-foo
-
1-foo
=>env-1-foo-e2hx12
-
production
=>production
-
Production
=>production-f8ddlz
Are there points in the code the reviewer needs to double check?
This migration requires downtime. I don't see a way to avoid it.
Why was this MR needed?
External services often have more restrictive rules on naming than those enforced for environments.name
. In particular, forward slashes and names longer than 24 characters causes problems on OpenShift. slug
is designed to be an acceptable alternative to name
in these situations. Since forward slashes are a documented part of environment names, to set environment types, we need an envionmnent slug, not just a slug for the branch name.
Does this MR meet the acceptance criteria?
-
Changelog entry added -
Documentation created/updated -
API support added - Tests
-
Added for this feature/bug -
All builds are passing
-
-
Conform by the merge request performance guides -
Conform by the style guides -
Branch has no merge conflicts with master
(if it does - rebase it please) -
Squashed related commits together
What are the relevant issue numbers?
Part of #22864 (closed)