Add better visual support for pipelines triggered by an API
Old summary
After a slack discussion these are the points that need to be improved: 1. Add a badge for triggered. 1. gitlab-ce~3412464 Add support for this 1. gitlab-ce~24926493 Add `triggered` to the list of `flags` 1. gitlab-ce~2024184 What should be the color of this badge? 1. Improve current check to show "by API" 1. gitlab-ce~3412464 we currently check if `user` key is present in endpoint response. We should check `source` instead. 1. Document the list of possible "labels" for the badge in the view https://gitlab.com/gitlab-org/gitlab-ce/issues/40539#note_49541642Summary
Currently, when a pipeline is triggered by an API we don't show any indicator on the UI. We use labels for schedule
. A similar label for API would be helpful to distinguish pipeline triggered by APIs.
Steps to reproduce
Example Project
What is the current bug behavior?
There's no visual indicator to distinguish pipelines and jobs triggered by APIs.
What is the expected correct behavior?
When a pipeline or job gets triggered using APIs, show a label on the list views(pipeline and jobs) and also on the detail page.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
Expand for output related to GitLab environment info
(For installations with omnibus-gitlab package run and paste the output of: `sudo gitlab-rake gitlab:env:info`) (For installations from source run and paste the output of: `sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)
Results of GitLab application Check
Expand for output related to the GitLab application check
(For installations with omnibus-gitlab package run and paste the output of:
sudo gitlab-rake gitlab:check SANITIZE=true
)(For installations from source run and paste the output of:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true
)(we will only investigate if the tests are passing)
Possible fixes
Refactor pipeline_triggerer to check for source to display API
text.
It now seems that a user is attached to the pipeline but still can have a source of api
.