debug(web): log UI environment selections
This commit is contained in:
+17
-1
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user