Skip to content

Create conditional "Enable Review App" button

Problem to solve

As part of &2349 (closed) we want to make configuring review apps easier for the user.

Intended users

Further details

Proposal

A button named "Enable review app" should be created. It should be located on the environment page.

Conditions for this button to appear:

  • No review app exists.
  • Project does not use AutoDevOps
  • The project is "reviewable". I created a Rails sample project and a Pages project. With AutoDevOps turned on and a Kubernetes cluster linked to each project, there's no review stage for the Pages one, while there is one for the Rails project.

Pressing the button should open a modal that tells the user to copy this snippet to the gitlab-ci.yml file

deploy_review:

stage: deploy

script:

  - echo "Deploy a review app"

environment:

  name: review/$CI_COMMIT_REF_NAME

  url: http://$CI_ENVIRONMENT_SLUG.$KUBE_INGRESS_BASE_DOMAIN

only:

  - branches

except:

  - master

Together with instructions to the user

UX Proposal

If the above conditions are met display an Enable Review App button on the environments page.

Environments

On clicking the button, open a modal as shown

Modal

Links shown in the steps:

Note: A similar look and feel for modal can be seen by clicking the Review button in MRs that do not have visual review enabled.

Permissions and Security

Documentation

Testing

What does success look like, and how can we measure that?

What is the type of buyer?

Links / references

Edited by Mike Nichols