V0.8 de l'amélioration du suivi des issues
This commit is contained in:
parent
225ee7c823
commit
748957a618
1 changed files with 19 additions and 3 deletions
|
|
@ -595,10 +595,20 @@ class BugReport(commands.Cog):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
elif event_type == "issue":
|
elif event_type == "issue":
|
||||||
action = payload.get("object_attributes", {}).get("action") or payload.get("action")
|
object_attributes = payload.get("object_attributes") or {}
|
||||||
state = payload.get("object_attributes", {}).get("state") or payload.get("issue", {}).get("state")
|
issue_payload = payload.get("issue") or {}
|
||||||
|
action = (object_attributes.get("action") or issue_payload.get("action") or payload.get("action") or "").lower()
|
||||||
|
state = (object_attributes.get("state") or issue_payload.get("state") or payload.get("state") or "").lower()
|
||||||
label_change = extract_label_change(payload)
|
label_change = extract_label_change(payload)
|
||||||
|
|
||||||
|
kuby_logger.debug(
|
||||||
|
"Issue webhook for #%s: action=%s state=%s labels=%s",
|
||||||
|
issue_iid,
|
||||||
|
action,
|
||||||
|
state,
|
||||||
|
label_change["current"] if label_change else [],
|
||||||
|
)
|
||||||
|
|
||||||
if label_change:
|
if label_change:
|
||||||
current_labels = label_change["current"]
|
current_labels = label_change["current"]
|
||||||
progress = calculate_progress_from_labels(current_labels)
|
progress = calculate_progress_from_labels(current_labels)
|
||||||
|
|
@ -617,10 +627,16 @@ class BugReport(commands.Cog):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
kuby_logger.error(f"Erreur notification progression: {e}")
|
kuby_logger.error(f"Erreur notification progression: {e}")
|
||||||
|
|
||||||
is_closing_now = action in ["close", "closed"] or state == "closed"
|
is_closing_now = (
|
||||||
|
action in {"close", "closed", "closing"}
|
||||||
|
or state in {"closed", "close", "resolved", "resolved_closed"}
|
||||||
|
or payload.get("event_action") in {"close", "closed"}
|
||||||
|
or payload.get("object_kind") == "issue" and payload.get("action") in {"close", "closed"}
|
||||||
|
)
|
||||||
if is_closing_now:
|
if is_closing_now:
|
||||||
self.issue_data[issue_iid]["pending_deployment_notification"] = True
|
self.issue_data[issue_iid]["pending_deployment_notification"] = True
|
||||||
save_tracking(self.issue_data)
|
save_tracking(self.issue_data)
|
||||||
|
kuby_logger.info(f"Marked issue #{issue_iid} as pending deployment notification")
|
||||||
try:
|
try:
|
||||||
embed = disnake.Embed(
|
embed = disnake.Embed(
|
||||||
title="🛠️ Demande traitée !",
|
title="🛠️ Demande traitée !",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue