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 1
    • Issues 1
    • 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.org
  • GitLab FOSSGitLab FOSS
  • Merge requests
  • !7983
The source project of this merge request has been removed.

Add a slug to environments

Merged Nick Thomas requested to merge (removed):22864-add-clean-environment-name into master Dec 08, 2016
  • Overview 93
  • 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