Skip to content

Update badges for ci builds to use helper

Alexander Turinske requested to merge 344347-build-badges into master

What does this MR do and why?

Update badges for ci builds to use helper

  • update badges at /jobs to use the bages helper

Changelog: changed

Screenshots or screen recordings

Before After
Screen_Shot_2021-12-14_at_12.47.28 Screen_Shot_2021-12-14_at_12.58.52

How to set up and validate locally

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

  1. Navigate to a project with builds => CI/CD => Jobs
  2. Apply the following patch
diff --git a/app/views/projects/ci/builds/_build.html.haml b/app/views/projects/ci/builds/_build.html.haml
index cf8036733bb..80e2335eced 100644
--- a/app/views/projects/ci/builds/_build.html.haml
+++ b/app/views/projects/ci/builds/_build.html.haml
@@ -48,16 +48,17 @@
         = sprite_icon('retry', css_class: 'text-warning')
 
     .label-container
-      - if job.tags.any?
+      - unless job.tags.any?
+        = gl_badge_tag 'test', size: :sm
         - job.tags.each do |tag|
           = gl_badge_tag tag, size: :sm
-      - if job.try(:trigger_request)
+      - unless job.try(:trigger_request)
         = gl_badge_tag _('triggered'), variant: :info, size: :sm
-      - if job.try(:allow_failure) && !job.success?
+      - unless job.try(:allow_failure) && !job.success?
         = gl_badge_tag _('allowed to fail'), variant: :warning, size: :sm
-      - if job.schedulable?
+      - unless job.schedulable?
         = gl_badge_tag s_('DelayedJobs|delayed'), variant: :info, size: :sm
-      - elsif job.action?
+      - unless job.action?
         = gl_badge_tag _('manual'), variant: :info, size: :sm
 
   - if pipeline_link

MR acceptance checklist

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

Related to #344347 (closed)

Edited by Alexander Turinske

Merge request reports

Loading