Inconsistent behaviour with environment widgets on MR
Summary
When deploying to a series of environments in a pipeline the "environments" widget behaves inconsistently:
- sometimes it displays all environments that will get a deployment
- sometimes it doesn't display certain environments, but then shows them once they've been deployed
- sometimes it shows a manual deployment button for manual jobs, sometimes it does not
Steps to reproduce
- Create one or more pipelines that deploy to an environment in a
.gitlab-ci.yml
file. - Create a merge request in the same project and observe the behavior of the widget in successive runs
Example Project
https://gitlab.com/lyle-ephemeral-test-group/deployment-widget-test/
What is the current bug behavior?
Inconsistency in whether or not environment widget will show
What is the expected correct behavior?
- If an environment will deployed to: show it as soon as possible in the pipeline run.
- If an environment has a manual deploy action, show it as soon as it is available.
See notes in: https://gitlab.com/lyle-ephemeral-test-group/deployment-widget-test/-/merge_requests/1, before merge we see the expected behavior.
Relevant logs and/or screenshots
Output of checks
Results of GitLab environment info
This happens on GitLab.com: GitLab Enterprise Edition 14.6.0-pre a02124bc
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
The behavior of the Pipeline widget should stay consistent before and after the MR is merged.
Environments that are expected to deploy for a given pipeline should always be listed in the Pipeline widget for an MR, even post-merge (see example below):
If there is a manual job related to an environment, we should show it within the Pipeline widget immediately when it is available (see example below):
Once an environment is manually deployed, it should still be listed with the other environments post-merge (see example of it missing below):
UX Proposal
Provide two separate widgets depending on if the MR is pre-merged or post-merged. A pre-merged MR will show an environment widget:
Manual Action | Deployed |
---|---|
![]() |
![]() |
A post-merged widget will show similar to the current state:
Manual Action | Deployed |
---|---|
![]() |
![]() |
Both will show directly below the Pipeline Widget.