diff --git a/platformio/app.py b/platformio/app.py index 0196fac4..9b22b638 100644 --- a/platformio/app.py +++ b/platformio/app.py @@ -255,6 +255,8 @@ def get_cid(): uid = None if os.getenv("C9_UID"): uid = os.getenv("C9_UID") + elif os.getenv("GITPOD_GIT_USER_NAME"): + uid = os.getenv("GITPOD_GIT_USER_NAME") elif os.getenv("CHE_API", os.getenv("CHE_API_ENDPOINT")): try: uid = json.loads( diff --git a/platformio/maintenance.py b/platformio/maintenance.py index 5fa66bd1..06ca827a 100644 --- a/platformio/maintenance.py +++ b/platformio/maintenance.py @@ -73,16 +73,19 @@ def on_platformio_exception(e): def set_caller(caller=None): caller = caller or getenv("PLATFORMIO_CALLER") - if not caller: - if getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"): - caller = "vscode" - elif is_container(): - if getenv("C9_UID"): - caller = "C9" - elif getenv("USER") == "cabox": - caller = "CA" - elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")): - caller = "Che" + if caller: + return app.set_session_var("caller_id", caller) + if getenv("VSCODE_PID") or getenv("VSCODE_NLS_CONFIG"): + caller = "vscode" + elif getenv("GITPOD_INSTANCE_ID") or getenv("GITPOD_WORKSPACE_URL"): + caller = "gitpod" + elif is_container(): + if getenv("C9_UID"): + caller = "C9" + elif getenv("USER") == "cabox": + caller = "CA" + elif getenv("CHE_API", getenv("CHE_API_ENDPOINT")): + caller = "Che" app.set_session_var("caller_id", caller)