5e6f7e1 frontend, cli, python, rpmbuild: better bootstrap config

35 files Authored by praiskup 3 years ago, Committed by praiskup 3 years ago,
35 files changed. 751 lines added. 286 lines removed.
beaker-tests/Sanity/copr-cli-basic-operations/runtest.sh
file modified
+0 -10
cli/copr-cli.spec
file modified
+1 -1
cli/copr_cli/build_config.py
file modified
+15 -0
cli/copr_cli/main.py
file modified
+58 -34
cli/tests/test_cli.py
file modified
+2 -2
frontend/copr-frontend.spec
file modified
+1 -0
frontend/coprs_frontend/alembic/versions/63db6872060f_add_bootstrap_config_columns.py
file modified
+11 -15
frontend/coprs_frontend/coprs/forms.py
file modified
+69 -22
frontend/coprs_frontend/coprs/logic/builds_logic.py
file modified
+3 -1
frontend/coprs_frontend/coprs/logic/complex_logic.py
file modified
+22 -3
frontend/coprs_frontend/coprs/logic/coprs_logic.py
file modified
+16 -11
frontend/coprs_frontend/coprs/models.py
file modified
+24 -5
frontend/coprs_frontend/coprs/templates/._helpers.html.swo
file removed
-0
frontend/coprs_frontend/coprs/templates/_helpers.html
file modified
+31 -47
frontend/coprs_frontend/coprs/templates/coprs/_coprs_forms.html
file modified
+4 -23
frontend/coprs_frontend/coprs/templates/coprs/detail/edit_chroot.html
file modified
+4 -36
frontend/coprs_frontend/coprs/views/api_ns/api_general.py
file modified
+12 -9
frontend/coprs_frontend/coprs/views/apiv3_ns/apiv3_build_chroots.py
file modified
+4 -2
frontend/coprs_frontend/coprs/views/apiv3_ns/apiv3_builds.py
file modified
+7 -0
frontend/coprs_frontend/coprs/views/apiv3_ns/apiv3_project_chroots.py
file modified
+8 -4
frontend/coprs_frontend/coprs/views/apiv3_ns/apiv3_projects.py
file modified
+10 -7
frontend/coprs_frontend/coprs/views/backend_ns/backend_general.py
file modified
+4 -2
frontend/coprs_frontend/coprs/views/coprs_ns/coprs_builds.py
file modified
+1 -0
frontend/coprs_frontend/coprs/views/coprs_ns/coprs_chroots.py
file modified
+2 -2
frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
file modified
+2 -4
frontend/coprs_frontend/tests/coprs_test_case.py
file modified
+12 -5
frontend/coprs_frontend/tests/request_test_api.py
file added
+213
frontend/coprs_frontend/tests/test_apiv3/test_projects.py
file modified
+16 -3
frontend/coprs_frontend/tests/test_config_overrides.py
file added
+129
python/copr/v3/proxies/project.py
file modified
+33 -14
python/copr/v3/proxies/project_chroot.py
file modified
+12 -1
python/python-copr.spec
file modified
+1 -1
rpmbuild/copr_rpmbuild/builders/mock.py
file modified
+5 -3
rpmbuild/mock.cfg.j2
file modified
+13 -9
rpmbuild/tests/test_mock.py
file modified
+6 -10
    frontend, cli, python, rpmbuild: better bootstrap config
    
    Drop "image" configuration option in build and project, and keep it only
    in CoprChroot.  There's no sane existing container image that could be
    used for successful bootstrapping of all the supported chroots, so it
    isn't necessary to give the users this gun to shoot themselves.
    
    Make sure that per-project we use "bootstrap=default" by default, and
    that per-chroot config by default doesn't affect the per-project
    configuration (which means the default bootstrap=unchanged).  Similar
    per-build option by default doesn't affect the per-project and
    per-chroot configuration.  So we fallback from per-build => per-chroot
    => per-project => default configuration (the first in the chain wins).
    
    Since we may make this happen now, we finally don't default the
    bootstrap configuration to "off" - but we default to what's shipped in
    mock-core-configs.  First it means that bootstrap is by default turned
    on (was off) in all chroots, but second it allows us to tweak
    bootstrap/bootstrap_image on/off per-mock chroot in the configuration in
    future.
    
    Changed forms.py:
    - drop the unused 'description=' argument from create_mock_*() methods
    - allow mock bootstrap image name without an explicit tag
    - without javascript, by default - we need to have the bootstrap image
      field shown (not hidden as before)
    - the jquery needs to use .val() instead of .value (which is undefined
      on the initial load otherwise).
    - centralize form rendering on one place
    
    In the Web-UI, the chroot form labels are now right aligned (which is
    the default).  It is then compliant with the render_field() default.
    
    Rename 'bootstrap_config -> bootstrap'.  Also Rename the cli option
    '--use-bootstrap' to just '--bootstrap'.
    
    Implement the forgotten parts in 'edit-chroot'.
    
    Make everything consistent to use 'on' and 'off' instead of mixup of
    'on/enabled' and 'off/disabled' in cli/frontend/python/etc.
    
    Move the new fields from ModifyChrootForm to parent ChrootForm.
    
    Do the necessary mock's child.cfg config jinja changes, so the options
    actually have some effect on builder.  Wile on it, we had some weird
    code chunk in the template behind use_bootstrap_container condition,
    which was setting up some bootstrap_* mock options.  This doesn't seem
    to be needed, and use_bootstrap_container is dropped itself - so I
    dropped that chunk.
    
    The same jinja template fixes are added to 'copr-cli mock-config'
    template.
    
    Fix repeate-build route form to also accept the arguments.
    
    For backward compatibility, I re-added use_bootstrap_container into
    the appropriate frontend API routes, and to python-copr -- so we support
    old clients by frontend, and old user's script in Python API.
    
    In 'rpmbuild', we have to cleanup 'root-cache' after each build too,
    otherwise no matter we '--scrub=bootstrap', the chroot wouldn't be
    re-initialized in the next build.
    
    Drop .swo binary file which broke our Jenkins CI.
    
    Add testsuite, and fix some PyLint issues.
    
    Complements/Replaces: #1445
    Merges: #1525
    Fixes: #1308
    
        
file modified
+1 -1
file modified
+15 -0
file modified
+58 -34
file modified
+2 -2
file modified
+1 -0
file modified
+1 -1
file modified
+13 -9
file modified
+6 -10