Skip to content

Conversation

@zevdg
Copy link
Collaborator

@zevdg zevdg commented Jul 12, 2022

The public docs at https://cloud.google.com/appengine/docs/standard/go/testing-and-deploying-your-app#detecting_application_runtime_environment tell you that GAE_ENV is the value to switch on to determine if you're running in devappserver or not. appengine.IsDevAppserver() should obviously use the same variable that we encourage users to check directly.

@zevdg zevdg requested a review from jinglundong July 12, 2022 17:28

func IsDevAppServer() bool {
return os.Getenv("RUN_WITH_DEVAPPSERVER") != ""
return os.Getenv("RUN_WITH_DEVAPPSERVER") != "" || os.Getenv("GAE_ENV") == "localdev"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: in the case where these two variable disagree (e.g. RUN_WITH_DEVAPPSERVER=1 GAE_ENV=standard) this code trusts the legacy RUN_WITH_DEVAPPSERVER over the new GAE_ENV. IMO this is the best option as it is less likely to break existing test environments that may be configured this way, and lets people start using the new variable in those envs. We can update this logic and/or totally remove RUN_WITH_DEVAPPSERVER in a later release.

@zevdg zevdg force-pushed the gae_env_localdev branch 2 times, most recently from be85e9f to 7071ee1 Compare July 12, 2022 18:29
@zevdg zevdg force-pushed the gae_env_localdev branch from 7071ee1 to 23e4728 Compare July 12, 2022 18:36
@zevdg zevdg merged commit 65ad43f into golang:master Jul 13, 2022
@zevdg zevdg deleted the gae_env_localdev branch July 13, 2022 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants