Skip to content

Improve environment slug handling #1674

@peterbbeu

Description

@peterbbeu

Is your feature request related to a problem? Please describe.
I have two "problems":

  1. currently, when environment.name is a variable and gets expanded, it will make a slug of the variable rather than the end result. E.g. if environment.name is $some_other_var, I will end up with a slug like some-other-var. environment.name itself will be properly expanded to whatever is in $some_other_var.
  2. the slug does not match what gitlab itself generates (see https://gitlab.com/gitlab-org/gitlab/-/blob/fc31e7ac344e53ebae182ea1dca183bdc0e2ea71/lib/gitlab/slug/environment.rb)

Describe the solution you'd like
These issues to be resolved ;) Which I've done, in this pull request: #1673

Describe alternatives you've considered
Before, I used to pass in the slug myself using --variable, but that's annoying with dynamic environment names (ours is based on the branch name, means I have to look it up from an actual gitlab job first)

Additional context
n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions