debug(web): log UI environment selections
Python package / build (3.12.3) (pull_request) Successful in 2m33s
Python package / build (3.13) (pull_request) Successful in 2m51s
Python package / build (3.14) (pull_request) Successful in 2m26s

This commit is contained in:
hermes
2026-09-20 15:20:28 +00:00
parent 79af6c2cee
commit afd6f7aac0
+17 -1
View File
@@ -94,6 +94,15 @@ class WebApp:
merged = _merge_dicts(merged, connector.branches)
return merged
def get_selection_summary(self) -> Dict[str, Dict[str, Any]]:
return {
env_id: {
"branches": env.get("branches", []),
"dry": env.get("dry"),
}
for env_id, env in self.get_global_envs_to_emit().items()
}
# --- Async scheduling from sync threads ---
def _schedule_async(self, coro: Any) -> None:
@@ -164,6 +173,7 @@ class WebApp:
async def websocket_endpoint(self, websocket: WebSocket) -> None:
await websocket.accept()
self.ws_connections[websocket] = {}
logger.info("UI connected: selected=%s", self.get_selection_summary())
try:
# Send initial state on connect and record it so duplicate broadcasts are suppressed
@@ -182,7 +192,12 @@ class WebApp:
if "update" in message:
update_data = message.get("update") or {}
logger.info(f"Received environment update: {update_data}")
logger.info(
"UI selection update: env=%s branches=%s dry=%s",
update_data.get('id', ''),
update_data.get('branches'),
update_data.get('dry'),
)
if self.secondaryManager:
await self.secondaryManager.send({"update": update_data})
id = update_data.get('id', '')
@@ -222,6 +237,7 @@ class WebApp:
if isinstance(p, CachingStep):
p.reset()
logger.info(f"Updated environment {env.id} branches to {update_data.get('branches')}, dry={update_data.get('dry')}")
logger.info("UI selection resolved: selected=%s", self.get_selection_summary())
self.core.environment_update_event.set()
await self.broadcast_environments(self.get_global_envs_to_emit())