Merge branch dev/task-145552-145553-145554 of zentao/zentaopms (#9705)
This commit is contained in:
+2
-1
@@ -13,6 +13,7 @@ UPDATE `zt_workflowgroup` SET `name` = '瀑布式项目研发' WHERE `code` = 'w
|
||||
UPDATE `zt_workflowgroup` SET `name` = '敏捷式产品研发' WHERE `code` = 'scrumproduct';
|
||||
UPDATE `zt_workflowgroup` SET `name` = '敏捷式项目研发' WHERE `code` = 'scrumproject';
|
||||
|
||||
|
||||
CREATE OR REPLACE VIEW `ztv_projectnotpl` AS SELECT * FROM `zt_project` WHERE `deleted` = '0' AND `isTpl` = 0;
|
||||
CREATE OR REPLACE VIEW `ztv_tasknotpl` AS SELECT * FROM `zt_task` WHERE `deleted` = '0' AND `isTpl` = 0;
|
||||
|
||||
ALTER TABLE `zt_compile` ADD `branch` varchar(255) NOT NULL DEFAULT '' AFTER `status`;
|
||||
|
||||
+2
-1
@@ -636,6 +636,7 @@ CREATE TABLE IF NOT EXISTS `zt_compile` (
|
||||
`job` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
`queue` mediumint(8) NOT NULL DEFAULT '0',
|
||||
`status` varchar(100) NOT NULL DEFAULT '',
|
||||
`branch` varchar(255) NOT NULL DEFAULT '',
|
||||
`logs` longtext NULL,
|
||||
`atTime` varchar(10) NOT NULL DEFAULT '',
|
||||
`testtask` mediumint(8) unsigned NOT NULL DEFAULT '0',
|
||||
@@ -13667,7 +13668,7 @@ CREATE VIEW `view_datasource_12` AS select `id`,`title` from `zt_productplan` wh
|
||||
CREATE VIEW `view_datasource_41` AS select `id`,`title` from `zt_case` where `deleted` = '0';
|
||||
CREATE VIEW `view_datasource_54` AS select `id`,`name` from `zt_task` where `deleted` = '0' and vision = 'lite';
|
||||
CREATE VIEW `view_datasource_55` AS select `id`,`title` from `zt_feedback` where `deleted` = '0';
|
||||
CREATE VIEW `ztv_projectnotpl` AS select * from `zt_project` where `deleted` = '0' and `isTpl` = 0;
|
||||
CREATE VIEW `ztv_projectnotpl` AS select * from `zt_project` where `deleted` = '0' and `isTpl` = 0;
|
||||
CREATE VIEW `ztv_tasknotpl` AS select * from `zt_task` where `deleted` = '0' and `isTpl` = 0;
|
||||
|
||||
-- DROP TABLE IF EXISTS `zt_durationestimation`;
|
||||
|
||||
@@ -11,12 +11,12 @@ $config->compile->dtable->fieldList['id']['checkbox'] = false;
|
||||
|
||||
$config->compile->dtable->fieldList['name']['title'] = $lang->compile->name;
|
||||
$config->compile->dtable->fieldList['name']['name'] = 'name';
|
||||
$config->compile->dtable->fieldList['name']['type'] = 'shortTitle';
|
||||
$config->compile->dtable->fieldList['name']['sortType'] = true;
|
||||
$config->compile->dtable->fieldList['name']['hint'] = true;
|
||||
$config->compile->dtable->fieldList['name']['checkbox'] = false;
|
||||
$config->compile->dtable->fieldList['name']['link'] = array('module' => 'job', 'method' => 'view', 'params' => 'jobID={job}&compileID={id}');
|
||||
$config->compile->dtable->fieldList['name']['data-toggle'] = 'modal';
|
||||
$config->compile->dtable->fieldList['name']['minWidth'] = '350';
|
||||
|
||||
$config->compile->dtable->fieldList['status']['title'] = $lang->compile->status;
|
||||
$config->compile->dtable->fieldList['status']['name'] = 'status';
|
||||
@@ -49,11 +49,12 @@ $config->compile->dtable->fieldList['triggerType']['sortType'] = false;
|
||||
$config->compile->dtable->fieldList['triggerType']['width'] = '80';
|
||||
$config->compile->dtable->fieldList['triggerType']['hint'] = true;
|
||||
|
||||
$config->compile->dtable->fieldList['createdDate']['title'] = $lang->compile->atTime;
|
||||
$config->compile->dtable->fieldList['createdDate']['name'] = 'createdDate';
|
||||
$config->compile->dtable->fieldList['createdDate']['type'] = 'datetime';
|
||||
$config->compile->dtable->fieldList['createdDate']['sortType'] = true;
|
||||
$config->compile->dtable->fieldList['createdDate']['hint'] = true;
|
||||
$config->compile->dtable->fieldList['createdDate']['title'] = $lang->compile->atTime;
|
||||
$config->compile->dtable->fieldList['createdDate']['name'] = 'createdDate';
|
||||
$config->compile->dtable->fieldList['createdDate']['type'] = 'datetime';
|
||||
$config->compile->dtable->fieldList['createdDate']['sortType'] = true;
|
||||
$config->compile->dtable->fieldList['createdDate']['hint'] = true;
|
||||
$config->compile->dtable->fieldList['createdDate']['formatDate'] = 'YYYY-MM-dd hh:mm';
|
||||
|
||||
$config->compile->actionList = array();
|
||||
$config->compile->actionList['logs']['icon'] = 'history';
|
||||
|
||||
@@ -6,8 +6,15 @@ window.renderCell = function(result, {col, row})
|
||||
if(row.data.status == 'failure' || row.data.status == 'create_fail') className = 'status-doing';
|
||||
if(row.data.status == 'success') className = 'status-done';
|
||||
result[0] = {html:'<span class="' + className + '">' + result[0] + '</span>'};
|
||||
}
|
||||
|
||||
return result;
|
||||
if(col.name == 'name' && row.data.engine != 'jenkins')
|
||||
{
|
||||
const pipeline = row.data.pipeline;
|
||||
if(!pipeline) return result;
|
||||
const branch = JSON.parse(pipeline).reference;
|
||||
|
||||
if(branch) result[1] = {html:'<span class="label success-pale mr-1">' + branch + '</span>'};
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -79,7 +79,7 @@ class compileModel extends model
|
||||
}
|
||||
|
||||
if(strpos($orderBy, 'id') === false) $orderBy .= ', id_desc';
|
||||
return $this->dao->select('t1.id, t1.name, t1.job, t1.status, t1.createdDate, t1.testtask, t2.pipeline, t2.triggerType, t2.svnDir, t2.comment, t2.atDay, t2.atTime, t2.engine, t2.triggerActions, t3.name as repoName, t4.name as jenkinsName')->from(TABLE_COMPILE)->alias('t1')
|
||||
return $this->dao->select('t1.id, t1.branch, t1.name, t1.job, t1.status, t1.createdDate, t1.testtask, t2.pipeline, t2.triggerType, t2.svnDir, t2.comment, t2.atDay, t2.atTime, t2.engine, t2.triggerActions, t3.name as repoName, t4.name as jenkinsName')->from(TABLE_COMPILE)->alias('t1')
|
||||
->leftJoin(TABLE_JOB)->alias('t2')->on('t1.job=t2.id')
|
||||
->leftJoin(TABLE_REPO)->alias('t3')->on('t2.repo=t3.id')
|
||||
->leftJoin(TABLE_PIPELINE)->alias('t4')->on('t2.server=t4.id')
|
||||
|
||||
@@ -96,6 +96,7 @@ class compileTao extends compileModel
|
||||
$updatedDate = $build->updated;
|
||||
}
|
||||
$data->updateDate = date('Y-m-d H:i:s', $updatedDate);
|
||||
$data->branch = !empty($build->branch) ? $build->branch : '';
|
||||
}
|
||||
|
||||
$this->dao->insert(TABLE_COMPILE)->data($data)->exec();
|
||||
|
||||
@@ -5,6 +5,7 @@ include dirname(__FILE__, 2) . '/lib/compile.unittest.class.php';
|
||||
|
||||
zenData('compile')->gen(1);
|
||||
zenData('job')->loadYaml('job')->gen(1);
|
||||
zenData('repo')->loadYaml('repo')->gen(10);
|
||||
su('admin');
|
||||
|
||||
/**
|
||||
@@ -13,12 +14,15 @@ title=测试 compileModel->getList();
|
||||
timeout=0
|
||||
cid=1
|
||||
|
||||
- 检查是否能获取到数据第1条的name属性 @构建1
|
||||
- 检查是否能获取到数据
|
||||
- 第1条的name属性 @构建1
|
||||
- 第1条的status属性 @success
|
||||
- 第1条的pipeline属性 @simple-job
|
||||
- 第1条的triggerType属性 @tag
|
||||
- 检查获取不存在的数据会返回什么 @0
|
||||
|
||||
*/
|
||||
|
||||
$compile = new compileTest();
|
||||
|
||||
r($compile->getListTest(1, 1)) && p('1:name') && e('构建1'); //检查是否能获取到数据
|
||||
r($compile->getListTest(3, 1)) && p('') && e('0'); //检查获取不存在的数据会返回什么
|
||||
r($compile->getListTest(1, 1)) && p('1:name,status,pipeline,triggerType') && e('构建1,success,simple-job,tag'); //检查是否能获取到数据
|
||||
r($compile->getListTest(3, 1)) && p('') && e('0'); //检查获取不存在的数据会返回什么
|
||||
|
||||
@@ -12,13 +12,13 @@ cid=1
|
||||
- 测试当buildTType为jenkins的时候,判断创建的compile信息是否正确,是否与build内的信息一致。
|
||||
- 属性name @testName2
|
||||
- 属性job @2
|
||||
- 属性createdBy @admin
|
||||
- 属性createdBy @system
|
||||
- 属性queue @1
|
||||
- 属性status @success
|
||||
- 测试当buildTType为jenkins的时候,判断创建的compile信息是否正确,是否与build内的信息一致。
|
||||
- 属性name @testName3
|
||||
- 属性job @3
|
||||
- 属性createdBy @admin
|
||||
- 属性createdBy @system
|
||||
- 属性queue @1
|
||||
- 属性status @failure
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ $config->job->dtable->fieldList['name']['name'] = 'name';
|
||||
$config->job->dtable->fieldList['name']['fixed'] = 'left';
|
||||
$config->job->dtable->fieldList['name']['type'] = 'desc';
|
||||
$config->job->dtable->fieldList['name']['sortType'] = true;
|
||||
$config->job->dtable->fieldList['name']['minWidth'] = '150';
|
||||
$config->job->dtable->fieldList['name']['minWidth'] = '350';
|
||||
$config->job->dtable->fieldList['name']['hint'] = true;
|
||||
$config->job->dtable->fieldList['name']['show'] = true;
|
||||
$config->job->dtable->fieldList['name']['required'] = true;
|
||||
@@ -75,12 +75,13 @@ $config->job->dtable->fieldList['triggerType']['width'] = '100';
|
||||
$config->job->dtable->fieldList['triggerType']['hint'] = true;
|
||||
$config->job->dtable->fieldList['triggerType']['show'] = true;
|
||||
|
||||
$config->job->dtable->fieldList['lastExec']['title'] = $lang->job->lastExec;
|
||||
$config->job->dtable->fieldList['lastExec']['name'] = 'lastExec';
|
||||
$config->job->dtable->fieldList['lastExec']['type'] = 'datetime';
|
||||
$config->job->dtable->fieldList['lastExec']['sortType'] = true;
|
||||
$config->job->dtable->fieldList['lastExec']['hint'] = true;
|
||||
$config->job->dtable->fieldList['lastExec']['show'] = true;
|
||||
$config->job->dtable->fieldList['lastExec']['title'] = $lang->job->lastExec;
|
||||
$config->job->dtable->fieldList['lastExec']['name'] = 'lastExec';
|
||||
$config->job->dtable->fieldList['lastExec']['type'] = 'datetime';
|
||||
$config->job->dtable->fieldList['lastExec']['sortType'] = true;
|
||||
$config->job->dtable->fieldList['lastExec']['hint'] = true;
|
||||
$config->job->dtable->fieldList['lastExec']['show'] = true;
|
||||
$config->job->dtable->fieldList['lastExec']['formatDate'] = 'YYYY-MM-dd hh:mm';
|
||||
|
||||
$config->job->actionList = array();
|
||||
$config->job->actionList['compile']['icon'] = 'history';
|
||||
|
||||
@@ -6,8 +6,12 @@ window.renderCell = function(result, {col, row})
|
||||
if(row.data.lastStatus == 'failure' || row.data.lastStatus == 'create_fail') className = 'status-doing';
|
||||
if(row.data.lastStatus == 'success') className = 'status-done';
|
||||
result[0] = {html:'<span class="' + className + '">' + result[0] + '</span>'};
|
||||
}
|
||||
|
||||
return result;
|
||||
if(col.name === 'name')
|
||||
{
|
||||
if(typeof(row.data.branch) == 'undefined') return result;
|
||||
result[1] = {html: '<span class="label success-pale mr-1">' + row.data.branch + '</span>'};
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -50,6 +50,7 @@ class jobZen extends job
|
||||
}
|
||||
else
|
||||
{
|
||||
$job->branch = empty($job->pipeline) ? '' : zget(json_decode($job->pipeline), 'reference', '');
|
||||
$job->pipeline = $job->repoName;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ $config->repo->dtable->fieldList['path']['group'] = 1;
|
||||
$config->repo->dtable->fieldList['lastSubmit']['name'] = 'lastSubmitTime';
|
||||
$config->repo->dtable->fieldList['lastSubmit']['title'] = $lang->repo->lastSubmitTime;
|
||||
$config->repo->dtable->fieldList['lastSubmit']['type'] = 'datetime';
|
||||
$config->repo->dtable->fieldList['lastSubmit']['formatDate'] = 'MM-dd hh:mm';
|
||||
$config->repo->dtable->fieldList['lastSubmit']['formatDate'] = 'YYYY-MM-dd hh:mm';
|
||||
$config->repo->dtable->fieldList['lastSubmit']['sortType'] = false;
|
||||
$config->repo->dtable->fieldList['lastSubmit']['width'] = '100';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user