Automatically show release notes on deployment approval pages for tagged deployments
Release notes
Have you ever wondered what might be included in a deployment that you are asked to approve for deployment? While GitLab allowed you to create a release with detailed description about its content or instructions for testing, the related environment-specific deployment did not show this data. We are happy to share that GitLab now show you the release notes under the related deployment details page.
As GitLab releases are created always from a git tag, the release notes are shown only on deployments related to the tag-triggered pipeline.
Problem to solve
As a release manager, I want to get all the available information when I'm asked to approve a new deployment, so I can make informed decisions.
See various comments from the feedback issue. This comment gives a good overview in general: #450700 (comment 1930049327)
Proposal
When the deployment approval is related to a tagged build, we should show the related release notes automatically on the deployment approval page.
It would be up to the user to populate the release notes with the information they prefer.
Design proposal
Intended users
Feature Usage Metrics
No new metrics. We already have metrics for releases and MAU of approval pages.
Does this feature require an audit event?
no
Implementation plan
-
Create a new graphql query
relatedRelease
, that acceptsfullPath
andtagName
and returns the release's id, name, and descriptionHtml:query relatedRelease($fullPath: ID!, $tagName: String!) { project(fullPath: $fullPath) { id release(tagName: $tagName) { id name descriptionHtml links { selfUrl } } } }
-
Use the new query in the
showDeployment
component:- we should fetch the release data only for the deployments that have a tag, skip the query if
!this.deployment?.tag
- for the
tagName
variable use deployment's ref (this.deployment?.ref
), which should represent the git tag name in this case.
- we should fetch the release data only for the deployments that have a tag, skip the query if
-
Provide the release data to the
deployment_header
component as a non-required prop. -
Render the related release description only if the release data is provided.
-
Use
GlTruncateText
component to show the release notes. Set lines number to 2. -
Render the
descriptionHtml
similarly to how it's done on the environment page. -
Add a section title
<releaseName> release notes:
and linkreleaseName
to the release page usingrelease.links.selfUrl
. -
Update the related specs: