Skip to content

Add pipeline name to response of pipeline API

What does this MR do and why?

Describe in detail what your merge request does and why.

Return the pipeline name in the response of the "Get a single pipeline" and "Get latest pipeline" APIs.

This change is behind the pipeline_name_in_api feature flag, which is disabled by default.

I didn't modify the existing Pipeline entity since it is used in a lot of places. To avoid having to change all places at once, I've introduced a new entity called PipelineWithMetadata.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable the feature flag in your local GDK by starting a Rails console and executing: Feature.enable(:pipeline_name_in_api)
  2. Use workflow:name in your CI config to set a name for pipelines. The simplest config is:
    workflow:
      name: 'One name to cover all pipelines'
  3. Start a pipeline and verify that it has a name by checking for the text One name to cover all pipelines in the pipeline list or details UI. The name should be at the top of the details page, and at the top of the pipeline's entry on the list page.
  4. Call the pipeline details API by executing curl, where rpereira%2Fdeployer-fake is the path of the project
    • curl http://gdk.test:3000/api/v4/projects/rpereira%2Fdeployer-fake/pipelines/latest | jq '.name'.
    • curl http://gdk.test:3000/api/v4/projects/rpereira%2Fdeployer-fake/pipelines/232 | jq '.name'.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Reuben Pereira

Merge request reports

Loading