devdocs icon indicating copy to clipboard operation
devdocs copied to clipboard

Unclear what the default behavior is when build or deploy variables are not explicitly set

Open alanbort opened this issue 2 years ago • 7 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Which topic?

https://devdocs.magento.com/cloud/env/variables-build.html#skip_scd

What's wrong with the content?

All varialbes in the deploy and build sections have the statement: Default—Not set

This statement is unhelpful as the meaning of a default is the behavior when a value is not explicitly set.

It also not clear what the default behavior is when a variable is not set. Some variables hint at it, but not easy to parse.

What changes do you propose?

Define the default to be the value that produces the default behavior

Anything else that can help to cover this?

No response

alanbort avatar Mar 16 '22 14:03 alanbort

Hi @alanbort. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


m2-assistant[bot] avatar Mar 16 '22 15:03 m2-assistant[bot]

This issue can be seen in several variables (but notably some have actually useful default values): https://devdocs.magento.com/cloud/env/variables-post-deploy.html https://devdocs.magento.com/cloud/env/variables-deploy.html https://devdocs.magento.com/cloud/env/variables-build.html https://devdocs.magento.com/cloud/env/variables-global.html

alanbort avatar Mar 16 '22 15:03 alanbort

The ones that are set have a default value. The ones that are not set do not have a default value. We can look at the schema and see if there are any updates we need to make.

hguthrie avatar Mar 16 '22 16:03 hguthrie

Perhaps I am missing something. What I would expect to see in the document about variables is how they influence the behavior of the process.

In this context, stating that a variable is not set by default is not really helpful as it doesn't explain how the process behaves when the variable is not set. It's also a bit redundant because default kind of means "this is what we use when the value is not explicitly set". So with "default - not set" you are basically saying: "If the variable is not set then the variable is not set". I would expect to get information like "If the variable is not set, the system will behave as if it was set to false or the system will skip the step".

An example is SKIP_SCD. The variable can be defined on both build and deploy stages, changing the behavior of the CI/CD process. The document states the system will perform SCD on that stage if two conditions are met: 1) the SKIP_SCD variable is set to false and 2) the SCD was not deployed in a prior stage. This implies that the default behavior of the CI/CD process is to NOT build SCD, meaning behaves as if SKIP_SCD was set to true.

alanbort avatar Mar 17 '22 12:03 alanbort

Ece-tools sets the env.php file based on values from Cloud variables, variables set in the Cloud UI, and the .magento.env.yaml configuration file. The environment variables you are referring to are used in the .magento.env.yaml file to customize the Cloud environment by overriding your existing Magento configuration. If a default value is Not Set, then the ece-tools package takes NO action and uses the Magento default or the value from the MAGENTO_CLOUD_RELATIONSHIPS configuration. If the default value is set, then the ece-tools package takes the action to set that default. Those listed in the Cloud guide are set according to best practices. The description of the environment variable provides more details and an example for how you can override the default behaviour or customize the actions of the ece-tools package.

I hope that helps to clarify, and we will evaluate this topic in the Cloud guide to see where improvements need to be made.

hguthrie avatar Mar 17 '22 17:03 hguthrie

Thanks for the clarification! This helps me understand the scope of the documentation and where to find the pieces I was missing. I still would appreciate a review of it, as I'm probably not the only one that got confused :)

alanbort avatar Mar 17 '22 22:03 alanbort

Thanks for the clarification! This helps me understand the scope of the documentation and where to find the pieces I was missing. I still would appreciate a review of it, as I'm probably not the only one that got confused :)

You are welcome, and I agree. We will revisit these concepts and improve the Cloud guide. Thank you for raising the questions.

hguthrie avatar Mar 18 '22 12:03 hguthrie