Skip to content

Add a slug to environments

Nick Thomas requested to merge (removed):22864-add-clean-environment-name into master

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?

What are the relevant issue numbers?

Part of #22864 (closed)

Merge request reports