fsanyoto commited on
Commit
f53aaca
·
verified ·
1 Parent(s): 788cca2

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "current": "d0c71da8fc94",
3
  "releases": [
4
  {
5
  "version": "v86",
 
1
  {
2
+ "current": "eda4a2ee5cf5",
3
  "releases": [
4
  {
5
  "version": "v86",
VERSION CHANGED
@@ -1 +1 @@
1
- d0c71da8fc94
 
1
+ eda4a2ee5cf5
api/sync_alerts.py CHANGED
@@ -3,6 +3,7 @@ from __future__ import annotations
3
 
4
  from datetime import datetime, timedelta, timezone
5
  import json
 
6
  from pathlib import Path
7
  import re
8
  import sys
@@ -281,10 +282,18 @@ def _item(alert):
281
  return f"{alert['label']} ({alert['cause']}, {tail})"
282
 
283
 
 
 
 
 
 
 
 
 
284
  def compose(tenant, connector, plan, document):
285
  """One line for the whole pass: FAILED, STILL FAILING and RECOVERED, each listed once."""
286
  alerts, recovered = document.get("alerts") or {}, document.get("recovered") or {}
287
- where = f"{tenant} {connector}"
288
  parts = []
289
  for kind, title in (("failed", "FAILED"), ("reminder", "STILL FAILING")):
290
  items = [_item(alerts[a]) for a in sorted(plan[kind]) if a in alerts]
 
3
 
4
  from datetime import datetime, timedelta, timezone
5
  import json
6
+ import os
7
  from pathlib import Path
8
  import re
9
  import sys
 
282
  return f"{alert['label']} ({alert['cause']}, {tail})"
283
 
284
 
285
+ def environment():
286
+ """LIVE, STAGING or LOCAL, from the Space id HF sets, so a staging alert never reads as live."""
287
+ space = (os.environ.get("SPACE_ID") or os.environ.get("APP_BASE_URL") or "").lower()
288
+ if "runloopable" in space:
289
+ return "LIVE"
290
+ return "STAGING" if "loopable" in space else "LOCAL"
291
+
292
+
293
  def compose(tenant, connector, plan, document):
294
  """One line for the whole pass: FAILED, STILL FAILING and RECOVERED, each listed once."""
295
  alerts, recovered = document.get("alerts") or {}, document.get("recovered") or {}
296
+ where = f"{environment()} {tenant} {connector}"
297
  parts = []
298
  for kind, title in (("failed", "FAILED"), ("reminder", "STILL FAILING")):
299
  items = [_item(alerts[a]) for a in sorted(plan[kind]) if a in alerts]
web/public/AIOS_DEPLOY_RECEIPT CHANGED
@@ -1 +1 @@
1
- a4f78634a3882f46d6aaf9ce4a9f57cd575d14218f51c438ea5b626c1c6b766f
 
1
+ cccb6e0c433b1fbc2156c5b383d50686505dc4a26cffbf786b35f8496ee68a74