25dcdda common, cli, python, rpmbuild, frontend, backend: DistGit source method

46 files Authored by praiskup 3 years ago, Committed by praiskup 3 years ago,
46 files changed. 1822 lines added. 109 lines removed.
backend/copr_backend/background_worker_build.py
file modified
+1 -1
cli/copr-cli.spec
file modified
+6 -4
cli/copr_cli/main.py
file modified
+106 -0
cli/tests/test_distgit.py
file added
+156
common/copr_common/enums.py
file modified
+1 -0
common/python-copr-common.spec
file modified
+1 -1
frontend/coprs_frontend/coprs/filters.py
file modified
+1 -0
frontend/coprs_frontend/coprs/forms.py
file modified
+134 -29
frontend/coprs_frontend/coprs/helpers.py
file modified
+1 -0
frontend/coprs_frontend/coprs/logic/builds_logic.py
file modified
+19 -0
frontend/coprs_frontend/coprs/logic/dist_git_logic.py
file modified
+9 -0
frontend/coprs_frontend/coprs/models.py
file modified
+16 -3
frontend/coprs_frontend/coprs/templates/_helpers.html
file modified
+1 -1
frontend/coprs_frontend/coprs/templates/coprs/detail/_builds_forms.html
file modified
+16 -0
frontend/coprs_frontend/coprs/templates/coprs/detail/_describe_source.html
file modified
+10 -0
frontend/coprs_frontend/coprs/templates/coprs/detail/_package_forms.html
file modified
+23 -0
frontend/coprs_frontend/coprs/templates/coprs/detail/_package_helpers.html
file modified
+5 -0
frontend/coprs_frontend/coprs/templates/coprs/detail/add_build.html
file modified
+1 -0
frontend/coprs_frontend/coprs/templates/coprs/detail/add_build/distgit.html
file added
+11
frontend/coprs_frontend/coprs/views/apiv3_ns/apiv3_builds.py
file modified
+24 -0
frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py
file modified
+1 -7
frontend/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py
file modified
+46 -2
frontend/coprs_frontend/coprs/views/coprs_ns/coprs_packages.py
file modified
+16 -2
frontend/coprs_frontend/pagure_events.py
file modified
+5 -2
frontend/coprs_frontend/tests/coprs_test_case.py
file modified
+10 -1
frontend/coprs_frontend/tests/test_apiv3/test_builds.py
file modified
+157 -2
frontend/coprs_frontend/tests/test_apiv3/test_packages.py
file added
+75
frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_method_distgit.py
file added
+75
python/copr/test/client_v3/test_builds.py
file modified
+20 -1
python/copr/test/client_v3/test_packages.py
file added
+30
python/copr/v3/proxies/build.py
file modified
+32 -0
python/python-copr.spec
file modified
+1 -1
python/run_tests.sh
file modified
+5 -1
rpmbuild/bin/copr-distgit-client
file added
+10
rpmbuild/copr-distgit-client
file added
+22
rpmbuild/copr-rpmbuild.spec
file modified
+55 -6
rpmbuild/copr_distgit_client.py
file added
+335
rpmbuild/copr_rpmbuild/helpers.py
file modified
+40 -0
rpmbuild/copr_rpmbuild/providers/__init__.py
file modified
+2 -0
rpmbuild/copr_rpmbuild/providers/distgit.py
file added
+39
rpmbuild/copr_rpmbuild/providers/scm.py
file modified
+5 -32
rpmbuild/etc/copr-distgit-client/default.ini
file added
+25
rpmbuild/main.py
file modified
+8 -12
rpmbuild/run_tests.sh
file modified
+5 -1
rpmbuild/tests/test_distgit.py
file added
+88
rpmbuild/tests/test_distgit_client.py
file added
+173
    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.
    
        
file modified
+6 -4
file modified
+106 -0
file modified
+1 -0
file modified
+1 -1
file modified
+5 -1
file modified
+55 -6
file modified
+8 -12
file modified
+5 -1