Comment 29 for bug 253119

Revision history for this message
Colin Watson (cjwatson) wrote :

I think nowadays it would be sensible to use the Launchpad API for this via launchpadlib rather than scraping HTML. For example, something like this can get a URL from which you can fetch the raw changelog for version 139 of source package launchpad-buildd in ppa:launchpad/ppa:

  >>> archive = lp.archives.getByReference(reference='ppa:launchpad/ubuntu/ppa')
  >>> spph = archive.getPublishedSources(
  ... source_name='launchpad-buildd', exact_match=True, version='139')[0]
  >>> changelog_url = spph.changelogUrl()

You have to be using the "devel" API version, but I think that's reasonable here.

Now, obviously this is very hardcoded and needs more robustness, but it does the job and is far preferable to HTML scraping.

The main caveat is that this will only work reasonably for public PPAs, since update-manager will have to use the API anonymously. As long as error handling is reasonable, having changelogs only for public PPAs is still much better than having them for no PPAs at all.

I can see the rationale for actually publishing the changelogs alongside the .debs directly: it would be much easier for clients. However, it would be pretty cumbersome to actually do it in the current architecture. We intend eventually to move to "diskless PPAs", where ppa.launchpad.net would become a caching frontend that fetches information directly from the database as needed rather than publishing things as static files, which has various infrastructure-scaling benefits. That would make it much easier to do this kind of thing. Plans for this are still in their infancy, though, and I can't give you a timescale. For the moment, I would recommend taking the anonymous-Launchpad-API approach outlined above in update-manager.