common, cli, python, rpmbuild, frontend, backend: DistGit source method
The new (sub)package copr-distgit-client provides a trivial script that
is able to map a clone url into a corresponding lookaside cache
configuration, and then download the corresponding source files
referenced by 'sources' file in the git repo.
The utility is pretty minimal, the logic is slightly inspired by
fedpkg-minimal and rhpkg-simple utilities (though some of the
peculiarities from rhpkg-simple still need to be implemented). The
difference is that we don't have to pay attention to make it
super-minimal because we don't plan to run that utility from within the
minimal buildchroot (we can afford implementing it in python), for more
info see [1].
The rest of the change builds on top of the new utility, and basically
allows Copr Frontend to map the pre-configured DistGit instance names to
corresponding clone urls, and build source RPMs using the new tool.
The rpmbuild side newly doesn't need to use the feature-full rhpkg-util
and so called "scm method" for building from our own "proxy"
DistGit instance (perfect match for copr-dist-git-client as well). So
this also allowed us to simplify the Frontend <-> Builder RPM task JSON
format.
The DistGit method is similar to the SCM method in a sense that we
should react on webhooks, create copr-dirs for pull requests, etc. But
it still makes sense to have it separately, because a lot of the
information provided in SCM method form wouldn't be used. Btw., this is
a first method which doesn't require us to specify both the
local-package name (Copr) and the remote-package name (dist-git) -- they
are the same both locally and remotely. To keep things simple for now,
we intentionally don't special-case stuff like SCLs ('postgresql.git'
holds 'rh-postgresqlNN-postgrseql.src.rpm' sources).
I noticed that we'd name-clash with the old distgit method, so on all
the conflicting places the new name-variant has a *simple suffix (e.g.
PackageFormDistGit vs PackageFormDistGitSimple). In future we should
drop the old distgit method entirely.
[1] https://pagure.io/koji/issue/2432
Fixes: #529, #798, #1219.