Documentation for syncSources() suggests using copyPackage() instead, but it does not appear to exist?

Bug #1993782 reported by Marius Gedminas
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
launchpadlib
Triaged
Low
Unassigned

Bug Description

https://launchpad.net/+apidoc/1.0.html#archive-syncSources says

> DEPRECATED: syncSource and syncSources are deprecated, and will be removed entirely in the future. Use the asynchronous copyPackage method instead, and poll getPublishedSources if you need to await completion.

but https://launchpad.net/+apidoc/1.0.html does not have any documentation for a 'copyPackage' method anywhere.

As a user of launchpadlib (https://github.com/mgedmin/ppa-copy-packages), what am I supposed to do? Continue using syncSources until it actually goes away?

Revision history for this message
Jürgen Gmach (jugmac00) wrote :

Hey Marius,

In our "getting started" guide ( https://help.launchpad.net/API/launchpadlib ) you can read the following:

> For historical reasons the default is '1.0', and you may want to use this in certain special circumstances, but in most cases you should use 'devel' so that you get a reasonably complete and current interface.

So, if you go to https://launchpad.net/+apidoc/devel.html instead of https://launchpad.net/+apidoc/1.0.html you can find the mentioned API documentation.

When I have a brief look at how the API docs are generated, it looks like the endpoints have a decorator with a version string - the script then decides which endpoints to include for documentation. I assume the reported mismatch happened as for the 1.0 documentation the new endpoint was correctly left out, but the old endpoint's documentation was already updated and so went into the 1.0 documentation.

I am not sure whether it is possible to generate a proper 1.0 documentation retroactively - maybe by checking out a very old commit?

Anyway, we both should make sure the mentioned documentation gets some love ( https://help.launchpad.net/API/launchpadlib ) and the apidoc overview ( https://launchpad.net/+apidoc/ ) makes it much clearer which version should be used.

Apart from that - the mentioned functions have been deprecated already 9 years ago, and there are no current plans to remove them in the near future.

If you want to update your cli tool, you could also have a look at https://code.launchpad.net/ubuntu-archive-tools which - amongst many other things - does a similar job compared to your cli tool - there we already use the new endpoints.

Sorry for the confusion!

Jürgen Gmach
Launchpad team

Changed in launchpadlib:
status: New → Triaged
importance: Undecided → Low
tags: added: api
tags: added: documentation
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.