From fff67388f868d515d0ef0f22c6af3db3094892ff Mon Sep 17 00:00:00 2001 From: dingguodong Date: Wed, 27 Oct 2021 10:39:11 +0800 Subject: [PATCH 01/55] * Fix the bug that user can not select pipeline from jenkins. --- module/job/control.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/job/control.php b/module/job/control.php index a206bac9f7..6e41dd58db 100644 --- a/module/job/control.php +++ b/module/job/control.php @@ -120,7 +120,7 @@ class job extends control $this->view->repoTypes = $repoTypes; $this->view->products = array(0 => '') + $this->loadModel('product')->getProductPairsByProject($this->projectID); - $this->view->jenkinsServerList = $this->loadModel('jenkins')->getPairs(); + $this->view->jenkinsServerList = array("" => "") + $this->loadModel('jenkins')->getPairs(); $this->display(); } From e7c337c8b5839103f169bd03d74671f34709facc Mon Sep 17 00:00:00 2001 From: dingguodong Date: Wed, 27 Oct 2021 10:39:54 +0800 Subject: [PATCH 02/55] * Fix the bug that compile can run scheduled job. --- module/compile/model.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/compile/model.php b/module/compile/model.php index 38f4f4439d..3da3233e36 100644 --- a/module/compile/model.php +++ b/module/compile/model.php @@ -121,7 +121,7 @@ class compileModel extends model */ public function exec($compile) { - $job = $this->dao->select('t1.id,t1.name,t1.repo,t1.pipeline,t2.name as jenkinsName,t2.url,t2.account,t2.token,t2.password') + $job = $this->dao->select('t1.id,t1.name,t1.repo,t1.engine,t1.pipeline,t2.name as jenkinsName,t2.url,t2.account,t2.token,t2.password') ->from(TABLE_JOB)->alias('t1') ->leftJoin(TABLE_PIPELINE)->alias('t2')->on('t1.server=t2.id') ->where('t1.id')->eq($compile->job) @@ -150,8 +150,8 @@ class compileModel extends model $this->dao->update(TABLE_COMPILE)->data($compile)->where('id')->eq($compileID)->exec(); $this->dao->update(TABLE_JOB) - ->set('lastStatus')->eq($build->status) - ->set('lastExec')->eq($build->updateDate) + ->set('lastStatus')->eq($compile->status) + ->set('lastExec')->eq($compile->updateDate) ->where('id')->eq($job->id) ->exec(); From 0a93db90f222771e8ead09fd4e21e2b844dcd452 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Wed, 27 Oct 2021 10:41:03 +0800 Subject: [PATCH 03/55] * Add comments and notes. --- lib/scm/gitlab.class.php | 4 ++++ module/ci/model.php | 1 + 2 files changed, 5 insertions(+) diff --git a/lib/scm/gitlab.class.php b/lib/scm/gitlab.class.php index b4df296dab..783d46df5e 100644 --- a/lib/scm/gitlab.class.php +++ b/lib/scm/gitlab.class.php @@ -90,10 +90,14 @@ class gitlab /** * Get files info. * + * The API path requested is: "GET /projects/:id/repository/files/:file_path". + * Known issue of GitLab API: if a '%' in 'file_path', GitLab API will show a error 'file_path should be a valid file path'. + * * @param string $path * @param string $ref * @access public * @return array + * @doc https://docs.gitlab.com/ee/api/repository_files.html */ public function files($path, $ref = 'master') { diff --git a/module/ci/model.php b/module/ci/model.php index 9943a6fcaa..6677e6b66f 100644 --- a/module/ci/model.php +++ b/module/ci/model.php @@ -54,6 +54,7 @@ class ciModel extends model */ public function syncCompileStatus($compile) { + # Max retry times is: 3 . if($compile->times >= 3) { $this->dao->update(TABLE_COMPILE)->set('status')->eq('failure')->where('id')->eq($compile->id)->exec(); From 36cf32bb9bd13603906af2e3db5ebd2b89351075 Mon Sep 17 00:00:00 2001 From: dingguodong Date: Wed, 27 Oct 2021 11:08:37 +0800 Subject: [PATCH 04/55] * Make codes meet the CR rules. --- module/ci/model.php | 2 +- module/job/control.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/module/ci/model.php b/module/ci/model.php index 6677e6b66f..d37d81d82e 100644 --- a/module/ci/model.php +++ b/module/ci/model.php @@ -54,7 +54,7 @@ class ciModel extends model */ public function syncCompileStatus($compile) { - # Max retry times is: 3 . + /* Max retry times is: 3. */ if($compile->times >= 3) { $this->dao->update(TABLE_COMPILE)->set('status')->eq('failure')->where('id')->eq($compile->id)->exec(); diff --git a/module/job/control.php b/module/job/control.php index 6e41dd58db..383fe16b1c 100644 --- a/module/job/control.php +++ b/module/job/control.php @@ -120,7 +120,7 @@ class job extends control $this->view->repoTypes = $repoTypes; $this->view->products = array(0 => '') + $this->loadModel('product')->getProductPairsByProject($this->projectID); - $this->view->jenkinsServerList = array("" => "") + $this->loadModel('jenkins')->getPairs(); + $this->view->jenkinsServerList = array('' => '') + $this->loadModel('jenkins')->getPairs(); $this->display(); } From 9fac2ea22e0b60cc1a74e2bab93c3f11efbacedc Mon Sep 17 00:00:00 2001 From: tianshujie Date: Wed, 27 Oct 2021 13:50:27 +0800 Subject: [PATCH 05/55] * Fix bug #43540. --- module/product/view/browse.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 381b4163db..cd2fe96d19 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -132,7 +132,7 @@ $projectIDParam = $isProjectStory ? "projectID=$projectID&" : ''; app->rawModule != 'projectstory') common::printIcon('story', 'report', "productID=$productID&branchID=$branch&storyType=$storyType&browseType=$browseType&moduleID=$moduleID&chartType=pie", '', 'button', 'bar-chart muted'); ?>
-