Sdm0 commited on
Commit
1a55bdc
Β·
verified Β·
1 Parent(s): caced83

Sync from GitHub via hub-sync

Browse files
Files changed (1) hide show
  1. app.py +28 -1
app.py CHANGED
@@ -23,6 +23,9 @@ from graph import build_graph
23
  from main import _cleanup_db, SYNTHETIC_STATE
24
  from state import Verdict
25
 
 
 
 
26
  logging.basicConfig(
27
  level=logging.INFO,
28
  format="%(asctime)s [%(levelname)s] %(name)s β€” %(message)s",
@@ -145,6 +148,25 @@ def _format_findings_count(findings: list) -> str:
145
  return " | ".join(parts) if parts else "No issues"
146
 
147
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  # ─── Gradio callbacks ───────────────────────────────────────────────────────
149
 
150
 
@@ -418,8 +440,13 @@ with gr.Blocks(css=CSS, title="OpenCodeReview", theme=gr.themes.Soft()) as demo:
418
  )
419
 
420
  # ── Footer ─────────────────────────────────────────────────────────
 
421
  gr.HTML(
422
- '<p class="footer">Built with LangGraph Β· Groq Β· ChromaDB Β· Gradio</p>'
 
 
 
 
423
  )
424
 
425
 
 
23
  from main import _cleanup_db, SYNTHETIC_STATE
24
  from state import Verdict
25
 
26
+ import subprocess
27
+ from datetime import datetime, timezone
28
+
29
  logging.basicConfig(
30
  level=logging.INFO,
31
  format="%(asctime)s [%(levelname)s] %(name)s β€” %(message)s",
 
148
  return " | ".join(parts) if parts else "No issues"
149
 
150
 
151
+ # ─── Helpers ─────────────────────────────────────────────────────────────────
152
+
153
+
154
+ def _get_deploy_info() -> tuple[str, str]:
155
+ """Return Git commit hash and deploy timestamp for the footer."""
156
+ commit = "unknown"
157
+ try:
158
+ result = subprocess.run(
159
+ ["git", "rev-parse", "--short", "HEAD"],
160
+ capture_output=True, text=True, timeout=5,
161
+ )
162
+ if result.returncode == 0:
163
+ commit = result.stdout.strip()
164
+ except Exception:
165
+ pass
166
+ ts = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M UTC")
167
+ return commit, ts
168
+
169
+
170
  # ─── Gradio callbacks ───────────────────────────────────────────────────────
171
 
172
 
 
440
  )
441
 
442
  # ── Footer ─────────────────────────────────────────────────────────
443
+ _commit, _ts = _get_deploy_info()
444
  gr.HTML(
445
+ f'<p class="footer">'
446
+ f'Built with LangGraph Β· Groq Β· ChromaDB Β· Gradio'
447
+ f'<br><span style="opacity:0.5;font-size:0.85em">'
448
+ f'deploy: <code>{_commit}</code> Β· {_ts}'
449
+ f'</span></p>'
450
  )
451
 
452