From e141309a2daf56b213d60f7e045aca39ab6f4acd Mon Sep 17 00:00:00 2001 From: Mathis Date: Sun, 12 Jul 2026 18:27:47 +0200 Subject: [PATCH] =?UTF-8?q?V1.2=20de=20l'am=C3=A9lioration=20du=20suivi=20?= =?UTF-8?q?des=20issues?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commandes/bug_report.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/commandes/bug_report.py b/commandes/bug_report.py index f4cadbc..9eacde9 100644 --- a/commandes/bug_report.py +++ b/commandes/bug_report.py @@ -12,9 +12,15 @@ from utils.premium import check_premium_tier kuby_logger = logging.getLogger("KubyBot") BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -# ⚡ NOUVEAU: Utilise le même fichier que gitlab_integration.py -TRACKING_FILE = os.path.join(BASE_DIR, "commandes", "gitlab_issues.json") -LEGACY_REPORTS_FILE = os.path.join(BASE_DIR, "data", "gitlab_reports.json") +PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir)) +TRACKING_FILE = os.path.join(PROJECT_ROOT, "commandes", "gitlab_issues.json") +LEGACY_REPORTS_FILE = os.path.join(PROJECT_ROOT, "data", "gitlab_reports.json") + +# S'assure que le fichier de tracking est toujours écrit à l'emplacement attendu même si le service systemd démarre depuis un autre répertoire. +if not os.path.exists(TRACKING_FILE): + legacy_candidate = os.path.join(BASE_DIR, "commandes", "gitlab_issues.json") + if os.path.exists(legacy_candidate): + TRACKING_FILE = legacy_candidate def classify_webhook_event(payload: Dict[str, Any]) -> Optional[str]: