django: Origin tarball validation and retrieval

Django migration: #47 (closed)

This MR re-adds the origin tarball validation and retrieval.

The original class OriginTarball has been converted to a Origin object suitable to be used in a Dsc.

Origin has two main methods:

  • validate() that checks against the Debian archive origin files referenced in the Dsc.
  • fetch() that retrieve the tarball from whether the archive or the local repository.

OfficialPackage class has been split into 2 classes, in an attempt to distinguish communication to different debian services:

  • ClientDebianArchive that can download files from the archive (fetch_from_pool())
  • ClientFTPMasterAPI that can query the ftpmaster api to fetch info about origin tarballs (get_origin_files())

Those classes inherit from connection helper ClientHTTP and ClientJsonAPI. Other debian services can be implemented using those helpers.

Two main changes have been made to the validation and the retrieval:

  • Validation is only done against Debian archive and not the local repository. Allowing users to overrides their orig files like they do with other source package files (dsc, debian.tar, etc...)
  • Validation ignores extra and missing origin files. Only referenced files are validated. This allows to upload a new debian revision with another tarball using a different compression scheme, mirroring the behavior of the archive.

I've also dropped the ability to customize the Repository for the importer as that was to facilitate testing. I've found a better way to alter that setting.

Tox and gitlab CI have dropped support for django-1.x, moving to using the 2.x versions from buster-backports

Edited by Baptiste Beauplat

Merge request reports

Loading