Merge pull request 'V1.0 de l'amélioration du suivi des issues' (#264) from dev into main
Reviewed-on: #264
This commit is contained in:
commit
8358b6128e
1 changed files with 59 additions and 50 deletions
|
|
@ -465,6 +465,10 @@ class BugReport(commands.Cog):
|
||||||
os.makedirs(REPORTS_DIR, exist_ok=True)
|
os.makedirs(REPORTS_DIR, exist_ok=True)
|
||||||
await self._start_webhook_server()
|
await self._start_webhook_server()
|
||||||
|
|
||||||
|
pending_count = await self._send_pending_deployment_notifications()
|
||||||
|
if pending_count:
|
||||||
|
kuby_logger.info(f"Notifications de déploiement en attente traitées au démarrage: {pending_count}")
|
||||||
|
|
||||||
# ⚡ Enregistrement des vues persistantes (boutons panel)
|
# ⚡ Enregistrement des vues persistantes (boutons panel)
|
||||||
# Sans ça, après un redémarrage les boutons "Remplir le formulaire"
|
# Sans ça, après un redémarrage les boutons "Remplir le formulaire"
|
||||||
# dans les anciens messages de panel ne fonctionnent plus.
|
# dans les anciens messages de panel ne fonctionnent plus.
|
||||||
|
|
@ -497,19 +501,8 @@ class BugReport(commands.Cog):
|
||||||
kuby_logger.error(f"Error during webhook server cleanup: {e}")
|
kuby_logger.error(f"Error during webhook server cleanup: {e}")
|
||||||
self.bot.loop.create_task(cleanup())
|
self.bot.loop.create_task(cleanup())
|
||||||
|
|
||||||
async def handle_deployment_complete(self, request):
|
async def _send_pending_deployment_notifications(self) -> int:
|
||||||
"""Notifie les demandeurs dont la fonctionnalité a été intégrée et attend le prochain déploiement."""
|
"""Envoie les notifications de déploiement en attente depuis le tracking."""
|
||||||
try:
|
|
||||||
try:
|
|
||||||
await request.json()
|
|
||||||
except Exception:
|
|
||||||
try:
|
|
||||||
raw_body = await request.text()
|
|
||||||
if raw_body and raw_body.strip():
|
|
||||||
json.loads(raw_body)
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
|
|
||||||
notified_count = 0
|
notified_count = 0
|
||||||
for issue_iid, issue_data in list(self.issue_data.items()):
|
for issue_iid, issue_data in list(self.issue_data.items()):
|
||||||
if not issue_data.get("pending_deployment_notification"):
|
if not issue_data.get("pending_deployment_notification"):
|
||||||
|
|
@ -560,6 +553,22 @@ class BugReport(commands.Cog):
|
||||||
|
|
||||||
save_tracking(self.issue_data)
|
save_tracking(self.issue_data)
|
||||||
kuby_logger.info(f"Déploiement terminé: {notified_count} notification(s) envoyée(s)")
|
kuby_logger.info(f"Déploiement terminé: {notified_count} notification(s) envoyée(s)")
|
||||||
|
return notified_count
|
||||||
|
|
||||||
|
async def handle_deployment_complete(self, request):
|
||||||
|
"""Notifie les demandeurs dont la fonctionnalité a été intégrée et attend le prochain déploiement."""
|
||||||
|
try:
|
||||||
|
try:
|
||||||
|
await request.json()
|
||||||
|
except Exception:
|
||||||
|
try:
|
||||||
|
raw_body = await request.text()
|
||||||
|
if raw_body and raw_body.strip():
|
||||||
|
json.loads(raw_body)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
|
||||||
|
notified_count = await self._send_pending_deployment_notifications()
|
||||||
return web.json_response({"status": "notified", "sent": notified_count}, status=200)
|
return web.json_response({"status": "notified", "sent": notified_count}, status=200)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
kuby_logger.error(f"Error handling deployment complete: {e}")
|
kuby_logger.error(f"Error handling deployment complete: {e}")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue