Decouple pipeline name from logical reference (slug)

Currently there’s a tight coupling between the “name” of a pipeline and the “slug” of it.

The name is used mainly for end users - the title of the pipeline page, finding the right pipeline (out of hundreds / thousands of pipelines) etc. Some users might decide to change the name from time to time for their convenience.

The pipeline slug is more coupled to web URL links, and API calls.

Right now - if user decides to change the name - then we must update all of our references to the new slug.

We think it makes sense to decouple it - allow us to change the visual (searchable) name without changing the slug and vice versa.

We have been trying to look into better tracking of actions that happen through our pipelines. For unique identification of the pipeline I think we can use the pipeline ID which I think will never change no matter what we set the name or the slug to. I think in order to be able to rely on the slug on our side, we would need it to be completely unmodifiable, sadly

Hello @petarlishov-fd !

This is the best solution I could come up with ass well. By using the UUID of the pipeline, it should be static and unchanging, unlike the slug. In order to return the UUID, you can use the GraphQL API, by searching your pipelines for the appropriate one:

query GetPipelineUUID {
  organization(slug: "organization-slug") {
    pipelines(first: 500, search: "part of slug") {
      edges {
        node {
          slug
          uuid
        }
      }
    }
  }
}

Then you can use that UUID in the following to get all the information about that pipeline:

query GetPipelineInfo {
  pipeline(uuid:"pipeline-uuid") {
    slug
    uuid
  }
}

Have a great day!

I got tricked by that recently as well, as I changed the name of a pipeline in our Terraform config to give it a nicer and more descriptive name… only to realize that changing the name broken the pipeline completely.

This was because we’re using the GitHub - buildkite/elastic-ci-stack-s3-secrets-hooks: 🕵️‍♀️ Expose secrets to your buildkite build steps via Amazon S3 to securely fetch our CI secrets from S3 during all our builds, and this pulls the secrets based on the pipeline slug. Since I changed the pipeline name, the derived slug for the pipeline changed too… which means it suddenly stopped finding our secrets and all our builds started to fail.

I really didn’t expect that changing the name would change the slug and thus have such consequences; in fact, it took me a bit of time to understand that the recent change of the name was the cause for those failures starting to happen.

Hey @ohalligon ,

This is Suma from Buildkite support team. Firstly, thank you for sharing the feedback and issue you went through when changing the name of pipeline through Terraform also led to pipeline slug change.

While this is documented Pipelines | Buildkite Documentation but we agree that it wont be obvious for the users. We will look into any improvements we can make with in terraform to make this clear to the users.

Once again thank you for sharing the feedback with us.

Thanks,
Suma

1 Like

Hey @ohalligon! :wave:

Ben here, one of Suma’s teammates and a maintainer of the Terraform provider. I think we may be able to build support for this in to the provider. If you’d like, you can open an issue on the provider and link back to this forum thread.

Also happy to just card it up, but an issue will allow a more public facing discussion and for you to get updates on the progress, versus a card on our Linear board which isn’t public.

Cheers!

1 Like

Hi @benmc !

Sorry for the late reply, somehow I missed the notification about your message back then :sweat_smile:

I’ve since opened an issue in the terraform provider repo :slightly_smiling_face:

Thanks!

1 Like