[copr] master: [frontend] fix download stats css, show stats for rpm downloads not for metadata (858c148)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 858c1486982a988b2ef2a5e627c12160da6f53e9
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Wed Jun 3 18:00:09 2015 +0200
[frontend] fix download stats css, show stats for rpm downloads not for metadata
>---------------------------------------------------------------
frontend/coprs_frontend/coprs/static/copr.css | 7 +++++++
.../coprs/templates/coprs/detail/overview.html | 4 ++--
.../coprs/views/coprs_ns/coprs_general.py | 7 ++++++-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/static/copr.css b/frontend/coprs_frontend/coprs/static/copr.css
index 2110dcd..1abf449 100644
--- a/frontend/coprs_frontend/coprs/static/copr.css
+++ b/frontend/coprs_frontend/coprs/static/copr.css
@@ -576,3 +576,10 @@ textarea {
-webkit-border-radius: 4px;
text-align: right;
}
+
+.dl-stat
+{
+ //text-decoration: none;
+ // text-decoration: dotted underline;
+ border-bottom: 0.1em dotted black;
+}
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
index 8013c3d..85ba74a 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -62,12 +62,12 @@
</td>
<td>
- <abbr title="Total number of repo installation">repo installed</abbr>:
+ <abbr class="dl-stat" title="Total number of repo installation">repo installed</abbr>:
{{ repo.dl_stat }}
<br />
{% for arch in repo.arch_list %}
- <abbr title="Number of downloaded packages for {{repo.name_release_human}} {{arch}} in the last 7 days">
+ <abbr class="dl-stat" title="Number of downloaded packages for {{repo.name_release_human}} {{arch}} in the last 7 days">
{{arch}} packages</abbr>:
{{ repo.rpm_dl_stat[arch] }}
<br />
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 d8b87c0..f1b5e98 100644
--- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -194,7 +194,12 @@ def copr_detail(username, coprname):
repos_info = {}
for chroot in copr.active_chroots:
- chroot_rpms_dl_stat_key = CHROOT_REPO_MD_DL_STAT_FMT.format(
+ # chroot_rpms_dl_stat_key = CHROOT_REPO_MD_DL_STAT_FMT.format(
+ # copr_user=copr.owner.name,
+ # copr_project_name=copr.name,
+ # copr_chroot=chroot.name,
+ # )
+ chroot_rpms_dl_stat_key = CHROOT_RPMS_DL_STAT_FMT.format(
copr_user=copr.owner.name,
copr_project_name=copr.name,
copr_chroot=chroot.name,
8 years, 11 months
[copr] master: [frontend] typo (0e9b82e)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 0e9b82e4bbec17a794bff69574ec8367841623e9
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Wed Jun 3 15:27:35 2015 +0200
[frontend] typo
>---------------------------------------------------------------
.../coprs/templates/coprs/detail/overview.html | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
index b66e94f..8013c3d 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -67,7 +67,7 @@
<br />
{% for arch in repo.arch_list %}
- <abbr title="number of dowloaded packages for {{repo.name_release_human}} {{arch}} in the last 7 days">
+ <abbr title="Number of downloaded packages for {{repo.name_release_human}} {{arch}} in the last 7 days">
{{arch}} packages</abbr>:
{{ repo.rpm_dl_stat[arch] }}
<br />
8 years, 11 months
[copr] master: [frontend] decorator intranet_required should always accept requests from localhost (339f89b)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 339f89bbf16bc3b318d37e7b6d46ac18921a83b4
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Wed Jun 3 15:26:33 2015 +0200
[frontend] decorator intranet_required should always accept requests from localhost
>---------------------------------------------------------------
frontend/coprs_frontend/coprs/views/misc.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/views/misc.py b/frontend/coprs_frontend/coprs/views/misc.py
index 616f4a8..38d0ab5 100644
--- a/frontend/coprs_frontend/coprs/views/misc.py
+++ b/frontend/coprs_frontend/coprs/views/misc.py
@@ -263,8 +263,9 @@ def intranet_required(f):
@functools.wraps(f)
def decorated_function(*args, **kwargs):
ip_addr = IPAddress(flask.request.remote_addr)
- if not any(ip_addr in IPNetwork(addr_or_net)
- for addr_or_net in app.config.get("INTRANET_IPS", ["127.0.0.1",])):
+ accept_ranges = set(app.config.get("INTRANET_IPS", []))
+ accept_ranges.add("127.0.0.1") # always accept from localhost
+ if not any(ip_addr in IPNetwork(addr_or_net) for addr_or_net in accept_ranges):
return ("Stats can be update only from intranet hosts, "
"not {}, check config\n".format(flask.request.remote_addr)), 403
8 years, 11 months
[copr] master: [frontend] showing download stats (645d712)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 645d712e4b8ee03168826b8578024b53e15e13b6
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Wed Jun 3 15:19:29 2015 +0200
[frontend] showing download stats
>---------------------------------------------------------------
.../coprs/templates/coprs/detail/overview.html | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
index 7c22359..b66e94f 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -43,7 +43,7 @@
<tr>
<th class="leftmost">Release</th>
<th>Architecture</th>
- <!-- <th>#Downloads</th> -->
+ <th>#Downloads</th>
<th class="rightmost">Yum Repo </th>
</tr>
{% for repo in repos_info_list %}
@@ -61,18 +61,20 @@
{% endfor %}
</td>
- <!-- <td>
- <center> {{ repo.dl_stat }} </center> <br />
+ <td>
+ <abbr title="Total number of repo installation">repo installed</abbr>:
+ {{ repo.dl_stat }}
+ <br />
- # of repo dl last week<br />
{% for arch in repo.arch_list %}
-
- {{arch}}: {{ repo.rpm_dl_stat[arch] }} <br />
+ <abbr title="number of dowloaded packages for {{repo.name_release_human}} {{arch}} in the last 7 days">
+ {{arch}} packages</abbr>:
+ {{ repo.rpm_dl_stat[arch] }}
+ <br />
{% endfor %}
</td>
- -->
<td class="rightmost">
<a href="{{
url_for(
8 years, 11 months
[copr] master: Automatic commit of package [copr-frontend] release [1.60-1]. (b637662)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit b637662662e3e6d25484eb5fa89053768a97b6b5
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Wed Jun 3 14:40:37 2015 +0200
Automatic commit of package [copr-frontend] release [1.60-1].
>---------------------------------------------------------------
frontend/copr-frontend.spec | 6 +++++-
rel-eng/packages/copr-frontend | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/frontend/copr-frontend.spec b/frontend/copr-frontend.spec
index 22e1e45..26cbaba 100644
--- a/frontend/copr-frontend.spec
+++ b/frontend/copr-frontend.spec
@@ -5,7 +5,7 @@
%endif
Name: copr-frontend
-Version: 1.59
+Version: 1.60
Release: 1%{?dist}
Summary: Frontend for Copr
@@ -192,6 +192,10 @@ service logstash condrestart
%doc documentation/python-doc
%changelog
+* Wed Jun 03 2015 Valentin Gologuzov <vgologuz(a)redhat.com> 1.60-1
+- [rhbz:#1227190] hotfix: restore old route to the repo_file handler
+- Fix default networking option (RhBug:1215157)
+
* Sat May 30 2015 Valentin Gologuzov <vgologuz(a)redhat.com> 1.59-1
- Front page rendering takes too much time due to a long sql query.
Simplified until issue is resolved.
diff --git a/rel-eng/packages/copr-frontend b/rel-eng/packages/copr-frontend
index 3285ed0..902d254 100644
--- a/rel-eng/packages/copr-frontend
+++ b/rel-eng/packages/copr-frontend
@@ -1 +1 @@
-1.59-1 frontend/
+1.60-1 frontend/
8 years, 11 months
[copr] master: [frontend][rhbz:#1227190] hotfix: restore old route to the repo_file handler (b82380f)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit b82380ffc95c3c8e7058003d1960406f6b37fce5
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Wed Jun 3 14:17:03 2015 +0200
[frontend][rhbz:#1227190] hotfix: restore old route to the repo_file handler
>---------------------------------------------------------------
frontend/coprs_frontend/coprs/models.py | 2 +
.../coprs/views/coprs_ns/coprs_general.py | 24 ++++++++++++-------
.../test_views/test_coprs_ns/test_coprs_general.py | 8 +++---
3 files changed, 21 insertions(+), 13 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/models.py b/frontend/coprs_frontend/coprs/models.py
index 2b77b8e..b66c634 100644
--- a/frontend/coprs_frontend/coprs/models.py
+++ b/frontend/coprs_frontend/coprs/models.py
@@ -196,6 +196,8 @@ class Copr(db.Model, helpers.Serializer):
def check_copr_chroot(self, chroot):
"""
Return object of chroot, if is related to our copr or None
+
+ :type chroot: CoprChroot
"""
result = None
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 70085e1..d8b87c0 100644
--- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -559,22 +559,28 @@ def generate_repo_file(username, coprname, name_release, repofile):
# dash, therefore user-re-po resolves to user-re/po instead of user/re-po
# FAS usernames may not contain dashes, so this construction is safe.
- reponame = "{0}-{1}".format(username, coprname)
-
- if repofile is not None and repofile != username + '-' + coprname + '-' + name_release + '.repo':
- return page_not_found(
- "Repository filename does not match expected: {0}"
- .format(repofile))
+ reponame = "{}-{}".format(username, coprname)
try:
# query.one() is used since it fetches all builds, unlike
# query.first().
- copr = coprs_logic.CoprsLogic.get(flask.g.user, username, coprname,
- with_builds=True).one()
+ copr = coprs_logic.CoprsLogic.get(flask.g.user, username, coprname, with_builds=True).one()
except sqlalchemy.orm.exc.NoResultFound:
return page_not_found(
"Project {0}/{1} does not exist".format(username, coprname))
+ # we need to check if we really got name release or it's a full chroot (caused by old dnf plugin)
+ if name_release in [c.name for c in copr.active_chroots]:
+ chroot = [c for c in copr.active_chroots if c.name == name_release][0]
+ return flask.redirect(flask.url_for(
+ "coprs_ns.generate_repo_file", username=username, coprname=coprname,
+ name_release=chroot.name_release))
+
+ if repofile is not None and repofile != username + '-' + coprname + '-' + name_release + '.repo':
+ return page_not_found(
+ "Repository filename does not match expected: {0}"
+ .format(repofile))
+
mock_chroot = coprs_logic.MockChrootsLogic.get_from_name(name_release, noarch=True).first()
if not mock_chroot:
return page_not_found("Chroot {0} does not exist".format(name_release))
@@ -587,7 +593,7 @@ def generate_repo_file(username, coprname, name_release, repofile):
if not url:
return page_not_found(
- "Repository not initialized: No finished builds in {0}/{1}."
+ "Repository not initialized: No finished builds in {}/{}."
.format(username, coprname))
repo_url = generate_repo_url(mock_chroot, url)
diff --git a/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py b/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py
index 8ecaacc..4696a51 100644
--- a/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py
+++ b/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_general.py
@@ -699,23 +699,23 @@ class TestCoprRepoGeneration(CoprsTestCase):
assert r.status_code == 404
assert "does not exist" in r.data
- def test_fail_on_no_finished_builds(self, f_users, f_coprs,
+ def test_fail_on_no_finished_builds(self, f_users, f_coprs, f_mock_chroots,
f_not_finished_builds, f_db):
r = self.tc.get(
- "/coprs/{0}/{1}/repo/fedora-18-x86_64/"
+ "/coprs/{0}/{1}/repo/fedora-18/"
.format(self.u1.name, self.c1.name))
assert r.status_code == 404
assert "Repository not initialized" in r.data
- def test_works_on_older_builds(self, f_users, f_coprs,
+ def test_works_on_older_builds(self, f_users, f_coprs, f_mock_chroots,
f_custom_builds, f_db):
from coprs import app
orig = app.config["ENFORCE_PROTOCOL_FOR_BACKEND_URL"]
app.config["ENFORCE_PROTOCOL_FOR_BACKEND_URL"] = "https"
r = self.tc.get(
- "/coprs/{0}/{1}/repo/fedora-18-x86_64/"
+ "/coprs/{0}/{1}/repo/fedora-18/"
.format(self.u1.name, self.c1.name))
assert r.status_code == 200
8 years, 11 months
[copr] master: Fix default networking option (RhBug:1215157) (e0cf1d5)
by frostyx@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit e0cf1d54d23a5d42b3701c5143c3eac01487a6e9
Author: Jakub Kadlčík <jkadlcik(a)redhat.com>
Date: Tue Jun 2 14:27:44 2015 +0200
Fix default networking option (RhBug:1215157)
>---------------------------------------------------------------
.../coprs/views/coprs_ns/coprs_general.py | 1 +
.../test_views/test_coprs_ns/test_coprs_builds.py | 15 +++++++++++++++
2 files changed, 16 insertions(+), 0 deletions(-)
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 09a415e..70085e1 100644
--- a/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/frontend/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -140,6 +140,7 @@ def copr_new(username):
description=form.description.data,
instructions=form.instructions.data,
disable_createrepo=form.disable_createrepo.data,
+ build_enable_net=form.build_enable_net.data,
)
db.session.commit()
diff --git a/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py b/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
index f14842f..15c0ee1 100644
--- a/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
+++ b/frontend/coprs_frontend/tests/test_views/test_coprs_ns/test_coprs_builds.py
@@ -66,6 +66,21 @@ class TestCoprAddBuild(CoprsTestCase):
assert not self.models.Build.query.first()
+ @TransactionDecorator("u1")
+ def test_copr_default_options(self, f_users, f_mock_chroots, f_db):
+ self.test_client.post(
+ "/coprs/{0}/new/".format(self.u1.name),
+ data={"name": "foo",
+ "fedora-rawhide-i386": "y", # Needed?
+ "arches": ["i386"], # Needed?
+ "build_enable_net": None,
+ },
+ follow_redirects=True)
+
+ r = self.tc.get(
+ "/coprs/{0}/{1}/add_build/".format(self.u1.name, "foo"))
+ assert '<input checked id="enable_net" name="enable_net"' not in r.data
+
class TestCoprCancelBuild(CoprsTestCase):
8 years, 11 months
[copr] master: [frontend] forgotten requirements . (3b7e4ee)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 3b7e4eec0f1ac58f8ce34658d36976bcf9e4021a
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Mon Jun 1 17:04:40 2015 +0200
[frontend] forgotten requirements .
>---------------------------------------------------------------
frontend/requirements.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/frontend/requirements.txt b/frontend/requirements.txt
index d23010b..82354b3 100644
--- a/frontend/requirements.txt
+++ b/frontend/requirements.txt
@@ -16,3 +16,4 @@ flexmock
decorator
python-dateutil
netaddr
+alembic
8 years, 11 months
[copr] master: [frontend] forgotten requirements (bd9ae5b)
by vgologuz@fedoraproject.org
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit bd9ae5b68edf776086082623de303bbd3af19252
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Mon Jun 1 16:59:20 2015 +0200
[frontend] forgotten requirements
>---------------------------------------------------------------
frontend/requirements.txt | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/frontend/requirements.txt b/frontend/requirements.txt
index 7952e74..d23010b 100644
--- a/frontend/requirements.txt
+++ b/frontend/requirements.txt
@@ -15,3 +15,4 @@ pydns
flexmock
decorator
python-dateutil
+netaddr
8 years, 11 months