Skip to content

Commit

Permalink
feat:流水线归档 #9397
Browse files Browse the repository at this point in the history
  • Loading branch information
carlyin0801 committed Dec 11, 2023
1 parent 7633699 commit 3371091
Show file tree
Hide file tree
Showing 9 changed files with 2 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ class BkShardingDataSourceConfiguration {
val logicTableName = if (logicTableSuffixName.isNullOrBlank()) {
tableName
} else {
"${tableName}_${logicTableSuffixName}"
"${tableName}_$logicTableSuffixName"
}
val actualDataNodes = if (databaseShardingStrategy != null &&
tableShardingStrategy == TableShardingStrategyEnum.SHARDING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ package com.tencent.devops.common.event.pojo.pipeline
import com.tencent.devops.common.event.annotation.Event
import com.tencent.devops.common.event.dispatcher.pipeline.mq.MQ
import com.tencent.devops.common.event.enums.ActionType
import com.tencent.devops.common.event.pojo.pipeline.IPipelineEvent

/**
* 归档流水线事件
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ class BluekingLogPermissionService @Autowired constructor(
return false
}


override fun verifyUserLogPermission(
projectCode: String,
pipelineId: String,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,8 @@

package com.tencent.devops.log.service

import com.tencent.devops.common.api.constant.CommonMessageCode
import com.tencent.devops.common.api.exception.ParamBlankException
import com.tencent.devops.common.api.exception.PermissionForbiddenException
import com.tencent.devops.common.api.pojo.Result
import com.tencent.devops.common.api.util.MessageUtil
import com.tencent.devops.common.auth.api.AuthPermission
import com.tencent.devops.common.log.pojo.EndPageQueryLogs
import com.tencent.devops.common.log.pojo.PageQueryLogs
Expand All @@ -40,13 +37,12 @@ import com.tencent.devops.common.log.pojo.QueryLogStatus
import com.tencent.devops.common.log.pojo.QueryLogs
import com.tencent.devops.common.log.pojo.enums.LogStatus
import com.tencent.devops.common.log.pojo.enums.LogType
import com.tencent.devops.common.web.utils.I18nUtil
import com.tencent.devops.log.jmx.LogStorageBean
import com.tencent.devops.log.strategy.context.UserLogPermissionCheckContext
import com.tencent.devops.log.strategy.factory.UserLogPermissionCheckStrategyFactory
import javax.ws.rs.core.Response
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service
import javax.ws.rs.core.Response

@Suppress("LongParameterList", "TooManyFunctions")
@Service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,11 @@ package com.tencent.devops.process.api

import com.tencent.devops.common.api.pojo.Page
import com.tencent.devops.common.api.pojo.Result
import com.tencent.devops.common.pipeline.enums.ChannelCode
import com.tencent.devops.common.web.RestResource
import com.tencent.devops.process.api.service.ServiceArchivePipelineResource
import com.tencent.devops.process.api.service.ServiceAuthPipelineResource
import com.tencent.devops.process.engine.pojo.PipelineInfo
import com.tencent.devops.process.pojo.PipelineCollation
import com.tencent.devops.process.pojo.PipelineSortType
import com.tencent.devops.process.service.PipelineListFacadeService
import com.tencent.devops.process.pojo.classify.PipelineViewPipelinePage
import com.tencent.devops.process.pojo.pipeline.SimplePipeline
import com.tencent.devops.process.service.ArchivePipelineFacadeService
import org.springframework.beans.factory.annotation.Autowired

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ import com.tencent.devops.process.pojo.classify.PipelineViewFilterByCreator
import com.tencent.devops.process.pojo.classify.PipelineViewFilterByLabel
import com.tencent.devops.process.pojo.classify.PipelineViewFilterByName
import com.tencent.devops.process.pojo.classify.PipelineViewPipelinePage
import com.tencent.devops.process.pojo.classify.enums.Condition
import com.tencent.devops.process.pojo.classify.enums.Logic
import com.tencent.devops.process.pojo.code.WebhookInfo
import com.tencent.devops.process.pojo.pipeline.PipelineCount
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ package com.tencent.devops.process.service.builds
import com.tencent.devops.common.api.constant.CommonMessageCode
import com.tencent.devops.common.api.exception.ErrorCodeException
import com.tencent.devops.common.api.exception.ParamBlankException
import com.tencent.devops.common.api.exception.PermissionForbiddenException
import com.tencent.devops.common.api.model.SQLPage
import com.tencent.devops.common.api.pojo.BuildHistoryPage
import com.tencent.devops.common.api.pojo.ErrorType
Expand Down Expand Up @@ -68,7 +67,6 @@ import com.tencent.devops.common.service.utils.HomeHostUtil
import com.tencent.devops.common.web.utils.I18nUtil
import com.tencent.devops.process.constant.ProcessMessageCode
import com.tencent.devops.process.constant.ProcessMessageCode.BK_BUILD_HISTORY
import com.tencent.devops.process.constant.ProcessMessageCode.BK_BUILD_INFO
import com.tencent.devops.process.constant.ProcessMessageCode.BK_BUILD_STATUS
import com.tencent.devops.process.constant.ProcessMessageCode.BK_BUILD_VARIABLES
import com.tencent.devops.process.constant.ProcessMessageCode.BK_BUILD_VARIABLES_VALUE
Expand Down
77 changes: 0 additions & 77 deletions support-files/sql/2001_v0.x/2001_ci_process-update_v0.1_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,6 @@ BEGIN
SET AUTOCOMMIT = 0;
SELECT DATABASE() INTO db;

IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_BUILD_STARTUP_PARAM'
AND COLUMN_NAME = 'PARAM') THEN
ALTER TABLE T_BUILD_STARTUP_PARAM
ADD COLUMN `PARAM` mediumtext NOT NULL COMMENT '参数' AFTER BUILD_ID;
ELSEIF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_BUILD_STARTUP_PARAM'
AND COLUMN_NAME = 'PARAM'
AND COLUMN_TYPE = 'mediumtext') THEN
ALTER TABLE T_BUILD_STARTUP_PARAM
CHANGE `PARAM` `PARAM` mediumtext NOT NULL AFTER BUILD_ID;
END IF;

IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
Expand Down Expand Up @@ -370,36 +353,6 @@ BEGIN
END IF;


IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_BUILD_STARTUP_PARAM'
AND COLUMN_NAME = 'PROJECT_ID') THEN
ALTER TABLE T_BUILD_STARTUP_PARAM
ADD COLUMN `PROJECT_ID` varchar(64) DEFAULT NULL;
END IF;


IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_BUILD_STARTUP_PARAM'
AND COLUMN_NAME = 'PIPELINE_ID') THEN
ALTER TABLE T_BUILD_STARTUP_PARAM
ADD COLUMN `PIPELINE_ID` varchar(64) DEFAULT NULL COMMENT '流水线ID';
END IF;


IF NOT EXISTS(SELECT 1
FROM information_schema.statistics
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_BUILD_STARTUP_PARAM'
AND INDEX_NAME = 'IDX_DEL') THEN
ALTER TABLE T_BUILD_STARTUP_PARAM
ADD INDEX IDX_DEL (`PROJECT_ID`,`PIPELINE_ID`);
END IF;


IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
Expand Down Expand Up @@ -515,36 +468,6 @@ BEGIN
END IF;
END IF;

IF EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_PIPELINE_TEMPLATE'
AND COLUMN_NAME = 'ID') THEN
IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_PIPELINE_TEMPLATE'
AND COLUMN_NAME = 'ID'
AND COLUMN_TYPE = 'bigint(20)') THEN
ALTER TABLE T_PIPELINE_TEMPLATE MODIFY COLUMN ID BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID';
END IF;
END IF;

IF EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_BUILD_STARTUP_PARAM'
AND COLUMN_NAME = 'ID') THEN
IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_BUILD_STARTUP_PARAM'
AND COLUMN_NAME = 'ID'
AND COLUMN_TYPE = 'bigint(20)') THEN
ALTER TABLE T_BUILD_STARTUP_PARAM MODIFY COLUMN ID BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID';
END IF;
END IF;

COMMIT;
END <CI_UBF>
DELIMITER ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,6 @@ BEGIN
ALTER TABLE T_PIPELINE_LABEL_PIPELINE ADD COLUMN `PROJECT_ID` varchar(64) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '项目ID';
END IF;

IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
AND TABLE_NAME = 'T_PIPELINE_VIEW_LABEL'
AND COLUMN_NAME = 'PROJECT_ID') THEN
ALTER TABLE T_PIPELINE_VIEW_LABEL ADD COLUMN `PROJECT_ID` varchar(64) COLLATE utf8mb4_bin NOT NULL DEFAULT '' COMMENT '项目ID';
END IF;

IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = db
Expand Down

0 comments on commit 3371091

Please sign in to comment.