Built in badge for latest release
What does this MR do and why?
Adds a built in badge for the latest release. We generate and render from the backend, a svg
badge image with the key-text as Latest Release
and the value-text as the latest release tag name of the project (Example here). If releases are not created for the project we show the value-text as none
.
This is a coach will finish MR carried over from Community contribution !18098 (closed).
Relates to #33368 (closed)
We also support the various style format and customization for badges as listed in https://docs.gitlab.com/ee/ci/pipelines/settings.html#badge-styles
Note:
- We will create a follow up documentation MR for this feature.
- The
link_url
for the badge in project general settings page can be documented ashttps://gitlab.com/%{project_path}/-/releases
till the other issue is shipped (after which we can have a permalink likereleases/permalink/latest
). This approach is more viable as changing the link url otherwise will lead to additional frontend effort for handling other native badges namely pipeline and coverage. - The
image_url
for the badge in project general settings page will behttps://gitlab.com/%{project_path}/-/badges/release.svg
Screenshots or screen recordings
Badge configuration snippet in Project -> Settings -> CI/CD -> General pipelines
Project -> Settings -> General
release_badge_general_settings
View badge on project stats
No releases for a project !78899 (comment 826855632)
How to set up and validate locally
- Create a release as mentioned in https://docs.gitlab.com/ee/user/project/releases/#create-a-release-in-the-releases-page
- Configure the badge and view it as referenced in !78899 (merged)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.