Merge branch 'dev' into 'main'
Debug GitLab note DM v6 See merge request Omega_Kube/kuby!21
This commit is contained in:
commit
34e73a47d1
2 changed files with 18 additions and 14 deletions
19
TODO.md
19
TODO.md
|
|
@ -1,12 +1,11 @@
|
|||
# TODO - Corrections GitLab -> MP commentaire
|
||||
# TODO - Kuby
|
||||
|
||||
- [x] Identifier le cog qui démarre le serveur aiohttp sur 127.0.0.1:5001 (bug_report.py)
|
||||
- [x] Remplacer l’async hook `cog_load` par un démarrage différé via `__init__` + `bot.loop.create_task` (disnake 2.12.0)
|
||||
- [x] Renommer la logique serveur en `_start_webhook_server`
|
||||
- [x] Attendre `await bot.wait_until_ready()` avant d’ouvrir le port
|
||||
- [x] Conserver le retry bind port 5001 (OSError errno 98)
|
||||
- [ ] Redémarrer le bot
|
||||
- [ ] Vérifier dans les logs: "Internal Bot Webhook Server started on 127.0.0.1:5001"
|
||||
|
||||
- [ ] Ajouter des logs détaillés dans `commandes/bug_report.py` pour vérifier :
|
||||
- [X] réception webhook (object_kind) déjà existant puisque qu'il y a les logs des webhooks sur gitlab
|
||||
- [ ] issue_iid extrait
|
||||
- [ ] présence de `system` et filtrage
|
||||
- [ ] chargement du user_id depuis `data/gitlab_reports.json`
|
||||
- [ ] tentative d’envoi DM (user.id)
|
||||
- [ ] Ajouter un fallback si `note_attr.note/body` n’est pas présent.
|
||||
- [ ] Redéployer (commit + git push + restart bot/PM2 si nécessaire).
|
||||
- [ ] Vérifier avec un vrai commentaire GitLab.
|
||||
|
||||
|
|
|
|||
|
|
@ -165,15 +165,20 @@ class FeatureSuggestionModal(disnake.ui.Modal):
|
|||
class BugReport(commands.Cog):
|
||||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
# disnake 2.12: `cog_load` async n'est pas appelé comme dans discord.py.
|
||||
# On lance le serveur aiohttp de façon différée.
|
||||
self.bot.loop.create_task(self._start_webhook_server())
|
||||
|
||||
async def _start_webhook_server(self):
|
||||
await self.bot.wait_until_ready()
|
||||
|
||||
async def cog_load(self):
|
||||
self.web_app = web.Application()
|
||||
self.web_app.router.add_post('/bot_event', self.handle_bot_event)
|
||||
self.runner = web.AppRunner(self.web_app)
|
||||
await self.runner.setup()
|
||||
|
||||
max_retries = 5
|
||||
retry_delay = 2
|
||||
max_retries = 10
|
||||
retry_delay = 5
|
||||
|
||||
for attempt in range(1, max_retries + 1):
|
||||
try:
|
||||
|
|
@ -184,7 +189,7 @@ class BugReport(commands.Cog):
|
|||
)
|
||||
return
|
||||
except OSError as e:
|
||||
if e.errno == 98: # Address already in use
|
||||
if getattr(e, 'errno', None) == 98: # Address already in use
|
||||
if attempt < max_retries:
|
||||
kuby_logger.warning(
|
||||
f"Port 5001 already in use, retrying in {retry_delay}s... ({attempt}/{max_retries})"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue