Merge ~pushkarnk/ubuntu/+source/onionshare:werkzeug-3.0.1-compat into ubuntu/+source/onionshare:ubuntu/devel

Proposed by Pushkar Kulkarni
Status: Needs review
Proposed branch: ~pushkarnk/ubuntu/+source/onionshare:werkzeug-3.0.1-compat
Merge into: ubuntu/+source/onionshare:ubuntu/devel
Diff against target: 85 lines (+55/-1)
4 files modified
debian/changelog (+6/-0)
debian/control (+2/-1)
debian/patches/series (+1/-0)
debian/patches/werkzeug-3.0.1-compat.patch (+46/-0)
Reviewer Review Type Date Requested Status
Lukas Märdian (community) Disapprove
Robie Basak Needs Information
Sergio Durigan Junior (community) Needs Fixing
Review via email: mp+458934@code.launchpad.net

Description of the change

While the next release of onionshare is awaited, I propose this patch to achieve API compatibility with the python3-werkzeug dependency (which is currently stuck in -proposed). All of the autopkgtests fail without this patch. This patch is derived out of and is a small subset of [1].

Built in PPA: https://launchpad.net/~pushkarnk/+archive/ubuntu/merges-ppa/+build/27656381

[1] https://github.com/onionshare/onionshare/pull/1677

To post a comment you must log in.
Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

$ autopkgtest --apt-upgrade --shell-fail --apt-pocket=proposed=src:python3-werkzeug --output-dir output-os ./onionshare ./onionshare-cli_2.6-5~ppa1_all.deb -- lxd autopkgtest/ubuntu/noble/amd64
...
...
...
autopkgtest [19:58:05]: @@@@@@@@@@@@@@@@@@@@ summary
onionshare-cli_help PASS (superficial)
share_files PASS
receive_files PASS
share_website PASS
chat_server PASS
onionshare_help PASS (superficial)

Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Thanks for the MP.

Could you please add DEP-3 headers to the patch you're adding? It's really helpful, especially when we need to determine why a delta has been introduced.

Also, it would be great if you could submit this patch to Debian as well. This will benefit them and us. You can submit a Merge Request here: https://salsa.debian.org/pkg-privacy-team/onionshare

Thanks.

review: Needs Fixing
0d8707d... by Pushkar Kulkarni

Add DEP3 header to the patch

Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote :

Thanks for the review comments.

Update:

 - Created a Debian bug report [1] and MR [2].
 - Added a DEP3 header to the patch in this MP.

[1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1061360
[2] https://salsa.debian.org/pkg-privacy-team/onionshare/-/merge_requests/3

Revision history for this message
Robie Basak (racb) wrote :

Thank you for working on this!

Same comment about the Origin: dep3 header: I had to do some investigation to identify that it's upstream commit 9a19c471 that actually landed upstream, though in this case it looks unmodified from the commit provided in the PR. It would be helpful to link to this directly from the DEP3 headers (though a link to the upstream PR is also helpful!).

I can see that you've taken a subset of these changes and that's fine.

How are you validating that this is sufficient to get onionshare working correctly against the newer werkzeug? I see that this is a GUI app. Have you tried running it or are you relying on autopkgtests alone? If the latter and given the nature of the necessary changes, how are we sure that we haven't missed something?

review: Needs Information
24cb13e... by Pushkar Kulkarni

Update DEP3 header with upstream commit URL

Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote (last edit ):

> Thank you for working on this!
>

Thanks for the detailed review!

> Same comment about the Origin: dep3 header: I had to do some investigation to
> identify that it's upstream commit 9a19c471 that actually landed upstream,
> though in this case it looks unmodified from the commit provided in the PR. It
> would be helpful to link to this directly from the DEP3 headers (though a link
> to the upstream PR is also helpful!).
>

I've updated the DEP3 header with the commit link.

> I can see that you've taken a subset of these changes and that's fine.
>
> How are you validating that this is sufficient to get onionshare working
> correctly against the newer werkzeug? I see that this is a GUI app. Have you
> tried running it or are you relying on autopkgtests alone? If the latter and
> given the nature of the necessary changes, how are we sure that we haven't
> missed something?

No, I solely depended on the autopkgtests which run the upstream unit tests (I guess all of them, but I'd need some time to confirm that). This change goes into the cli component and is specific to change in the url API only. So, I didn't consider any further testing, though the thought crossed my mind!

That brings me to a question: while patching upstream packages is passing the upstream unit/regression test suite considered as a sufficient condition for submitting the patch?

Revision history for this message
Pushkar Kulkarni (pushkarnk) wrote (last edit ):

I just realized that Debian merged the MR for onionshare [1].

[1] https://github.com/onionshare/onionshare/commit/9a19c47185289676e86f8bce1f0d54c941500da3

Revision history for this message
Lukas Märdian (slyon) wrote :

Removing ~ubuntu-sponsors and adding a "Dissaprove", as the relevant changes have been included in onionshare 2.6-6 https://launchpad.net/ubuntu/+source/onionshare/2.6-6 as sync'ed from experimental.

python-werkzeug 3.0 migrated in the meantime.

review: Disapprove

Unmerged commits

24cb13e... by Pushkar Kulkarni

Update DEP3 header with upstream commit URL

0d8707d... by Pushkar Kulkarni

Add DEP3 header to the patch

3b27927... by Pushkar Kulkarni

Update changelog

f77fe37... by Pushkar Kulkarni

Update maintainer

c8b4ed8... by Pushkar Kulkarni

Add patch for compatibility with werkzeug 3.0.1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/debian/changelog b/debian/changelog
2index 9715c6d..02de1e4 100644
3--- a/debian/changelog
4+++ b/debian/changelog
5@@ -1,3 +1,9 @@
6+onionshare (2.6-5ubuntu1) noble; urgency=medium
7+
8+ * d/patches: Add patch for compatibility with the werkzeug 3.0.1 API (LP: #2048769)
9+
10+ -- Pushkar Kulkarni <pushkar.kulkarni@canonical.com> Thu, 18 Jan 2024 20:49:43 +0530
11+
12 onionshare (2.6-5) unstable; urgency=medium
13
14 * Install desktp/appmetadata at expected places. (Closes: #1036691)
15diff --git a/debian/control b/debian/control
16index 01a6f26..e4ae94d 100644
17--- a/debian/control
18+++ b/debian/control
19@@ -1,5 +1,6 @@
20 Source: onionshare
21-Maintainer: Debian Privacy Tools Maintainers <pkg-privacy-maintainers@lists.alioth.debian.org>
22+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
23+XSBC-Original-Maintainer: Debian Privacy Tools Maintainers <pkg-privacy-maintainers@lists.alioth.debian.org>
24 Uploaders:
25 anonym <anonym@riseup.net>,
26 Clément Hermann <nodens@debian.org>
27diff --git a/debian/patches/series b/debian/patches/series
28index b322fad..56536ac 100644
29--- a/debian/patches/series
30+++ b/debian/patches/series
31@@ -1 +1,2 @@
32 0001-Make-it-compatible-with-Flask-version-inside-Debian.patch
33+werkzeug-3.0.1-compat.patch
34diff --git a/debian/patches/werkzeug-3.0.1-compat.patch b/debian/patches/werkzeug-3.0.1-compat.patch
35new file mode 100644
36index 0000000..4d609bd
37--- /dev/null
38+++ b/debian/patches/werkzeug-3.0.1-compat.patch
39@@ -0,0 +1,46 @@
40+From: Pushkar Kulkarni <pushkar.kulkarni@canonical.com>
41+Description: Adapt onionshare to the python-werkzeug 3.0.1 API
42+ This patch cherry-picks a small part of an upstream pull-request,
43+ something relevant to the werkzeug API compatibility only.
44+Origin: upstream, https://github.com/onionshare/onionshare/commit/9a19c47185289676e86f8bce1f0d54c941500da3
45+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/onionshare/+bug/2048769
46+--- a/cli/onionshare_cli/web/send_base_mode.py
47++++ b/cli/onionshare_cli/web/send_base_mode.py
48+@@ -25,7 +25,7 @@
49+ import gzip
50+ from flask import Response, request
51+ from unidecode import unidecode
52+-from werkzeug.urls import url_quote
53++from urllib.parse import quote
54+
55+
56+ class SendBaseModeWeb:
57+@@ -284,7 +284,7 @@
58+ r.headers.set("Content-Length", filesize)
59+ filename_dict = {
60+ "filename": unidecode(basename),
61+- "filename*": "UTF-8''%s" % url_quote(basename),
62++ "filename*": "UTF-8''%s" % quote(basename),
63+ }
64+ r.headers.set("Content-Disposition", "inline", **filename_dict)
65+ (content_type, _) = mimetypes.guess_type(basename, strict=False)
66+--- a/cli/onionshare_cli/web/share_mode.py
67++++ b/cli/onionshare_cli/web/share_mode.py
68+@@ -29,7 +29,7 @@
69+ from flask import Response, request, render_template, make_response, abort
70+ from unidecode import unidecode
71+ from werkzeug.http import parse_date, http_date
72+-from werkzeug.urls import url_quote
73++from urllib.parse import quote
74+
75+ from .send_base_mode import SendBaseModeWeb
76+
77+@@ -233,7 +233,7 @@
78+ r.headers.set("Content-Length", range_[1] - range_[0] + 1)
79+ filename_dict = {
80+ "filename": unidecode(basename),
81+- "filename*": "UTF-8''%s" % url_quote(basename),
82++ "filename*": "UTF-8''%s" % quote(basename),
83+ }
84+ r.headers.set("Content-Disposition", "attachment", **filename_dict)
85+ # guess content type

Subscribers

People subscribed via source and target branches