From a49d915587dc4749895f1caf0061016af722da35 Mon Sep 17 00:00:00 2001 From: Kavya Katal Date: Thu, 16 Jul 2026 16:59:50 +0530 Subject: [PATCH] fix(bitbucket): normalize issue comment deleted flag --- tools/bitbucket/src/magpie_bitbucket/normalize.py | 2 +- tools/bitbucket/tests/test_bitbucket.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/bitbucket/src/magpie_bitbucket/normalize.py b/tools/bitbucket/src/magpie_bitbucket/normalize.py index e11bfa0a..58c14cd5 100644 --- a/tools/bitbucket/src/magpie_bitbucket/normalize.py +++ b/tools/bitbucket/src/magpie_bitbucket/normalize.py @@ -1056,7 +1056,7 @@ def _cloud_issue_comment(raw: dict[str, Any]) -> dict[str, Any]: "updated": _cloud_timestamp(raw.get("updated_on")), "date": _cloud_timestamp(raw.get("created_on")), "kind": "comment", - "deleted": raw.get("deleted"), + "deleted": _bool_or_none(raw.get("deleted")), "permalink": _cloud_link(raw, "html"), "raw": raw, } diff --git a/tools/bitbucket/tests/test_bitbucket.py b/tools/bitbucket/tests/test_bitbucket.py index 9f4ddc86..7c672ce4 100644 --- a/tools/bitbucket/tests/test_bitbucket.py +++ b/tools/bitbucket/tests/test_bitbucket.py @@ -2213,6 +2213,12 @@ def test_normalize_cloud_issue_comments() -> None: assert normalized["comments"][0]["kind"] == "comment" assert normalized["comments"][0]["deleted"] is False + deleted_normalized = issue_comments( + "cloud", + {"issue_id": "7", "values": [{"id": 102, "deleted": True}]}, + ) + assert deleted_normalized["comments"][0]["deleted"] is True + @patch("magpie_bitbucket.cloud.get_issue_comments") def test_cli_issue_comments_cloud(