can't add a private PPA

Bug #1991553 reported by Junien F
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Undecided
Unassigned
Jammy
New
Undecided
Unassigned

Bug Description

As per today's discussion in ~is :

add-apt-repository has a bug when adding a private PPA. Quoting ~cjwatson :

===
It asks Launchpad for all your personal archive subscriptions _that have tokens_. But `Person:+archivesubscriptions` also shows subscriptions without tokens - the token is generated when you click on Viewt here for the first time.

Instead, `add-apt-repository` should call `getArchiveSubscriptionURL` (not `getArchiveSubscriptionURLs`) for the archive it's interested in. That generates tokens on-demand. Either it will get an HTTP 401, or it will get a URL which it can parse for the username and password.
===

Thanks !

tags: added: foundations-triage-discuss
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-properties (Ubuntu):
status: New → Confirmed
Revision history for this message
Tong Shinn (tshinn) wrote :

The store team has recently been impacted by this issue when trying to update snapdevicegw to run on jammy instead of focal.

Revision history for this message
Dan Streetman (ddstreet) wrote (last edit ):

> Instead, `add-apt-repository` should call `getArchiveSubscriptionURL` (not `getArchiveSubscriptionURLs`)

this doesn't seem to work correctly.

For example:

In [25]: lp.me.getArchiveSubscriptionURLs()
Out[25]:
['https://ddstreet:<email address hidden>/canonical-support-eng/soscleaner-deletedppa/ubuntu',
 'https://ddstreet:<email address hidden>/canonical-support-eng/ddstreet-deletedppa/ubuntu',
 'https://ddstreet:<email address hidden>/jedis/test-deletedppa1/ubuntu',
 'https://ddstreet:<email address hidden>/jedis/test-deletedppa/ubuntu',
 'https://ddstreet:<email address hidden>/canonical-support-eng/sf155616-deletedppa/ubuntu',
 'https://ddstreet:<email address hidden>/canonical-support-eng/sf107001-deletedppa/ubuntu',
 'https://ddstreet:<email address hidden>/canonical-support-eng/sf99522-deletedppa/ubuntu',
 'https://ddstreet:<email address hidden>/canonical-support-eng/sf94878-deletedppa/ubuntu']

In [26]: jedis = lp.people('jedis')

In [28]: testdeletedppa = jedis.getPPAByName(name='test-deletedppa')

In [29]: lp.me.getArchiveSubscriptionURL(archive=testdeletedppa)
Out[29]:
{'self_link': 'https://api.launchpad.net/devel/~ddstreet',
 'web_link': 'https://launchpad.net/~ddstreet',
 'resource_type_link': 'https://api.launchpad.net/devel/#person',

...and the rest of my personal object (i.e. lp.me) as a python object.

It's the same result when I try with a non-deleted ppa, which doesn't show up in getArchiveSubscriptionURLs():

In [37]: lteam = lp.people('launch-lite')

In [38]: lppa = lteam.getPPAByName(name='ppa')

In [39]: lp.me.getArchiveSubscriptionURL(archive=lppa)
Out[39]:
{'self_link': 'https://api.launchpad.net/devel/~ddstreet',
 'web_link': 'https://launchpad.net/~ddstreet',
 'resource_type_link': 'https://api.launchpad.net/devel/#person',
...

Until that bug is fixed (and that bug isn't in software-properties), I don't think add-apt-repository can be changed to use getArchiveSubscriptionURL(). Or at least, if this bug only applies to me, then I can't make the change in software-properties since I wouldn't be able to test the change...

Changed in software-properties (Ubuntu):
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.99.39

---------------
software-properties (0.99.39) mantic; urgency=medium

  * Add cjwatson patch to use getArchiveSubscriptionURL() for private PPAs
  * Fix getArchiveSubscriptionURL() API call and tests
  * Resolve adding private PPAs, which do not yet have a token LP: #1991553

 -- Dimitri John Ledkov <email address hidden> Fri, 25 Aug 2023 22:17:31 +0100

Changed in software-properties (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.