feat(standup): standup automatique hier/aujourd'hui/blocages (issue #6)
format_standup_text + _standup_data (journal de la veille, focus du jour, vieillissantes QA/Révision); page /standup copiable, /api/standup; inclusion optionnelle au briefing ntfy (KANBANTE_BRIEFING_INCLUDE_STANDUP).
This commit is contained in:
@@ -16,6 +16,43 @@ def ntfy_configured(settings: Settings) -> bool:
|
||||
return bool(settings.ntfy_url and settings.ntfy_topic)
|
||||
|
||||
|
||||
def format_standup_text(data: dict) -> str:
|
||||
"""Automatic standup (issue #6): yesterday / today / blockers."""
|
||||
lines = [f"🗣️ Standup — {data['today_label']}"]
|
||||
closed = data["closed_yesterday"]
|
||||
lines.append(
|
||||
f"\n✅ Hier ({data['yesterday_label']}) : {len(closed)} fermée(s), "
|
||||
f"{data['moved_yesterday']} déplacement(s)"
|
||||
)
|
||||
for item in closed[:8]:
|
||||
lines.append(
|
||||
f" • {item['repo']} #{item['number']} « {item['title']} »"
|
||||
)
|
||||
lines.append("\n📌 Aujourd'hui :")
|
||||
if data["picks"]:
|
||||
for pick in data["picks"]:
|
||||
lines.append(
|
||||
f" • {pick['repo']} #{pick['number']} « {pick['title']} »"
|
||||
f" — {pick['column_label']}"
|
||||
)
|
||||
elif data["focus_titles"]:
|
||||
for title in data["focus_titles"][:5]:
|
||||
lines.append(f" • {title}")
|
||||
lines.append(" (aucun focus épinglé — pense à /today)")
|
||||
else:
|
||||
lines.append(" • Rien en cours. Journée libre ou triage à faire !")
|
||||
lines.append("\n🚧 Blocages :")
|
||||
if data["blockers"]:
|
||||
for card in data["blockers"][:6]:
|
||||
lines.append(
|
||||
f" • {card['repo']} #{card['number']} « {card['title']} »"
|
||||
f" — {card['days']} j en {card['column_label']}"
|
||||
)
|
||||
else:
|
||||
lines.append(" • Aucun blocage signalé. ✨")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
def format_briefing_text(data: dict) -> str:
|
||||
"""Plain-text briefing (ntfy body, also shown on /briefing)."""
|
||||
lines: list[str] = [f"📋 Kanbante — briefing du {data['date']}"]
|
||||
@@ -67,6 +104,8 @@ def format_briefing_text(data: dict) -> str:
|
||||
|
||||
if data["focus_total"] == 0 and not data["aging"]:
|
||||
lines.append("\n🎉 Rien d'urgent : aucun encours, aucune carte vieillissante.")
|
||||
if data.get("standup"):
|
||||
lines.append("\n" + data["standup"])
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user