Skip to content

GitLab Next

    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Menu
    Projects Groups Snippets
  • Get a free trial
  • Sign up
  • Login
  • Sign in / Register
  • GitLab FOSS GitLab FOSS
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

GitLab 15.0 is launching on May 22! This version brings many exciting improvements, but also removes deprecated features and introduces breaking changes that may impact your workflow. To see what is being deprecated and removed, please visit Breaking changes in 15.0 and Deprecations.

  • GitLab.org
  • GitLab FOSSGitLab FOSS
  • Merge requests
  • !7983
Project 'gitlab-org/gitlab-ce' was moved to 'gitlab-org/gitlab-foss'. Please update any links and bookmarks that may still have the old path.
Merged
Created Dec 08, 2016 by Nick Thomas@nick.thomas🔴Contributor9 of 9 tasks completed9/9 tasks
  • Review changes

  • Download
  • Email patches
  • Plain diff

Add a slug to environments

  • Overview 93
  • Commits 4
  • Pipelines 24
  • Changes 22

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)

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: 22864-add-clean-environment-name