[schema] rename log_file to execution_archive (closes #3241605)
the "log_file" (when it exists) contains the archive of the running environment
and not the logs. This commit frees the name "log_file" to be used by real logs in a
commit downstream.
--- a/_apycotlib/writer.py Wed Sep 04 16:48:47 2013 +0200
+++ b/_apycotlib/writer.py Wed Oct 23 00:16:48 2013 +0200
@@ -218,7 +218,7 @@
tarball.close()
self._cnxh.http_post(self._url, vid='create_subentity',
__cwetype__='File',
- __cwrel__='reverse_log_file',
+ __cwrel__='reverse_execution_archive',
data=Binary(open(archivefpath, 'rb').read()),
data_format=u'application/x-bzip2',
data_name=unicode(archive))
--- a/migration/3.0.0_Any.py Wed Sep 04 16:48:47 2013 +0200
+++ b/migration/3.0.0_Any.py Wed Oct 23 00:16:48 2013 +0200
@@ -1,2 +1,5 @@
rql('SET WF workflow_of TE, TE default_workflow WF WHERE WF workflow_of P, P name "Plan", TE name "TestExecution"')
commit()
+
+rename_relation('log_file','execution_archive')
+commit()
--- a/schema.py Wed Sep 04 16:48:47 2013 +0200
+++ b/schema.py Wed Oct 23 00:16:48 2013 +0200
@@ -361,7 +361,7 @@
'repository.')
-class log_file(RelationDefinition):
+class execution_archive(RelationDefinition):
__permissions__ = BOT_RELATION_PERMS
subject = 'TestExecution'
object = 'File'
--- a/views/__init__.py Wed Sep 04 16:48:47 2013 +0200
+++ b/views/__init__.py Wed Oct 23 00:16:48 2013 +0200
@@ -55,7 +55,7 @@
'Any T,PE,TC,T,TB,TF, TS ORDERBY is_null(TST) DESC, TST DESC WHERE '
'T status TS, T using_config TC, T using_environment PE, '
'TR? wf_info_for T, TR creation_date TST, TR tr_count 0, '
- 'T branch TB, T log_file TF?')
+ 'T branch TB, T execution_archive TF?')
req.form['displayfilter'] = ''
req.form['vid'] = 'apycot.te.summarytable'
return None, rset
--- a/views/facets.py Wed Sep 04 16:48:47 2013 +0200
+++ b/views/facets.py Wed Oct 23 00:16:48 2013 +0200
@@ -61,8 +61,8 @@
# path = ['TI wf_info_for X', 'TI by_transition T', 'T name "start"', 'TI creation_date D']
# filter_variable = 'D'
-class TestExecutionLogFileFacet(facet.HasRelationFacet):
- __regid__ = 'apycot.te.logfile'
+class TestExecutionArchiveFileFacet(facet.HasRelationFacet):
+ __regid__ = 'apycot.te.archivefile'
__select__ = facet.HasRelationFacet.__select__ & is_instance('TestExecution')
- rtype = 'log_file'
+ rtype = 'execution_archive'
order = 5
--- a/views/primary.py Wed Sep 04 16:48:47 2013 +0200
+++ b/views/primary.py Wed Oct 23 00:16:48 2013 +0200
@@ -144,7 +144,7 @@
'Any T,TC,T,TB,TF, TS ORDERBY is_null(TST) DESC, TST DESC WHERE '
'T status TS, T using_config TC, T branch TB, '
'TR? wf_info_for T, TR creation_date TST, TR tr_count 0, '
- 'T log_file TF?, '
+ 'T execution_archive TF?, '
'T using_environment PE, PE eid %(pe)s',
{'pe': entity.eid})
self.wview('apycot.te.nopetable', rset, 'noresult')
@@ -255,7 +255,7 @@
rset = self._cw.execute(
'Any T,PE,T,TB,TF, TS,PEN ORDERBY is_null(TST) DESC, TST DESC WHERE '
'T status TS, T using_config TC, T using_environment PE, '
- 'T branch TB, T log_file TF?, '
+ 'T branch TB, T execution_archive TF?, '
'TR? wf_info_for T, TR creation_date TST, TR tr_count 0, '
'PE name PEN, TC eid %(tc)s',
{'tc': entity.eid})
--- a/views/testexecution.py Wed Sep 04 16:48:47 2013 +0200
+++ b/views/testexecution.py Wed Oct 23 00:16:48 2013 +0200
@@ -107,7 +107,7 @@
default_rql = ('Any T,PE,TC,T,TB,TF, TS ORDERBY is_null(TST) DESC, TST DESC WHERE '
'T status TS, T using_config TC, T using_environment PE, '
'TR? wf_info_for T, TR creation_date TST, TR tr_count 0, '
- 'T branch TB, T log_file TF?')
+ 'T branch TB, T execution_archive TF?')
def call(self):
w = self.w
@@ -121,7 +121,7 @@
__regid__ = 'apycot.te.table'
__select__ = is_instance('TestExecution')
- columns = ['testexecution', 'projectenvironment', 'using_config', 'checks', 'branch', 'starttime', 'endtime', 'log_file']
+ columns = ['testexecution', 'projectenvironment', 'using_config', 'checks', 'branch', 'starttime', 'endtime', 'execution_archive']
column_renderers = {
'testexecution': tableview.MainEntityColRenderer(
vid='apycot.te.statuscell'),
@@ -133,7 +133,7 @@
'endtime': tableview.EntityTableColRenderer(lambda w, p: w(p._cw.format_date(p.endtime, time=True))),
'checks': tableview.MainEntityColRenderer(
header=_('checks'), addcount=False, vid='apycot.te.summarycell'),
- 'log_file': tableview.RelationColRenderer(
+ 'execution_archive': tableview.RelationColRenderer(
subvid='icon')
}
layout_args = {
@@ -147,12 +147,12 @@
class TENoPETable(TETable):
__regid__ = 'apycot.te.nopetable'
- columns = ['testexecution', 'using_config', 'checks', 'branch', 'starttime', 'endtime', 'log_file']
+ columns = ['testexecution', 'using_config', 'checks', 'branch', 'starttime', 'endtime', 'execution_archive']
class TENoTCTable(TETable):
__regid__ = 'apycot.te.notctable'
- columns = ['testexecution', 'projectenvironment', 'checks', 'branch', 'starttime', 'endtime', 'log_file']
+ columns = ['testexecution', 'projectenvironment', 'checks', 'branch', 'starttime', 'endtime', 'execution_archive']
_pvdc.tag_attribute(('TestExecution', 'priority',), {'vid': 'tasksqueue.priority'}) # XXX rtag inheritance bug
@@ -163,7 +163,7 @@
_pvdc.tag_attribute(('TestExecution', 'log'), {'vid': 'narval.formated_log'})
_pvs.tag_subject_of(('TestExecution', 'using_revision', '*'), 'hidden')
_pvs.tag_subject_of(('TestExecution', 'using_config', '*'), 'hidden')
-_pvs.tag_subject_of(('TestExecution', 'log_file', '*'), 'hidden')
+_pvs.tag_subject_of(('TestExecution', 'execution_archive', '*'), 'hidden')
_pvs.tag_subject_of(('TestExecution', 'execution_of', '*'), 'hidden')
_pvs.tag_object_of(('*', 'during_execution', 'TestExecution'), 'hidden')
_pvs.tag_attribute(('TestExecution', 'script'), 'hidden')
@@ -342,10 +342,10 @@
class TEDownloadBox(box.EntityBoxTemplate):
__regid__ = 'apycot.te.download_box'
__select__ = (box.EntityBoxTemplate.__select__ & is_instance('TestExecution') &
- score_entity(lambda x: x.log_file))
+ score_entity(lambda x: x.execution_archive))
def cell_call(self, row, col, **kwargs):
- archive = self.cw_rset.get_entity(row, col).log_file[0]
+ archive = self.cw_rset.get_entity(row, col).execution_archive[0]
idownloadable.download_box(self.w, archive,
self._cw._('download execution environment'))
--- a/views/tracker.py Wed Sep 04 16:48:47 2013 +0200
+++ b/views/tracker.py Wed Oct 23 00:16:48 2013 +0200
@@ -107,7 +107,7 @@
rset = self._cw.execute(
'Any T,TC,T,TB,TF, TS ORDERBY is_null(TST) DESC, TST DESC WHERE '
'T status TS, T using_config TC, T branch TB, '
- 'T log_file TF?, '
+ 'T execution_archive TF?, '
'TR? wf_info_for T, TR tr_count 0, TR creation_date TST, '
'T using_environment PE, P has_apycot_environment PE, '
'P eid %(p)s', {'p': entity.eid})