Add custom labels to CICD pipelines
Gitlab.com uses CICD for our deployments. A single pipeline may be a deploy to production, staging, canary or a dry-run deployment for testing. It would be nice to have the ability to annotate the pipelines especially when there multiple deploys going in parallel to different stages:
Use Cases
-
See what started a pipeline - From
@Taucher2003
- In my instance, I have a Tasks Projects which serves as Task Runner via Pipeline Schedules (Things like Renovate, GitLab Triage, ...). As they are scheduled, they just run always on master with the latest configuration. However, there is no option to see, which pipeline belongs to which task (they are different schedules) as all Pipelines have the same amount of stages and you need to view the jobs in the second stage to see, which Task was run. - See what variables were overridden in the pipeline - The current workflow requires the users to run multiple pipelines for the same commit in order to inject different configuration parameters. They might be required to trigger ~10 pipelines or more in a short time. It is very difficult then to go back and retrieve what configuration was injected on which pipeline. Having the possibility of configuring custom tags to pipelines (and having a search bar filter to filter pipelines based on that) would really help our users productivity.
- See what caused a pipeline failure - Especially for multi-project pipelines, like when a developer kicks off a pipeline and the deployment really happens in another project. Seeing something did not deploy because of code freeze or some other reasons makes for easier troubleshooting.
- Show a version number from the build in the pipeline view
Who's it for?
- Primarily developers looking for why a deploy failed. This is especially a problem when the deploy is done in another/downstream project for compliance reasons.
Proposal
if we could add labels in gitlab-ci.yml
that would appear on the pipeline overview, something like this:
.staging:
...
labels:
- staging
staging-api:
extends: .staging
stage: staging-api
staging-web:
extends: .staging
stage: staging-web
And then all labels for the jobs in a pipeline execution would display on the overview.
Proposed Workaround (Not implemented yet)
While this does not directly add the ability to add custom labels, it provides a way for users to 'tag' the pipeline and later search for it using the Pipeline name filter.
Tag using #26618 (comment 1487763937) and filter by pipeline name ( #376097)
Please leave a comment if the proposed workaround is not sufficient.
Acceptance Criteria for an MVC
- A user can add a
label
to a pipeline in a.gitlab-ci.yml
file which passes the CI Linter - The label appears on the Pipeline list page
- Follow-up issues created for other interfaces this needs to be placed on / user reporting needs for pipelines.
Iteration notes
- This may also be helpful in release related interfaces?
- Adding label to API responses
- Allow setting labels through API
- Managing/reviewing/reporting for Labels at a project / group / workspace level
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.