release 1.10.6: clean stage mon pages (no git noise, stage sticky, CHECK_BANK)
This commit is contained in:
parent
1d71766a64
commit
ef4dde4946
5 changed files with 135 additions and 50 deletions
|
|
@ -76,6 +76,13 @@ def ui(lang: str, key: str, **kwargs) -> str:
|
|||
"pages_i4": "Phase monpages: outside-in check (existence + top/bottom content markers; not merchant JSON code 21)",
|
||||
"pages_i5": "Host-agent: staging → DEPLOY_WWW_ROOT; reverse-proxy must serve /monitoring* and /taler-monitoring-surface*",
|
||||
"pages_i6": "This page host: {host} · path label: {label}",
|
||||
"stage_title": "mytops stage monitoring · {host}",
|
||||
"stage_summary": "betel only · CHF stage stack · not lifeline/prod · not GOA",
|
||||
"stage_i1": "Host: betel (stage). Public mon HTML: stage.my.taler-ops.ch + stage.taler-ops.ch /monitoring/",
|
||||
"stage_i2": "Focus: stage merchant ({host}) + exchange.stage.taler-ops.ch; bank optional (CHECK_BANK)",
|
||||
"stage_i3": "Phases: {phases} · suite auto-upgrade each timer run",
|
||||
"stage_i4": "Not GOA: no surface/aptdeploy/mail pages · no koopa-admin-log",
|
||||
"stage_i5": "Timer: taler-monitoring-mytops-stage.timer (4h) · user taler-monitoring",
|
||||
"pages_section_lead": "Monitoring pages themselves (suite):",
|
||||
"mm_title": "Mattermost chat health",
|
||||
"mm_summary": "mattermost.taler.net · SPA + /api/v4/system/ping · TLS",
|
||||
|
|
@ -150,6 +157,13 @@ def ui(lang: str, key: str, **kwargs) -> str:
|
|||
"pages_i3": "GOA : /monitoring/ bank+exchange+taler ; surface + aptdeploy sur taler.hacktivism.ch — mail/mattermost dans surface",
|
||||
"pages_i4": "Phase monpages : existence + marqueurs haut/bas (pas JSON merchant code 21)",
|
||||
"pages_i5": "Host-agent : staging → DEPLOY_WWW_ROOT ; le reverse-proxy sert /monitoring* et /taler-monitoring-surface*",
|
||||
"stage_title": "Surveillance mytops stage · {host}",
|
||||
"stage_summary": "betel uniquement · pile CHF stage · pas lifeline/prod · pas GOA",
|
||||
"stage_i1": "Hôte : betel (stage). HTML mon : stage.my.taler-ops.ch + stage.taler-ops.ch /monitoring/",
|
||||
"stage_i2": "Focus : merchant stage ({host}) + exchange.stage ; bank optionnel (CHECK_BANK)",
|
||||
"stage_i3": "Phases : {phases} · auto-upgrade suite à chaque minuterie",
|
||||
"stage_i4": "Pas GOA : pas de pages surface/aptdeploy/mail · pas de koopa-admin-log",
|
||||
"stage_i5": "Minuterie : taler-monitoring-mytops-stage.timer (4 h) · user taler-monitoring",
|
||||
"pages_i6": "Hôte de cette page : {host} · libellé : {label}",
|
||||
"pages_section_lead": "Les pages de monitoring elles-mêmes (suite) :",
|
||||
"mm_title": "Santé du chat Mattermost",
|
||||
|
|
@ -569,6 +583,24 @@ def monitoring_scope(
|
|||
}
|
||||
|
||||
phase_txt = phases or "urls · inside · versions"
|
||||
# mytops stage (betel) — not GOA sticky text
|
||||
if re.search(r"stage\.(my\.)?taler-ops\.ch|stage\.taler-ops\.ch|mytops-stage", host + " " + log_text, re.I):
|
||||
items = [
|
||||
ui(lang, "stage_i1"),
|
||||
ui(lang, "stage_i2", host=host),
|
||||
ui(lang, "stage_i3", phases=phase_txt),
|
||||
ui(lang, "stage_i4"),
|
||||
ui(lang, "stage_i5"),
|
||||
ui(lang, "pages_i6", host=host, label=label),
|
||||
]
|
||||
return {
|
||||
"kind": "stage",
|
||||
"lang": lang,
|
||||
"title": ui(lang, "stage_title", host=host),
|
||||
"summary": ui(lang, "stage_summary"),
|
||||
"items": items,
|
||||
}
|
||||
|
||||
role = "stack"
|
||||
if host.startswith("bank.") or "bank." in host:
|
||||
role = "bank"
|
||||
|
|
@ -602,6 +634,35 @@ def monitoring_scope(
|
|||
}
|
||||
|
||||
|
||||
def is_log_noise_line(ln: str) -> bool:
|
||||
"""Drop git/update chatter that must not appear in public mon HTML."""
|
||||
s = ln.strip()
|
||||
if not s:
|
||||
return False
|
||||
low = s.lower()
|
||||
if s.startswith("HEAD is now at"):
|
||||
return True
|
||||
if s.startswith("Your branch is") or s.startswith("branch '") or s.startswith('branch "'):
|
||||
return True
|
||||
if "set up to track" in low or "fast-forward" in low:
|
||||
return True
|
||||
if re.match(r"^M\t", s) or re.match(r"^M\s+\S", s):
|
||||
return True # git status "M path"
|
||||
if low.startswith("from https://") or low.startswith("from git@"):
|
||||
return True
|
||||
if "aktualisierung erzwungen" in low or "force update" in low:
|
||||
return True
|
||||
if low.startswith("fetch origin") or low.startswith("already at ") or low.startswith("upgraded "):
|
||||
# keep "suite vX @ commit" lines from agent header; drop raw fetch chatter
|
||||
if low.startswith("already at ") or low.startswith("upgraded "):
|
||||
return True
|
||||
if low.startswith("fetch origin"):
|
||||
return True
|
||||
if "ihr branch ist" in low or "bereits auf" in low:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def sticky_bar_html(
|
||||
*,
|
||||
generated_at: str,
|
||||
|
|
@ -972,7 +1033,11 @@ def build_html(
|
|||
suite_version: str = "",
|
||||
suite_version_url: str = "",
|
||||
) -> str:
|
||||
raw_lines = [strip_ansi(l).rstrip("\n") for l in log_text.splitlines()]
|
||||
raw_lines = [
|
||||
strip_ansi(l).rstrip("\n")
|
||||
for l in log_text.splitlines()
|
||||
if not is_log_noise_line(strip_ansi(l))
|
||||
]
|
||||
while raw_lines and not raw_lines[-1].strip():
|
||||
raw_lines.pop()
|
||||
|
||||
|
|
@ -1367,7 +1432,11 @@ def main() -> None:
|
|||
generated_at = now.strftime("%Y-%m-%d %H:%M:%SZ")
|
||||
title = args.title or f"{args.page_label} {args.mode} · {args.hostname}"
|
||||
|
||||
raw_for_counts = [strip_ansi(l).rstrip("\n") for l in log_text.splitlines()]
|
||||
raw_for_counts = [
|
||||
strip_ansi(l).rstrip("\n")
|
||||
for l in log_text.splitlines()
|
||||
if not is_log_noise_line(strip_ansi(l))
|
||||
]
|
||||
n_err, n_warn, _, _ = count_status(raw_for_counts)
|
||||
|
||||
if args.mode == "redirect":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue