diff --git a/Dockerfile.test b/Dockerfile.test index 27064d4fdc..03cef88a60 100644 --- a/Dockerfile.test +++ b/Dockerfile.test @@ -1,4 +1,4 @@ -FROM hub.qucheng.com/ci/zentao-ztf:php8-2023042805 +FROM hub.qucheng.com/ci/zentao-ztf:php8-2023050806 # Install zentao ARG VERSION diff --git a/Jenkinsfile b/Jenkinsfile index c784fd6c56..4a98a87a2f 100755 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -33,8 +33,10 @@ pipeline { steps { container('sonar') { withSonarQubeEnv('sonarqube') { - sh 'git config --global --add safe.directory $(pwd)' - sh 'sonar-scanner -Dsonar.analysis.user=$(git show -s --format=%an)' + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh 'git config --global --add safe.directory $(pwd)' + sh 'sonar-scanner -Dsonar.analysis.user=$(git show -s --format=%an)' + } } } } @@ -138,6 +140,7 @@ pipeline { container('zentao') { sh 'initdb.php config' sh '/apps/zentao/test/ztest extract ; /apps/zentao/test/ztest ${SEQUENCE} | tee /apps/zentao/test/${SEQUENCE}.log' + sh 'ls /apps/zentao/www ; cat /apps/zentao/www/coverage.php' sh 'pipeline-unittest.sh /apps/zentao/test/${SEQUENCE}.log' } } diff --git a/Makefile b/Makefile index 61bf4d6b48..081ac8421a 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ -VERSION = $(shell head -n 1 VERSION) -XUANVERSION = $(shell head -n 1 extension/xuanxuan/XUANVERSION) -XVERSION = $(shell head -n 1 extension/xuanxuan/XVERSION) +VERSION = $(shell head -n 1 VERSION) +XUANVERSION = $(shell head -n 1 extension/xuanxuan/XUANVERSION) +XVERSION = $(shell head -n 1 extension/xuanxuan/XVERSION) +XHPROF_VERSION = 2.3.9 XUANPATH := $(XUANXUAN_SRC_PATH) BUILD_PATH := $(if $(ZENTAO_BUILD_PATH),$(ZENTAO_BUILD_PATH),$(shell pwd)) @@ -345,3 +346,10 @@ ci: mv ZenTaoALM.$(VERSION).int.php*.zip ZenTaoPMS.$(VERSION).php*.zip $(RELEASE_PATH)/pmsPack mv *.deb $(RELEASE_PATH)/pmsPack/deb/ mv *.rpm $(RELEASE_PATH)/pmsPack/rpm/ +xhprof: + wget https://pecl.php.net/get/xhprof-$(XHPROF_VERSION).tgz + tar -zxvf xhprof-$(XHPROF_VERSION).tgz + rm -rf www/xhprof/xhprof_html www/xhprof/xhprof_lib + mkdir -p www/xhprof + mv xhprof-$(XHPROF_VERSION)/xhprof_html xhprof-$(XHPROF_VERSION)/xhprof_lib www/xhprof/ + rm -rf xhprof-$(XHPROF_VERSION)* package.xml diff --git a/db/update18.4.alpha1.sql b/db/update18.4.alpha1.sql new file mode 100644 index 0000000000..e3cec0f886 --- /dev/null +++ b/db/update18.4.alpha1.sql @@ -0,0 +1,4 @@ +ALTER TABLE `zt_project` ADD `stageBy` enum('project', 'product') NOT NULL DEFAULT 'product' AFTER `division`; +UPDATE `zt_project` SET `stageBy` = 'project' WHERE `division` = '0'; +UPDATE `zt_project` SET `stageBy` = 'product' WHERE `division` = '1'; +ALTER TABLE `zt_project` DROP `division`; diff --git a/db/zentao.sql b/db/zentao.sql index 06b2dea9c9..1f1fca3af5 100755 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1354,7 +1354,7 @@ CREATE TABLE IF NOT EXISTS `zt_project` ( `whitelist` text NULL, `order` mediumint(8) unsigned NOT NULL DEFAULT '0', `vision` varchar(10) NOT NULL DEFAULT 'rnd', - `division` enum('0','1') NOT NULL DEFAULT '1', + `stageBy` enum('project','product') NOT NULL DEFAULT 'product', `displayCards` smallint(6) NOT NULL default '0', `fluidBoard` enum('0','1') NOT NULL DEFAULT '0', `multiple` enum('0','1') NOT NULL DEFAULT '1', diff --git a/framework/base/router.class.php b/framework/base/router.class.php index 9d64eea4be..55e2f7bff0 100644 --- a/framework/base/router.class.php +++ b/framework/base/router.class.php @@ -750,16 +750,12 @@ class baseRouter $outputDir = ini_get('xhprof.output_dir'); if(!is_dir($xhprofPath)) return false; + if(!$outputDir) $outputDir = $xhprofPath . DS . 'xhprof_runs'; + if(!is_dir($outputDir)) mkdir($outputDir, 0777, true); include_once $libUtilsPath . 'xhprof_lib.php'; include_once $libUtilsPath . 'xhprof_runs.php'; - if(!$outputDir) - { - $outputDir = $xhprofPath . DS . 'xhprof_runs'; - if(!is_dir($outputDir)) mkdir($outputDir, 0777, true); - } - $xhprofRuns = new \XHProfRuns_Default($outputDir); $type = "{$this->moduleName}_{$this->methodName}"; $runID = $xhprofRuns->save_run($log, $type); @@ -2042,7 +2038,7 @@ class baseRouter $fileName = baseName((string) $apiFile); [$method] = explode('.', $fileName); - $url = self::extractAPIURL($apiFile); + $url = static::extractAPIURL($apiFile); if($url) $hookCodes[$method][] = "return helper::requestAPI('$url');"; } foreach($hookFiles as $hookFile) @@ -2792,7 +2788,7 @@ class baseRouter public function connectByPDO(object $params): object|bool { $dsn = null; - if(!isset($params->driver)) self::triggerError('no pdo driver defined, it should be mysql or sqlite', __FILE__, __LINE__, $exit = true); + if(!isset($params->driver)) static::triggerError('no pdo driver defined, it should be mysql or sqlite', __FILE__, __LINE__, $exit = true); if(!isset($params->user)) return false; try { @@ -2827,7 +2823,7 @@ class baseRouter header("location: {$this->config->webRoot}checktable.php"); exit; } - self::triggerError($message, __FILE__, __LINE__, $exit = true); + static::triggerError($message, __FILE__, __LINE__, $exit = true); } } diff --git a/lib/form/form.class.php b/lib/form/form.class.php index 97785a1a34..4907430a14 100644 --- a/lib/form/form.class.php +++ b/lib/form/form.class.php @@ -22,6 +22,14 @@ class form extends baseFixer */ public $rawdata; + /** + * 原始配置。 + * The raw cofig. + * + * @var array + */ + public $rawconfig; + /** * 错误信息列表。 * Error list. diff --git a/lib/front/front.class.php b/lib/front/front.class.php index 3b4ccc75d8..0c630e6630 100644 --- a/lib/front/front.class.php +++ b/lib/front/front.class.php @@ -427,7 +427,7 @@ class js extends baseJS if($full) { $document = "