micronaut-projects / micronaut-core

Micronaut Application Framework
http://micronaut.io
Apache License 2.0
6.03k stars 1.05k forks source link

deduceCloudEnvironment doesn't add "cloud" in AppEngine #10799

Open TWiStErRob opened 3 months ago

TWiStErRob commented 3 months ago

Expected Behavior

As documented:

The application is running in a Cloud environment (present for all other cloud platform types) -- https://docs.micronaut.io/latest/guide/#:~:text=present%20for%20all%20other%20cloud%20platform%20types

Actual Behaviour

https://github.com/micronaut-projects/micronaut-core/blob/f3c28bee9b14e38ce83f66b9038a4f3e6e2ad85c/inject/src/main/java/io/micronaut/context/env/DefaultEnvironment.java#L742-L747

(compare to branches above, and notice that each add CLOUD explicitly.)

Steps To Reproduce

I haven't tried, I just stumbled upon the code.

Environment Information

https://cloud.google.com/appengine/docs/standard/java-gen2/runtime#environment_variables

Example Application

No response

Version

4.4.8

TWiStErRob commented 3 months ago

Confirmed not working in GAE:

textPayload: "2024-05-04T21:08:54,634 INFO [main] io.micronaut.context.DefaultApplicationContext$RuntimeConfiguredEnvironment(DefaultEnvironment.java:168) Established active environments: [gae, gcp, production]"

sdelamo commented 3 months ago

Do you want to submit an PR?

TWiStErRob commented 3 months ago

No, because there are no tests for this as far as I found, therefore it should be in scope to add regression tests, which is not as trivial as adding the line I highlighted.

pragyamutluru commented 4 weeks ago

Submitted a PR https://github.com/micronaut-projects/micronaut-core/pull/11035 Tried my best to add some test cases for other scenarios as well.