Docs - product feedback: example for "Set a deploy freeze" seems wrong
What documentation article is this comment about?
How do I describe my problem?
I think the mentioned article is lacking information. In there the following is stated:
During pipeline processing, GitLab CI creates an environment variable named $CI_DEPLOY_FREEZE if the currently executing job is within a Freeze Period. To take advantage of this variable, create a rules entry in your gitlab-ci.yaml to prevent the deployment job from executing.
Well I created a fresh project and tried out the given example:
deploy_to_production:
stage: deploy
script: deploy_to_prod.sh
rules:
- if: $CI_DEPLOY_FREEZE == null
I can confirm that the mentioned variable $CI_DEPLOY_FREEZE
is created properly - after a freeze period is created over the API that is - exactly like described in the article: Within the debug output of the starting pipeline I have seen that $CI_DEPLOY_FREEZE
has been created and initialised with true
.
But according to the documentation the given example should prevent the pipeline from starting, right? Well it doesn't - at least for this in runtime created environment variable.
In fact while $CI_DEPLOY_FREEZE
is defined and has a value of true
the comparism $CI_DEPLOY_FREEZE == null
evaluates to true
, stating that $CI_DEPLOY_FREEZE
is null
...
I tried the same approach but with an environment variable defined in the project settings and in this case it works as expected.
So my observation gives that the environment variable created on runtime is handled differently in comparism scope of rules
than preexisting environment variables created in .gitlab-ci.yml
or the project settings.
Therefor I think the documentation is lacking information of some kind or the given example is simply wrong.
What information did I have at hand?
- https://docs.gitlab.com/ee/user/project/releases/#set-a-deploy-freeze
- https://docs.gitlab.com/ee/ci/variables/#syntax-of-environment-variable-expressions
- https://docs.gitlab.com/ee/ci/yaml/#rules-clauses
What gitlab version am I running?
We operate a self hosted gitlab-ee "Starter" on version 13.0.5
with gitlab runner on version 13.0.1
.
I am aware that this comment is a bit hybrid like with some technical issue but my prevalent problem is that the documentation is not giving all information to succeed in trying out for my self.