Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Request for new functionality
View staffing
Description
*Steps to reproduce*
- Create an GAE Standard project using IntelliJ Ultimate*
- Add the following to the appengine-web.xml:
<env-variables>
<env-var name="FOO" value="__foo__"/>
<env-var name="BAR" value="__bar__"/>
</env-variables>
- Set the following variables using variables using the Google Cloud Tools plugin: Google App Engine Standard Local Server -> Startup/Connection -> Environment Variables :
- FOO: foo
- BAR: bar
- Attempt to run the application
* - this can probably be created by setting environment variables at OS level
*Actual results*
com.google.appengine.tools.development.EnvironmentVariableChecker$IncorrectEnvironmentVariableException: One or more environment variables have been configured in appengine-web.xml that have missing or different values in your local environment. We recommend you use system properties instead, but if you are interacting with legacy code that requires specific environment variables to have specific values, please set these environment variables in your environment before running.
*Desired results*
The application runs using the values set in the environment variables
*Justification*
It's the job of environment variables to configure an application at run time. It's typical for developers to check-out and run exactly the same code but with their own configuration in their environment variables. Having to change a file is addition overhead and introduces the risk of checking local changes into source control.
Q: Why not leave out the variables from the file?
A: CI/CD. GAE Standard Java is a bit strange in that the appengine-web.xml falls somewhere in between application code and a deployment script. We're forced to have it, so we include placeholders in it which are replaced in the deployment pipeline (or more specifically the app.yaml which is generated from appengine-web.xml)
The GAE documentation actually argues the reverse of this:
However, as a developer I think that decision should be reconsidered.
Thanks,
Andrew