[copr] master: [frontend] swap vals for succeeded and failed (04e4308)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 04e43088dc9b7af4eb7e4489a99e161cbcde77a3
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Nov 28 10:47:19 2013 +0100
[frontend] swap vals for succeeded and failed
>---------------------------------------------------------------
backend/dispatcher.py | 8 ++++----
coprs_frontend/coprs/helpers.py | 4 ++--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index 8623ed2..e194d8d 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -311,7 +311,7 @@ class Worker(multiprocessing.Process):
except Exception, e:
self.callback.log('failed to initialize fedmsg: %s' % e)
- status = 1
+ status = 1 # succeeded
job.started_on = time.time()
self.mark_started(job)
@@ -334,9 +334,9 @@ class Worker(multiprocessing.Process):
except (OSError, IOError), e:
msg = "Could not make results dir for job: %s - %s" % (chroot_destdir, str(e))
self.callback.log(msg)
- status = 0
+ status = 0 # fail
- if status == 1:
+ if status == 1: # succeeded
# FIXME
# need a plugin hook or some mechanism to check random
# info about the pkgs
@@ -365,7 +365,7 @@ class Worker(multiprocessing.Process):
# we can't really trace back if we just fail normally
# check if any pkgs didn't build
if mr.failed:
- status = 0
+ status = 0 # failure
self.callback.log('Finished build: id=%r builder=%r timeout=%r destdir=%r chroot=%r repos=%r' % (job.build_id, ip, job.timeout, job.destdir, job.chroot, str(job.repos)))
job.ended_on = time.time()
diff --git a/coprs_frontend/coprs/helpers.py b/coprs_frontend/coprs/helpers.py
index f465ba3..0ca22f6 100644
--- a/coprs_frontend/coprs/helpers.py
+++ b/coprs_frontend/coprs/helpers.py
@@ -49,8 +49,8 @@ class RoleEnum(object):
class StatusEnum(object):
__metaclass__ = EnumType
- vals = {'succeeded': 0,
- 'failed': 1,
+ vals = {'failed': 0,
+ 'succeeded': 1,
'canceled': 2,
'running': 3,
'pending': 4}
10 years, 4 months
[copr] master: [playbook] do not overwrite mockchain (6990e3d)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 6990e3dd04f81888ac15b3edd2db4c4dac47cae6
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Nov 28 09:36:14 2013 +0100
[playbook] do not overwrite mockchain
rather use recent mockchain from epel or from your own repo
>---------------------------------------------------------------
playbooks/builderpb.yml | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/playbooks/builderpb.yml b/playbooks/builderpb.yml
index c967f06..5c1ed2e 100644
--- a/playbooks/builderpb.yml
+++ b/playbooks/builderpb.yml
@@ -71,7 +71,4 @@
- epel-5-x86_64.cfg
- epel-5-i386.cfg
- - name: put updated mockchain into /usr/bin
- action: copy src=$files/mockchain dest=/usr/bin/mockchain mode=0755 owner=root group=root
-
10 years, 4 months
[copr] master: [backend] add spece between options (18330ee)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 18330eebf818d7760f3393c8668ddbbfa7e92b2b
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Nov 27 15:59:31 2013 +0100
[backend] add spece between options
avoiding of:
-m '--define=copr_username msuchy' -m '--define=copr_projectname foobar'http://miroslav.suchy.cz/copr/evil.name-1-2.fc20.src.rpm
>---------------------------------------------------------------
backend/mockremote.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/backend/mockremote.py b/backend/mockremote.py
index 3c1b2af..4d8d160 100755
--- a/backend/mockremote.py
+++ b/backend/mockremote.py
@@ -301,7 +301,7 @@ class Builder(object):
if self.mockremote.macros:
for k, v in self.mockremote.macros.items():
mock_opt = '--define=%s %s' % (k, v)
- buildcmd += '-m %s' % pipes.quote(mock_opt)
+ buildcmd += '-m %s ' % pipes.quote(mock_opt)
buildcmd += dest
10 years, 4 months
[copr] master: [backend] Pass copr username and project name to MockRemote (b172e9d)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit b172e9dda1e8075c5415e5463102703402e7fb37
Author: Stanislav Ochotnicky <sochotnicky(a)redhat.com>
Date: Tue Nov 19 16:48:52 2013 +0100
[backend] Pass copr username and project name to MockRemote
We can possibly add different more macros as needed. Maybe users could define
their own macros for specific chroots or something similar
>---------------------------------------------------------------
backend/dispatcher.py | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/backend/dispatcher.py b/backend/dispatcher.py
index 63055f4..8623ed2 100644
--- a/backend/dispatcher.py
+++ b/backend/dispatcher.py
@@ -350,9 +350,11 @@ class Worker(multiprocessing.Process):
chroot_repos = list(job.repos)
chroot_repos.append(job.results + '/' + job.chroot)
chrootlogfile = chroot_destdir + '/build-%s.log' % job.build_id
+ macros = {'copr_username': job.user_name,
+ 'copr_projectname': job.copr_name}
mr = mockremote.MockRemote(builder=ip, timeout=job.timeout,
destdir=job.destdir, chroot=job.chroot, cont=True, recurse=True,
- repos=chroot_repos,
+ repos=chroot_repos, macros=macros,
callback=mockremote.CliLogCallBack(quiet=True,logfn=chrootlogfile))
mr.build_pkgs(job.pkgs)
except mockremote.MockRemoteError, e:
@@ -379,4 +381,3 @@ class Worker(multiprocessing.Process):
# clean up the instance
if self.create:
self.terminate_instance(ip)
-
10 years, 4 months
[copr] master: [backend] Add macros to mockchain define arguments (fb69b36)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit fb69b36625c93cc53bd8a99ad78d36e35916f83f
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Nov 27 09:09:20 2013 +0100
[backend] Add macros to mockchain define arguments
>---------------------------------------------------------------
backend/mockremote.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/backend/mockremote.py b/backend/mockremote.py
index 714586c..06506c4 100755
--- a/backend/mockremote.py
+++ b/backend/mockremote.py
@@ -298,6 +298,12 @@ class Builder(object):
for r in self.repos:
buildcmd += "-a %s " % pipes.quote(r)
+ if self.mockremote.macros:
+ mock_opts = ['--define {k}={v}'.format(k=k,v=v) for k, v in
+ self.mockremote.macros.items()]
+ if mock_opts:
+ buildcmd += "-m {mopts} ".format(mopts=pipes.quote(" ".join(mock_opts)))
+
buildcmd += dest
#print ' Running %s on %s' % (buildcmd, hostname)
10 years, 4 months
[copr] master: [frontend] support markdown in description and instructions (7cdbd23)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 7cdbd234ac19d3ec6e8265a32c7f2cba7476e28a
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Nov 27 10:55:41 2013 +0100
[frontend] support markdown in description and instructions
>---------------------------------------------------------------
copr.spec | 1 +
coprs_frontend/coprs/models.py | 9 +++++++--
.../coprs/templates/coprs/_coprs_forms.html | 1 +
.../coprs/templates/coprs/detail/overview.html | 4 ++--
coprs_frontend/coprs/templates/coprs/show.html | 2 +-
5 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/copr.spec b/copr.spec
index ead9ebf..a08c781 100644
--- a/copr.spec
+++ b/copr.spec
@@ -85,6 +85,7 @@ Requires: python-flask-script
Requires: python-flask-whooshee
#Requires: python-virtualenv
Requires: python-blinker
+Requires: python-markdown
Requires: python-psycopg2
Requires: python-pylibravatar
Requires: python-whoosh >= 2.5.3
diff --git a/coprs_frontend/coprs/models.py b/coprs_frontend/coprs/models.py
index e494c75..1ea63b5 100644
--- a/coprs_frontend/coprs/models.py
+++ b/coprs_frontend/coprs/models.py
@@ -1,4 +1,5 @@
import datetime
+import markdown
from sqlalchemy.ext.associationproxy import association_proxy
from libravatar import libravatar_url
@@ -167,11 +168,15 @@ class Copr(db.Model, Serializer):
@property
def description_or_not_filled(self):
- return self.description or 'Description not filled in by author.'
+ md = markdown.Markdown(safe_mode='replace',
+ html_replacement_text='--RAW HTML NOT ALLOWED--')
+ return md.convert(self.description) or 'Description not filled in by author.'
@property
def instructions_or_not_filled(self):
- return self.instructions or 'Instructions not filled in by author.'
+ md = markdown.Markdown(safe_mode='replace',
+ html_replacement_text='--RAW HTML NOT ALLOWED--')
+ return md.convert(self.instructions) or 'Instructions not filled in by author.'
@property
def active_mock_chroots(self):
diff --git a/coprs_frontend/coprs/templates/coprs/_coprs_forms.html b/coprs_frontend/coprs/templates/coprs/_coprs_forms.html
index 582638a..5d2f519 100644
--- a/coprs_frontend/coprs/templates/coprs/_coprs_forms.html
+++ b/coprs_frontend/coprs/templates/coprs/_coprs_forms.html
@@ -20,6 +20,7 @@
{% endif %}
{{ render_field(form.description, rows=5, cols=50, placeholder='Optional - describe your project briefly.') }}
{{ render_field(form.instructions, rows=5, cols=50, placeholder='Optional - describe how your project can be installed. Link to wiki is good as well.') }}
+ <dd>You can use <a href="http://daringfireball.net/projects/markdown/syntax">markdown syntax</a>, inline HTML is forbidden..</dd>
<dt class="field-label required">Chroots</dt>
{% if form._mock_chroots_error %}
<p class="form-error">{{ form._mock_chroots_error }}</p>
diff --git a/coprs_frontend/coprs/templates/coprs/detail/overview.html b/coprs_frontend/coprs/templates/coprs/detail/overview.html
index 9f5fd25..456b541 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/overview.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/overview.html
@@ -6,9 +6,9 @@
{% block detail_body %}
<h2>Description</h2>
- <div class="shift-right">{{ copr.description_or_not_filled }}</div>
+ <div class="shift-right">{{ copr.description_or_not_filled|safe }}</div>
<h2>Installation Instructions</h2>
- <div class="shift-right">{{ copr.instructions_or_not_filled}}</div>
+ <div class="shift-right">{{ copr.instructions_or_not_filled|safe }}</div>
<h2>Active Releases</h2>
<div class="disclaimer">
The following unofficial repositories are provided as-is by owner of this project.
diff --git a/coprs_frontend/coprs/templates/coprs/show.html b/coprs_frontend/coprs/templates/coprs/show.html
index 833d19d..49f2b8c 100644
--- a/coprs_frontend/coprs/templates/coprs/show.html
+++ b/coprs_frontend/coprs/templates/coprs/show.html
@@ -29,7 +29,7 @@
{% for copr in coprs %}
<div class="copr">
<a href="{{ url_for('coprs_ns.copr_detail', username = copr.owner.name, coprname = copr.name) }}">{{ copr.owner.name }}/{{ copr.name }}</a>
- <p>{{ copr.description_or_not_filled }}</p>
+ <p>{{ copr.description_or_not_filled|safe }}</p>
<p class="repos">
{% for mock_chroot in copr.active_mock_chroots %}
{{ mock_chroot.os_release|os_name_short(mock_chroot.os_version) }}.{{ mock_chroot.arch }}{% if not loop.last %}, {% endif %}
10 years, 4 months
[copr] master: [backend] Handle additional macro specification in MockRemote (8be0f49)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 8be0f49e5110ab58466cde15971531cc9cc3eb2c
Author: Stanislav Ochotnicky <sochotnicky(a)redhat.com>
Date: Tue Nov 19 16:48:51 2013 +0100
[backend] Handle additional macro specification in MockRemote
This way we will be able to pass additional macros to mock if needed. This is
needed to pass copr_username and copr_projectname macros but can be useful for
other use cases in the future
>---------------------------------------------------------------
backend/mockremote.py | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/backend/mockremote.py b/backend/mockremote.py
index 40a5a81..714586c 100755
--- a/backend/mockremote.py
+++ b/backend/mockremote.py
@@ -48,6 +48,7 @@ DEF_REPOS = []
DEF_CHROOT = None
DEF_USER = 'mockbuilder'
DEF_DESTDIR = os.getcwd()
+DEF_MACROS = {}
class SortedOptParser(optparse.OptionParser):
'''Optparser which sorts the options by opt before outputting --help'''
@@ -400,7 +401,8 @@ class MockRemote(object):
def __init__(self, builder=None, user=DEF_USER, timeout=DEF_TIMEOUT,
destdir=DEF_DESTDIR, chroot=DEF_CHROOT, cont=False, recurse=False,
repos=DEF_REPOS, callback=None,
- remote_basedir=DEF_REMOTE_BASEDIR, remote_tempdir=None):
+ remote_basedir=DEF_REMOTE_BASEDIR, remote_tempdir=None,
+ macros=DEF_MACROS):
self.destdir = destdir
self.chroot = chroot
@@ -410,6 +412,7 @@ class MockRemote(object):
self.callback = callback
self.remote_basedir = remote_basedir
self.remote_tempdir = remote_tempdir
+ self.macros = macros
if not self.callback:
self.callback = DefaultCallBack()
10 years, 4 months
[copr] master: [backend] pass mock options correctly (bef1bc7)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit bef1bc7668ec533f0d5a2b27002b3c9a6b46b121
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Nov 27 14:16:56 2013 +0100
[backend] pass mock options correctly
1) pass each option as individual option to mockchain
2) define variables as 'key value' instead of 'key=value'
3) pass = after --define'
>---------------------------------------------------------------
backend/mockremote.py | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/backend/mockremote.py b/backend/mockremote.py
index 06506c4..3c1b2af 100755
--- a/backend/mockremote.py
+++ b/backend/mockremote.py
@@ -299,10 +299,9 @@ class Builder(object):
buildcmd += "-a %s " % pipes.quote(r)
if self.mockremote.macros:
- mock_opts = ['--define {k}={v}'.format(k=k,v=v) for k, v in
- self.mockremote.macros.items()]
- if mock_opts:
- buildcmd += "-m {mopts} ".format(mopts=pipes.quote(" ".join(mock_opts)))
+ for k, v in self.mockremote.macros.items():
+ mock_opt = '--define=%s %s' % (k, v)
+ buildcmd += '-m %s' % pipes.quote(mock_opt)
buildcmd += dest
10 years, 4 months
[copr] master: [frontend] monitor: show results per package (f911868)
by Richard Marko
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit f911868222960b2b4aee49e27d47089d3ab304ad
Author: Richard Marko <rmarko(a)fedoraproject.org>
Date: Tue Nov 26 15:31:24 2013 +0100
[frontend] monitor: show results per package
Signed-off-by: Richard Marko <rmarko(a)fedoraproject.org>
>---------------------------------------------------------------
coprs_frontend/coprs/static/copr.css | 18 +++++---
.../coprs/templates/coprs/detail/monitor.html | 18 ++++++---
.../coprs/views/coprs_ns/coprs_general.py | 41 +++++++++++++++++++-
3 files changed, 63 insertions(+), 14 deletions(-)
diff --git a/coprs_frontend/coprs/static/copr.css b/coprs_frontend/coprs/static/copr.css
index 451af8b..a168439 100644
--- a/coprs_frontend/coprs/static/copr.css
+++ b/coprs_frontend/coprs/static/copr.css
@@ -271,23 +271,23 @@ tr.build-state:hover {
background-color: #E6E6E6;
}
-tr.build-pending {
+.build-pending {
color: #3B6EB4;
}
-tr.build-running {
+.build-running {
color: #FF6600;
}
-tr.build-succeeded {
+.build-succeeded {
color: #22DD22;
}
-tr.build-failed {
+.build-failed {
color: #DD2222;
}
-tr.build-canceled {
+.build-canceled {
color: #CDC90C;
}
@@ -318,8 +318,9 @@ table.releases tr.release-end {
border-bottom: 3px solid #f2f2f2;
}
-table.monitor td {
- padding: 0 20px;
+table.monitor {
+ margin: 0 auto;
+ width: 90%;
}
form.legal-flag, form.legal-flag input {
@@ -381,3 +382,6 @@ textarea {
width: 100%;
}
+.centered {
+ text-align: center;
+}
diff --git a/coprs_frontend/coprs/templates/coprs/detail/monitor.html b/coprs_frontend/coprs/templates/coprs/detail/monitor.html
index e936724..ed8585d 100644
--- a/coprs_frontend/coprs/templates/coprs/detail/monitor.html
+++ b/coprs_frontend/coprs/templates/coprs/detail/monitor.html
@@ -11,13 +11,19 @@
{% if not build.canceled %}
<table class="monitor">
<tr>
- <th>Chroot</th>
- <th>State</th>
+ <th>Package</th>
+ {% for chroot in chroots %}
+ <th>
+ {{ chroot }}
+ </th>
+ {% endfor %}
</tr>
- {% for chroot in build.build_chroots %}
- <tr class="build-{{ chroot.state }}">
- <td>{{ chroot.name }}</td>
- <td>{{ chroot.state }}</td>
+ {% for package, states in packages %}
+ <tr>
+ <td>{{ package }}</td>
+ {% for state in states %}
+ <td class="centered build-{{ state }}">{{ state }}</td>
+ {% endfor %}
</tr>
{% endfor %}
</table>
diff --git a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
index 1d3750f..73eb64c 100644
--- a/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
+++ b/coprs_frontend/coprs/views/coprs_ns/coprs_general.py
@@ -1,3 +1,4 @@
+import os
import time
import flask
@@ -355,9 +356,47 @@ def copr_build_monitor(username, coprname):
return page_not_found('Copr with name {0} does not exist.'.format(coprname))
builds_query = builds_logic.BuildsLogic.get_multiple(flask.g.user, copr=copr)
- build = builds_query.first()
+ builds = builds_query.all()
+
+ # please don't waste time trying to decipher this
+ # the only reason why this is necessary is non-existent
+ # database design
+ #
+ # loop goes through last 50 builds trying to approximate
+ # per-package results based on previous builds
+ # - it can't determine build results if build contains
+ # more than one package as this data is not available
+
+ out = {}
+ build = None
+ chroots = []
+
+ if builds:
+ build = builds[0]
+ chroots = sorted([chroot.name for chroot in build.build_chroots])
+
+ for build in builds[:50]:
+ chroot_results = {chroot.name: chroot.state
+ for chroot in build.build_chroots}
+
+ build_results = []
+ for chroot_name in chroots:
+ if chroot_name in chroot_results:
+ build_results.append(chroot_results[chroot_name])
+ else:
+ build_results.append('')
+
+ for pkg in build.pkgs.split():
+ base_pkg = os.path.basename(pkg).replace('.src.rpm', '')
+
+ if base_pkg in out:
+ continue
+
+ out[base_pkg] = build_results
return flask.render_template('coprs/detail/monitor.html',
copr=copr,
build=build,
+ chroots=chroots,
+ packages=sorted(out.iteritems()),
form=form)
10 years, 4 months
[copr] master: [frontend] add favicon (7c2a06f)
by Miroslav Suchý
Repository : http://git.fedorahosted.org/cgit/copr.git
On branch : master
>---------------------------------------------------------------
commit 7c2a06f592f59609ee4f224dfa1754400d914901
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue Nov 26 16:26:55 2013 +0100
[frontend] add favicon
>---------------------------------------------------------------
coprs_frontend/coprs/static/favicon.ico | Bin 0 -> 3638 bytes
coprs_frontend/coprs/templates/layout.html | 2 ++
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/coprs_frontend/coprs/static/favicon.ico b/coprs_frontend/coprs/static/favicon.ico
new file mode 100644
index 0000000..79d0ba9
Binary files /dev/null and b/coprs_frontend/coprs/static/favicon.ico differ
diff --git a/coprs_frontend/coprs/templates/layout.html b/coprs_frontend/coprs/templates/layout.html
index 465103e..9bb4322 100644
--- a/coprs_frontend/coprs/templates/layout.html
+++ b/coprs_frontend/coprs/templates/layout.html
@@ -4,6 +4,8 @@
<title>{% block title %}Coprs Build System{% endblock %}</title>
<link rel=stylesheet type=text/css href="{{ url_for('static', filename='copr.css') }}">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
+ <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/vnd.microsoft.icon">
+ <link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}" type="image/x-icon">
<script src="{{ url_for('static', filename='copr.js') }}"></script>
</head>
<body>
10 years, 4 months