[HOTFIX] fix: make changelog discord publication not fail on missing 'labels' (#45779)

fix: make changelog discord publication not fail on missing 'labels' tag in changelog entry (which does not exist).
This commit is contained in:
Fildrance 2026-08-31 18:04:25 +03:00 • committed by GitHub
parent 6b0154c86a
commit e6ad92ca50
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -184,7 +184,8 @@ def generate_description_for_entries(entries: List[Any]) -> str:
for entry in sorted(group, key=lambda x: x["time"]):
for change in entry["changes"]:
emoji = TYPES_TO_EMOJI.get(change["type"], "")
if EXPERIMENTAL_LABEL in entry["labels"]:
labels = entry.get("labels") or []
if EXPERIMENTAL_LABEL in labels:
emoji = f"{emoji}{EXPERIMENTAL_EMOJI}"
msg = change["message"]
desc.write(f"<li>{emoji} {html.escape(msg)}</li>")

View file

@ -242,7 +242,8 @@ def changelog_entries_to_message_lines(entries: Iterable[ChangelogEntry]) -> lis
emoji = TYPES_TO_EMOJI.get(change["type"], "❓")
message = change["message"]
if EXPERIMENTAL_LABEL in entry["labels"]:
labels = entry.get("labels") or []
if EXPERIMENTAL_LABEL in labels:
emoji = f"{emoji}{EXPERIMENTAL_EMOJI}"
message_lines.append(create_change_line(emoji, message, url))