Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple pipeline slug from pipeline name #586

Open
AliSoftware opened this issue Nov 29, 2024 · 0 comments
Open

Decouple pipeline slug from pipeline name #586

AliSoftware opened this issue Nov 29, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@AliSoftware
Copy link

AliSoftware commented Nov 29, 2024

Is your feature request related to a problem? Please describe.

The slug of a pipeline is derived from its name—name attribute in terraform.

This means that if you decide to change the display name of an existing pipeline at some point, this will also changes its slug. As a result:

  • The URL of the pipeline page on the web, so any existing reference to the old URL (e.g. in our team's doc) would have to be udated
  • Since the slug is used as an identifier for the pipeline in many context, all of those will need to be updated as well (e.g. scripts that use the API that needs the slug to identify the pipeline, GraphQL queries, etc)
  • In particular, the elastic-ci-stack-s3-secrets-hooks plugin uses the slug of the pipeline to fetch the proper secrets (SSH clone keys, env vars…) for a pipeline in S3, which means changing the name of a pipeline will break it and make it stop finding those secrets and thus stop working just because the slug changed under us.

Describe the solution you'd like

It would be nice if the slug would only be derived from the name if not provided explicitly in the terraform resource, but would otherwise be read-write.

So in particular, creating the pipeline resource via this code would make the slug of the created pipeline be derived to my-project:

resource "buildkite_pipeline" "my-project-pipeline" {
  name = "My Project"
  # no `slug = …` attribute provided explicitly, so it will be derived from `name` to be `my-project` implicitly
…
}

And changing the name terraform attribute later to name = "My Awesome Project" would update the slug to my-awesome-project. So far, just like today, no change there.

But specifying the slug a an explicit attribute in the terraform resource would allow us to override its derived value, so:

resource "buildkite_pipeline" "my-project-pipeline" {
  name = "My Awesome Project"
  slug = "my-project"
…
}

would allow us to still reference that pipeline with the slug my-project, even if the human-readable display name used in the Buildkite web portal etc. would be "My Awesome Project".

This would allow to give the option to decouple the display name of a pipeline from its slug, all while keeping the current behavior of having the slug derived by default if not provided explicitly.

Describe alternatives you've considered

N/A

Additional context

This is a follow-up of this thread in the support forums: https://forum.buildkite.community/t/decouple-pipeline-name-from-logical-reference-slug/1414/6 cc @benmc

Potential impact

This would avoid the risk of accidentally breaking pipelines when changing their display name, given a lot of things (like S3 secrets plugin) rely on the slug as an sort of identifier for the pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant