Merge lp:~ubuntu-core-dev/ubuntu/jammy/apport/ubuntu-desktop-installer into lp:~ubuntu-core-dev/ubuntu/jammy/apport/ubuntu

Proposed by Sebastien Bacher
Status: Merged
Merged at revision: 2883
Proposed branch: lp:~ubuntu-core-dev/ubuntu/jammy/apport/ubuntu-desktop-installer
Merge into: lp:~ubuntu-core-dev/ubuntu/jammy/apport/ubuntu
Diff against target: 43 lines (+39/-0)
1 file modified
data/package-hooks/ubuntu-desktop-installer.py (+39/-0)
To merge this branch: bzr merge lp:~ubuntu-core-dev/ubuntu/jammy/apport/ubuntu-desktop-installer
Reviewer Review Type Date Requested Status
Olivier Tilloy Approve
Brian Murray Needs Information
Review via email: mp+414402@code.launchpad.net

Description of the change

Similar to what has been done for subiquity, allow reporting bugs against the new desktop installer, which is a snap, on the launchpad product including useful log information

To post a comment you must log in.
Revision history for this message
Brian Murray (brian-murray) wrote :

This looks good to me but wouldn't it be worth adding information about the subiquity and / or ubuntu-desktop-installer snap versions?

review: Needs Information
Revision history for this message
Sebastien Bacher (seb128) wrote (last edit ):

The report includes the snap version and channel and not the revision but it seems like something ubuntu-bug should collect for any snap rather than having special code for the installer?

Note that we only want the ubuntu-desktop-installer snap revision since we bundle subiquity

I'm marking WIP because we are discussing included curtin logs as well there so I will change back to needs review once the tweaks are pushed

Revision history for this message
Olivier Tilloy (osomon) wrote :

LGTM, but I did a quick test on my desktop running impish and I am seeing an unexpected behaviour. After installing the ubuntu-desktop-installer snap, and dropping this apport hook in /usr/share/apport/package-hooks/ubuntu-desktop-installer.py, when I run `ubuntu-bug ubuntu-desktop-installer` I get an apport dialog that says:

    You have two versions of this application installed, which one do you want to report a bug against?

    [X] ubuntu-desktop-installer 0+git.4e24174 (stable) snap
    [ ] ubuntu-desktop-installer deb package

There is obviously no deb package for ubuntu-desktop-installer, so this is confusing at best.

2883. By Sebastien Bacher

Let users report issues about the new desktop installer on launchpad

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for testing Olivier. The question was coming from setting report["Package"], which was copying from subiquity. It doesn't seem to be required, I removed the line now and it resolves the issue while still doing the right thing.

I've also added the curtin debug now so setting back to 'Needs review'

@Brian, about the snap revision, the version and channel are already collected in https://bazaar.launchpad.net/~ubuntu-core-dev/ubuntu/jammy/apport/ubuntu/view/head:/apport/report.py#L388 so we should just update that function to also add the revision to the version string, let's keep it as a separate topic.

Revision history for this message
Olivier Tilloy (osomon) wrote :

LGTM now. I can confirm the issue I was seeing is gone, and I was able to successfully file a bug with `ubuntu-bug ubuntu-desktop-installer` that had all the relevant information attached.

review: Approve
Revision history for this message
Brian Murray (brian-murray) wrote :

The reason the "package" hook for subiquity and ubiquity are included in apport is so that one can report a bug about the installation process after the installation has completed and subiquity and ubiquity are no longer installed. Testing the hook a bit I've discovered (remembered?) that the SourcePackage setting in the subiquity hook is there to workaround (or trick?) apport not starting the bug reporting process without that. If I just add "report['SourcePackage'] = ubuntu-desktop-installer" I'm able to report a bug about ubuntu-desktop-installer with or without the snap being installed. I'm going to assume that's the behavior you want and upload the hook with that change.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for pointing that out, indeed it would be nicer to be able to report from the installed system. I checked that adding the SourcePackage isn't making the deb or snap prompt be displayed

Revision history for this message
Brian Murray (brian-murray) wrote :

I've merged this and I'm in the process of uploading it but ran into some autopkgtest failures I need to sort out.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'data/package-hooks/ubuntu-desktop-installer.py'
2--- data/package-hooks/ubuntu-desktop-installer.py 1970-01-01 00:00:00 +0000
3+++ data/package-hooks/ubuntu-desktop-installer.py 2022-01-21 15:04:58 +0000
4@@ -0,0 +1,39 @@
5+"""
6+Send reports about ubuntu-desktop-installer to the correct Launchpad project.
7+
8+"""
9+import os
10+
11+from apport import hookutils
12+
13+
14+def add_info(report, ui):
15+
16+ udilog = os.path.realpath("/var/log/installer/ubuntu_desktop_installer.log")
17+ hookutils.attach_file_if_exists(report, udilog, "UdiLog")
18+
19+ # rewrite this section so the report goes to the project in Launchpad
20+ report[
21+ "CrashDB"
22+ ] = """{
23+ "impl": "launchpad",
24+ "project": "ubuntu-desktop-installer",
25+ "bug_pattern_url": "http://people.canonical.com/~ubuntu-archive/bugpatterns/bugpatterns.xml"
26+ }"""
27+
28+ subiquitylog = os.path.realpath("/var/log/installer/subiquity-server-debug.log")
29+ hookutils.attach_file_if_exists(report, subiquitylog, "SubiquityLog")
30+
31+ hookutils.attach_file_if_exists(
32+ report, "/var/log/installer/subiquity-curtin-install.conf", "CurtinConfig"
33+ )
34+ hookutils.attach_file_if_exists(
35+ report, "/var/log/curtin/install.log", "CurtinLog"
36+ )
37+ hookutils.attach_file_if_exists(
38+ report, "/var/log/curtin/curtin-error-logs.tar", "CurtinError"
39+ )
40+
41+ hookutils.attach_file_if_exists(
42+ report, "/var/log/installer/block/probe-data.json", "ProbeData"
43+ )

Subscribers

People subscribed via source and target branches