Skip to content

Commit

Permalink
launchpad: don't systematically order retrace on private reports
Browse files Browse the repository at this point in the history
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
  • Loading branch information
schopin-pro committed Jul 17, 2024
1 parent e62e0b1 commit c9f56ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 5 additions & 3 deletions apport/crashdb_impl/launchpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/test_launchpad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -88,3 +90,4 @@ def test_private_bug_headers():
headers = crashdb._generate_upload_headers(report)

assert headers.get("Private") == "yes"
assert not re.match(r"need-[a-z0-9]-retrace", headers.get("Tags", ""))

0 comments on commit c9f56ed

Please sign in to comment.