dfdce39ad6
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? - [x] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added - [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [X] API support added - Tests - [X] Added for this feature/bug - [x] All builds are passing - [X] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [X] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [X] Branch has no merge conflicts with `master` (if it does - rebase it please) - [X] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Part of #22864 See merge request !7983 |
||
---|---|---|
.. | ||
backend | ||
backup | ||
badge | ||
bitbucket_import | ||
chat_commands | ||
checks | ||
ci | ||
conflict | ||
cycle_analytics | ||
data_builder | ||
database | ||
diff | ||
downtime_check | ||
fogbugz_import | ||
gfm | ||
git | ||
github_import | ||
gitlab_import | ||
google_code_import | ||
graphs | ||
import_export | ||
ldap | ||
metrics | ||
middleware | ||
o_auth | ||
saml | ||
sanitizers | ||
sherlock | ||
slash_commands | ||
sql | ||
template | ||
allowable_spec.rb | ||
asciidoc_spec.rb | ||
auth_spec.rb | ||
award_emoji_spec.rb | ||
blame_spec.rb | ||
changes_list_spec.rb | ||
chat_name_token_spec.rb | ||
closing_issue_extractor_spec.rb | ||
color_schemes_spec.rb | ||
contributions_calendar_spec.rb | ||
current_settings_spec.rb | ||
database_spec.rb | ||
downtime_check_spec.rb | ||
exclusive_lease_spec.rb | ||
file_detector_spec.rb | ||
git_access_spec.rb | ||
git_access_wiki_spec.rb | ||
git_spec.rb | ||
highlight_spec.rb | ||
identifier_spec.rb | ||
incoming_email_spec.rb | ||
key_fingerprint_spec.rb | ||
lazy_spec.rb | ||
lfs_token_spec.rb | ||
markup_helper_spec.rb | ||
metrics_spec.rb | ||
optimistic_locking_spec.rb | ||
popen_spec.rb | ||
project_search_results_spec.rb | ||
redis_spec.rb | ||
reference_extractor_spec.rb | ||
regex_spec.rb | ||
routing_spec.rb | ||
search_results_spec.rb | ||
sidekiq_throttler_spec.rb | ||
snippet_search_results_spec.rb | ||
themes_spec.rb | ||
upgrader_spec.rb | ||
uploads_transfer_spec.rb | ||
url_builder_spec.rb | ||
url_sanitizer_spec.rb | ||
user_access_spec.rb | ||
utils_spec.rb | ||
version_info_spec.rb | ||
workhorse_spec.rb |