Debug GitLab note DM
This commit is contained in:
parent
8efd0dc61c
commit
761e7c0e16
2 changed files with 35 additions and 12 deletions
|
|
@ -96,7 +96,7 @@ class BugReportModal(disnake.ui.Modal):
|
|||
await interaction.edit_original_response(
|
||||
content=(
|
||||
"✅ Votre bug a été signalé avec succès ! "
|
||||
"Gameur a bien été averti et le bug sera réglé dans la prochaine mise à jour. "
|
||||
"Nous avons bien été averti et le bug sera réglé dans la prochaine mise à jour. "
|
||||
f"[Voir l'issue]({result.get('web_url')})"
|
||||
)
|
||||
)
|
||||
|
|
@ -259,6 +259,19 @@ class BugReport(commands.Cog):
|
|||
if not user:
|
||||
return web.json_response({"status": "user not found"}, status=200)
|
||||
|
||||
# DEBUG: log brute payload minimal pour comprendre pourquoi aucun DM n'est envoyé
|
||||
kuby_logger.info(
|
||||
f"[GitLab webhook] event_type={event_type} issue_iid={issue_iid} "
|
||||
f"tracked_user_id={user_id} payload_keys={list(payload.keys())[:20]}"
|
||||
)
|
||||
|
||||
if event_type == "note":
|
||||
note_obj_attrs = payload.get("object_attributes") or {}
|
||||
kuby_logger.info(
|
||||
f"[GitLab note] system={note_obj_attrs.get('system', False)} "
|
||||
f"note_len={len(str(note_obj_attrs.get('note') or note_obj_attrs.get('body') or payload.get('note') or ''))}"
|
||||
)
|
||||
|
||||
app_info = await self.bot.application_info()
|
||||
dev = app_info.owner
|
||||
issue_title = payload.get("object_attributes", {}).get("title", f"#{issue_iid}")
|
||||
|
|
@ -378,6 +391,11 @@ class BugReport(commands.Cog):
|
|||
note_attr = payload.get("object_attributes", {})
|
||||
is_system = note_attr.get("system", False)
|
||||
|
||||
kuby_logger.info(
|
||||
f"[GitLab note] dispatch started issue_iid={issue_iid} is_system={is_system} "
|
||||
f"note_field_present={bool(note_attr.get('note') or note_attr.get('body'))}"
|
||||
)
|
||||
|
||||
if not is_system:
|
||||
# GitLab peut envoyer des champs différents selon version/config
|
||||
note_body = (
|
||||
|
|
@ -421,7 +439,10 @@ class BugReport(commands.Cog):
|
|||
f"⚠️ [DM BLOQUÉ] Impossible d'envoyer votre commentaire à {user} ({user.id}) pour l'issue #{issue_iid} (DMs désactivés)."
|
||||
)
|
||||
except Exception as e:
|
||||
kuby_logger.error(f"Erreur inattendue dans la notification de commentaire : {e}")
|
||||
kuby_logger.error(
|
||||
f"Erreur inattendue dans la notification de commentaire : {e}",
|
||||
exc_info=True,
|
||||
)
|
||||
|
||||
return web.json_response({"status": "success"}, status=200)
|
||||
|
||||
|
|
@ -463,5 +484,4 @@ class BugReport(commands.Cog):
|
|||
|
||||
|
||||
def setup(bot):
|
||||
bot.add_cog(BugReport(bot))
|
||||
|
||||
bot.add_cog(BugReport(bot))
|
||||
Loading…
Add table
Add a link
Reference in a new issue