From 65bc28726433b96f4501130014250b84c5337cb1 Mon Sep 17 00:00:00 2001 From: Simon Chopin Date: Tue, 16 Jul 2024 19:23:08 +0200 Subject: [PATCH] launchpad: don't systematically order retrace on private reports Just because a report is marked as LaunchpadPrivate and has an actual architecture attached to it doesn't mean it should be retraced. A contrario, any report that is designated as LaunchpadPrivate should be marked as private, even if get_os_info() was never called on it. Fixes https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2068933 --- apport/crashdb_impl/launchpad.py | 8 +++++--- tests/unit/test_launchpad.py | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apport/crashdb_impl/launchpad.py b/apport/crashdb_impl/launchpad.py index 42b96810a..c1bd59d74 100644 --- a/apport/crashdb_impl/launchpad.py +++ b/apport/crashdb_impl/launchpad.py @@ -1141,9 +1141,11 @@ def _enforce_privacy_for_distro_reports( # FIXME: ugly hack until LP has a real crash db if "DistroRelease" not in report: return - if arch and ( - "VmCore" in report or "CoreDump" in report or "LaunchpadPrivate" in report - ): + + if "LaunchpadPrivate" in report: + hdr["Private"] = "yes" + + if arch and ("VmCore" in report or "CoreDump" in report): hdr["Private"] = "yes" hdr["Subscribers"] = report.get( "LaunchpadSubscribe", self.options.get("initial_subscriber", "apport") diff --git a/tests/unit/test_launchpad.py b/tests/unit/test_launchpad.py index 844426b9a..7c69efa61 100644 --- a/tests/unit/test_launchpad.py +++ b/tests/unit/test_launchpad.py @@ -9,6 +9,8 @@ """Unit tests for apport.crash_impl.launchpad""" +import re + from apport.crashdb_impl.launchpad import CrashDatabase from apport.report import Report @@ -88,3 +90,4 @@ def test_private_bug_headers(): headers = db._generate_upload_headers(report) assert headers.get("Private") == "yes" + assert re.match(r"need-[a-z0-9]-retrace", headers.get("Tags", "")) is None