Incorrect Environment State is Rendered When Environment Variable Is Empty
https://gitlab.zendesk.com/agent/tickets/116970 (internal)
Summary
When the environment variable is empty
Steps to reproduce
- Create new environment
- Use an empty variable. In the example below, the URL below will be empty because nested variables are not supported
stages:
- deploy
variables:
APP: "My App"
DEPLOY_NAME: $APP-master
deploy:
stage: deploy
script:
- echo $DEPLOY_NAME
- echo "here would be the script to deploy the app"
environment:
name: $CI_COMMIT_REF_NAME
url: $DEPLOY_NAME
on_stop: stopDeploy
tags:
- "update_tags"
stopDeploy:
stage: deploy
variables:
GIT_STRATEGY: none
script:
- echo "here would be the script to stop the app"
when: manual
environment:
name: $CI_COMMIT_REF_NAME
action: stop
tags:
- "update_tags"
- Stop the environments via UI
- Head to Operations -> Environments. Click Stop
- Click the latest ID
- Observe that the state shows "Stopped"
- Click re-deploy
- Observe state showing Stopped, though the new state should be "Available"
Actual behavior
The wrong environment state is rendered
Expected behavior
When clicking re-deploy, it should show Available #{counter} and not Stopped #{counter}
What you should see instead
Stopped instead of Available
Relevant logs and/or screenshots
Used GitLab Runner version
11.9
Edited by Sara Ahbabou

