This is an automated email from the git hooks/post-receive script.
praiskup pushed a commit to branch master
in repository copr/copr.
The following commit(s) were added to refs/heads/master by this push:
new c765ab8 [frontend] allow us to create temporary aliases for chroots
c765ab8 is described below
commit c765ab8c6a8018ba55175662eb6bf6dd96f7b599
Author: Jakub Kadlčík <frostyx(a)email.cz>
AuthorDate: Mon May 27 23:22:58 2019 +0200
[frontend] allow us to create temporary aliases for chroots
See #727 (comment-568671)
See BZ 1705912
This change will allow us to simply solve the BZ:1705912 by configuring
`CHROOT_NAME_RELEASE_ALIAS` to `{"epel-8": "rhelbeta-8"}`, which will
effectively redirect requests for "epel-8" repo to "rhelbeta-8" repo.
---
frontend/coprs_frontend/coprs/config.py | 6 ++++++
frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py | 1 +
2 files changed, 7 insertions(+)
diff --git a/frontend/coprs_frontend/coprs/config.py b/frontend/coprs_frontend/coprs/config.py
index 21530ba..1fc6ec4 100644
--- a/frontend/coprs_frontend/coprs/config.py
+++ b/frontend/coprs_frontend/coprs/config.py
@@ -81,6 +81,12 @@ class Config(object):
# When the data in EOL chroots should be deleted (in days)
DELETE_EOL_CHROOTS_AFTER = 180
+ # We may have a (temporary) chroot that doesn't correspond with /etc/os-release
+ # on a client system, e.g. "rhelbeta-8" chroots in Copr which doesn't match to
+ # any real system, instead it is a temporary alias for "epel-8". In such case,
+ # set this to {"epel-8": "rhelbeta-8"}
+ CHROOT_NAME_RELEASE_ALIAS = {}
+
class ProductionConfig(Config):
DEBUG = False
diff --git a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 3d3d0aa..ebce28b 100644
--- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -710,6 +710,7 @@ def generate_repo_file(copr_dirname, name_release, repofile, username=None, grou
def render_generate_repo_file(copr_dir, name_release):
+ name_release = app.config["CHROOT_NAME_RELEASE_ALIAS"].get(name_release, name_release)
mock_chroot = coprs_logic.MockChrootsLogic.get_from_name(name_release, noarch=True).first()
if not mock_chroot:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.