Skip to content

Commit

Permalink
feat: 社区版质量红线支持CodeCC和三方插件 TencentBlueKing#5836
Browse files Browse the repository at this point in the history
  • Loading branch information
JamiKX1 committed May 26, 2022
1 parent a8d095b commit 6d1c024
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,8 @@ class QualityRuleCheckService @Autowired constructor(

private fun getDetailMsg(record: QualityRuleInterceptRecord, params: Map<String, String>): String {
// codecc跳到独立入口页面
return if (CodeccUtils.isCodeccAtom(record.indicatorType)) {
return if (CodeccUtils.isCodeccAtom(record.indicatorType) ||
CodeccUtils.isCodeccCommunityAtom(record.indicatorType)) {
val projectId = params["projectId"] ?: ""
val pipelineId = params["pipelineId"] ?: ""
val buildId = params["buildId"] ?: ""
Expand Down
36 changes: 24 additions & 12 deletions support-files/sql/5001_ci_quality-init_dml_mysql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -188,20 +188,32 @@ INSERT IGNORE INTO `T_QUALITY_METADATA` (`ID`, `DATA_ID`, `DATA_NAME`, `ELEMENT_


-- 创建模板
INSERT IGNORE INTO `T_QUALITY_RULE_TEMPLATE` (`ID`, `NAME`, `TYPE`, `DESC`, `STAGE`, `CONTROL_POINT`, `CONTROL_POINT_POSITION`, `CREATE_USER`, `UPDATE_USER`, `CREATE_TIME`, `UPDATE_TIME`, `ENABLE`) values('2','日常构建','TEMPLATE','用于控制日常构建的告警数','开发','linuxPaasCodeCCScript','AFTER','admin','admin','2019-04-10 10:56:57','2019-04-10 11:03:51',b'1');
INSERT IGNORE INTO `T_QUALITY_RULE_TEMPLATE` (`ID`, `NAME`, `TYPE`, `DESC`, `STAGE`, `CONTROL_POINT`, `CONTROL_POINT_POSITION`, `CREATE_USER`, `UPDATE_USER`, `CREATE_TIME`, `UPDATE_TIME`, `ENABLE`) values('3','版本转测','TEMPLATE','用于版本转测时的质量控制','部署测试环境','jobDevOpsFastPushFile','BEFORE','admin','admin','2019-04-10 10:58:12','2019-04-10 11:03:52',b'1');
INSERT IGNORE INTO `T_QUALITY_RULE_TEMPLATE` (`ID`, `NAME`, `TYPE`, `DESC`, `STAGE`, `CONTROL_POINT`, `CONTROL_POINT_POSITION`, `CREATE_USER`, `UPDATE_USER`, `CREATE_TIME`, `UPDATE_TIME`, `ENABLE`) values('4','发布上线','TEMPLATE','用于发布版本时的质量控制','部署正式环境','cosCdnDistribution','BEFORE','admin','admin','2019-04-10 11:01:34','2019-04-10 11:43:06',b'1');
REPLACE INTO `T_QUALITY_RULE_TEMPLATE` (`ID`, `NAME`, `TYPE`, `DESC`, `STAGE`, `CONTROL_POINT`, `CONTROL_POINT_POSITION`, `CREATE_USER`, `UPDATE_USER`, `CREATE_TIME`, `UPDATE_TIME`, `ENABLE`) values('2','日常构建','TEMPLATE','用于控制日常构建的告警数','开发','CodeCCCheckAtom','AFTER','admin','admin','2019-04-10 10:56:57','2019-04-10 11:03:51',b'1');
REPLACE INTO `T_QUALITY_RULE_TEMPLATE` (`ID`, `NAME`, `TYPE`, `DESC`, `STAGE`, `CONTROL_POINT`, `CONTROL_POINT_POSITION`, `CREATE_USER`, `UPDATE_USER`, `CREATE_TIME`, `UPDATE_TIME`, `ENABLE`) values('3','版本转测','TEMPLATE','用于版本转测时的质量控制','部署测试环境','CodeCCCheckAtom','AFTER','admin','admin','2019-04-10 10:58:12','2019-04-10 11:03:52',b'1');
REPLACE INTO `T_QUALITY_RULE_TEMPLATE` (`ID`, `NAME`, `TYPE`, `DESC`, `STAGE`, `CONTROL_POINT`, `CONTROL_POINT_POSITION`, `CREATE_USER`, `UPDATE_USER`, `CREATE_TIME`, `UPDATE_TIME`, `ENABLE`) values('4','发布上线','TEMPLATE','用于发布版本时的质量控制','部署正式环境','CodeCCCheckAtom','AFTER','admin','admin','2019-04-10 11:01:34','2019-04-10 11:43:06',b'1');
REPLACE INTO `T_QUALITY_RULE_TEMPLATE` (`ID`, `NAME`, `TYPE`, `DESC`, `STAGE`, `CONTROL_POINT`, `CONTROL_POINT_POSITION`, `CREATE_USER`, `UPDATE_USER`, `CREATE_TIME`, `UPDATE_TIME`, `ENABLE`) values('5','安全相关','INDICATOR_SET','包含Coverity安全规则包和敏感信息告警',NULL,NULL,NULL,'admin','admin','2019-04-10 11:42:27','2019-04-10 11:42:33','');
INSERT IGNORE INTO `T_QUALITY_RULE_TEMPLATE` (`ID`, `NAME`, `TYPE`, `DESC`, `STAGE`, `CONTROL_POINT`, `CONTROL_POINT_POSITION`, `CREATE_USER`, `UPDATE_USER`, `CREATE_TIME`, `UPDATE_TIME`, `ENABLE`) values('6','Java工具规范','INDICATOR_SET','CheckStyle工具规范',NULL,NULL,NULL,'admin','admin','2019-04-10 11:01:34','2019-04-10 11:43:06',b'1');


INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('15','2','1011','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('16','3','1011','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('17','3','1015','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('42','5','1048','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('43','5','1009','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('44','4','1009','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('45','4','1015','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('46','4','1011','LE','0');
REPLACE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('15','2','1016','LE','0');
REPLACE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('16','2','1027','LE','0');
REPLACE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('17','2','1029','LE','0');
REPLACE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('42','2','1030','LE','0');
REPLACE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('43','2','1031','LE','0');
REPLACE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('44','3','1016','LE','0');
REPLACE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('45','3','1027','LE','0');
REPLACE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('46','3','1029','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('47','6','1034','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('48','6','1036','LE','10');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('48','6','1036','LE','10');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('49','3','1030','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('50','3','1031','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('51','4','1016','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('52','4','1027','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('53','4','1029','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('54','4','1030','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('55','4','1031','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('56','5','1016','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('57','5','1027','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('58','5','1029','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('59','5','1030','LE','0');
INSERT IGNORE INTO `T_QUALITY_TEMPLATE_INDICATOR_MAP` (`ID`, `TEMPLATE_ID`, `INDICATOR_ID`, `OPERATION`, `THRESHOLD`) values('60','5','1031','LE','0');

0 comments on commit 6d1c024

Please sign in to comment.