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 6af1e7f frontend: non-working SRPM builder-live.log.gz link
6af1e7f is described below
commit 6af1e7f6896ce8cfa89e316b12f7fac6727f6553
Author: Silvie Chlupova <sisi.chlupova(a)gmail.com>
AuthorDate: Wed Oct 23 16:45:24 2019 +0200
frontend: non-working SRPM builder-live.log.gz link
Fixes: #1011
Merges: #1084
---
.../745250baedaf_new_column_resubmitted_from_id.py | 20 ++++++++++++++++++
.../coprs_frontend/coprs/logic/builds_logic.py | 2 ++
frontend/coprs_frontend/coprs/models.py | 13 ++++++++++++
.../coprs/templates/coprs/detail/build.html | 24 +++++++++++++++-------
4 files changed, 52 insertions(+), 7 deletions(-)
diff --git
a/frontend/coprs_frontend/alembic/schema/versions/745250baedaf_new_column_resubmitted_from_id.py
b/frontend/coprs_frontend/alembic/schema/versions/745250baedaf_new_column_resubmitted_from_id.py
new file mode 100644
index 0000000..4f834c3
--- /dev/null
+++
b/frontend/coprs_frontend/alembic/schema/versions/745250baedaf_new_column_resubmitted_from_id.py
@@ -0,0 +1,20 @@
+"""
+new column resubmitted_from_id
+
+Revision ID: 745250baedaf
+Revises: 0dbdd06fb850
+Create Date: 2019-11-11 11:15:05.399008
+"""
+
+import sqlalchemy as sa
+from alembic import op
+
+
+revision = '745250baedaf'
+down_revision = '0dbdd06fb850'
+
+def upgrade():
+ op.add_column('build', sa.Column('resubmitted_from_id', sa.Integer(),
nullable=True))
+
+def downgrade():
+ op.drop_column('build', 'resubmitted_from_id')
diff --git a/frontend/coprs_frontend/coprs/logic/builds_logic.py
b/frontend/coprs_frontend/coprs/logic/builds_logic.py
index e88eede..2830610 100644
--- a/frontend/coprs_frontend/coprs/logic/builds_logic.py
+++ b/frontend/coprs_frontend/coprs/logic/builds_logic.py
@@ -521,6 +521,8 @@ ORDER BY
srpm_url=source_build.srpm_url,
copr_dirname=source_build.copr_dir.name, **build_options)
build.package_id = source_build.package_id
build.pkg_version = source_build.pkg_version
+ build.resubmitted_from_id = source_build.id
+
return build
@classmethod
diff --git a/frontend/coprs_frontend/coprs/models.py
b/frontend/coprs_frontend/coprs/models.py
index 12d3884..2a0a2ae 100644
--- a/frontend/coprs_frontend/coprs/models.py
+++ b/frontend/coprs_frontend/coprs/models.py
@@ -874,6 +874,11 @@ class Build(db.Model, helpers.Serializer):
# used by webhook builds; e.g. github.com:praiskup, or pagure.io:jdoe
submitted_by = db.Column(db.Text)
+ # if a build was resubmitted from another build, this column will contain the
original build id
+ # the original build id is not here as a foreign key because the original build can
be deleted so we can lost
+ # the info that the build was resubmitted
+ resubmitted_from_id = db.Column(db.Integer)
+
@property
def user_name(self):
return self.user.name
@@ -1159,6 +1164,14 @@ class Build(db.Model, helpers.Serializer):
return '{0}--{1}'.format(self.copr.full_name, submitter)
+ @property
+ def resubmitted_from(self):
+ return Build.query.filter(Build.id == self.resubmitted_from_id).first()
+
+ @property
+ def source_is_uploaded(self):
+ return self.source_type == helpers.BuildSourceEnum('upload')
+
class DistGitBranch(db.Model, helpers.Serializer):
"""
diff --git a/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
b/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
index b799bff..d9ca866 100644
--- a/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
+++ b/frontend/coprs_frontend/coprs/templates/coprs/detail/build.html
@@ -164,16 +164,26 @@
<dl class="dl-horizontal">
{{ describe_failure(build) }}
<dt>SRPM build log:</dt>
- {% if build.source_status | state_from_num in ['pending',
'starting'] %}
- <dd> Build has not started yet </dd>
+ {% if build.source_status | state_from_num in ['pending',
'starting'] %}
+ <dd> Build has not started yet</dd>
+ {% else %}
+ {% if build.resubmitted_from and build.source_is_uploaded %}
+ <dd>Build resubmitted from build
+ {% if build.resubmitted_from %}
+ <a href="{{ copr_url('coprs_ns.copr_build', build.copr,
build_id=build.resubmitted_from.id) }}">#{{ build.resubmitted_from.id
}}</a>
+ {% else %}
+ #{{ build.resubmitted_from_id }}
+ {% endif %}
+ </dd>
{% else %}
- {% for url in build.get_import_log_urls(g.user.admin) %}
- <dd>
- <a href="{{ url }}">{{ url | basename }}</a>
+ {% for url in build.get_import_log_urls(g.user.admin) %}
+ <dd>
+ <a href="{{ url }}">{{ url | basename }}</a>
{{ "," if not loop.last }}
- </dd>
- {% endfor %}
+ </dd>
+ {% endfor %}
{% endif %}
+ {% endif %}
<dt> Built Packages:</dt>
{% if build.built_packages %}
{% for pkg in build.built_packages.split("\n"): %}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
Show replies by date