forked from TencentBlueKing/blueking-dbm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit fd80f91
Showing
7,948 changed files
with
1,298,361 additions
and
0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
|
||
version: "v2.0" | ||
name: "开源检查" | ||
label: [] | ||
variables: {} | ||
on: | ||
mr: | ||
target-branches: [ "*" ] | ||
stages: | ||
- name: "开源检查" | ||
label: | ||
- "Build" | ||
jobs: | ||
job_AfK: | ||
name: "构建环境-LINUX" | ||
runs-on: | ||
pool-name: "docker" | ||
container: | ||
image: "mirrors.tencent.com/ci/tlinux3_ci:2.3.0" | ||
needs: {} | ||
steps: | ||
- checkout: self | ||
- name: "敏感信息检查-部门RTX" | ||
uses: "SensitiveRtxChecker@3.*" | ||
- name: "腾讯代码分析(官方-代码分析工作组)" | ||
uses: "CodeccCheckAtomDebug@4.*" | ||
with: | ||
beAutoLang: false | ||
languages: | ||
- "JS" | ||
- "PYTHON" | ||
- "TYPESCRIPT" | ||
- "CSS" | ||
- "JSON" | ||
- "GO" | ||
checkerSetType: "communityOpenScan" | ||
tools: | ||
- "PYLINT" | ||
- "WOODPECKER_COMMITSCAN" | ||
- "ESLINT" | ||
- "SCC" | ||
- "PECKER_SECURITY" | ||
- "SENSITIVE" | ||
- "DUPC" | ||
- "IP_CHECK" | ||
- "WOODPECKER_SENSITIVE" | ||
- "HORUSPY" | ||
- "XCHECK" | ||
- "CCN" | ||
asyncTask: false | ||
asyncTaskId: "" | ||
scriptType: "SHELL" | ||
script: |- | ||
# Coverity/Klocwork将通过调用编译脚本来编译您的代码,以追踪深层次的缺陷 | ||
# 请使用依赖的构建工具如maven/cmake等写一个编译脚本build.sh | ||
# 确保build.sh能够编译代码 | ||
# cd path/to/build.sh | ||
# sh build.sh | ||
languageRuleSetMap: {} | ||
checkerSetEnvType: "prod" | ||
multiPipelineMark: "" | ||
rtxReceiverType: "1" | ||
botWebhookUrl: "" | ||
botRemindRange: "2" | ||
botRemindSeverity: "7" | ||
botRemaindTools: [] | ||
emailReceiverType: "1" | ||
emailCCReceiverList: [] | ||
instantReportStatus: "2" | ||
reportDate: [] | ||
reportTime: "" | ||
reportTools: [] | ||
toolScanType: "1" # 扫描方式。快速全量扫描[1] | 全量扫描[0] | 差异扫描[6] | MR/PR扫描[2],默认为1 | ||
diffBranch: "" | ||
byFile: false | ||
mrCommentEnable: true | ||
prohibitIgnore: false | ||
newDefectJudgeFromDate: "" | ||
transferAuthorList: [] | ||
path: [] | ||
customPath: [] | ||
scanTestSource: false | ||
openScanPrj: false | ||
openScanFilterEnable: false | ||
issueSystem: "TAPD" | ||
issueSubSystem: "" | ||
issueResolvers: [] | ||
issueReceivers: [] | ||
issueFindByVersion: "" | ||
maxIssue: 1000 | ||
issueAutoCommit: false | ||
check-out: | ||
gates: | ||
- template: open_source_gate.yml | ||
timeout-hours: 10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
version: v2.0 | ||
|
||
stages: | ||
- name: "python代码格式检查" | ||
jobs: | ||
code_format: | ||
name: "python代码格式检查" | ||
runs-on: | ||
pool-name: docker #docker-on-devcloud、docker、local、agentless | ||
container: | ||
image: mirrors.tencent.com/ci/tlinux3_ci:2.0.0 | ||
steps: | ||
- checkout: self | ||
- name: "安装环境" | ||
run: |- | ||
pip install flake8 black=="20.8b1" | ||
- name: "flake8" | ||
run: |- | ||
FLAKE8_RESULT=$(flake8 dbm-ui/backend --config=dbm-ui/backend/.flake8) | ||
if [[ $FLAKE8_RESULT==0 ]]; then | ||
echo "flake8 test passed" | ||
else | ||
echo ${FLAKE8_RESULT} | ||
echo "flake8 test failed, please check if you have install pre-commit" | ||
exit 1 | ||
fi | ||
- name: "black" | ||
run: |- | ||
BLACK_RESULT=$(black dbm-ui/backend 2>&1) | ||
if [[ $BLACK_RESULT =~ "reformatted" ]]; then | ||
echo ${BLACK_RESULT} | ||
echo "black test failed, please check if you have install pre-commit" | ||
exit 1 | ||
else | ||
echo "black test passed" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
version: v2.0 | ||
|
||
on: | ||
mr: | ||
target-branches: [ "*" ] | ||
paths: | ||
- dbm-ui/backend/* | ||
|
||
stages: | ||
- name: "python单元测试" | ||
jobs: | ||
unit_test: | ||
name: "单元测试" | ||
runs-on: | ||
pool-name: docker #docker-on-devcloud、docker、local、agentless | ||
container: | ||
image: mirrors.tencent.com/ci/tlinux3_ci:2.0.0 | ||
steps: | ||
- checkout: self | ||
- uses: "calculatehash@1.*" | ||
id: "calculate" | ||
with: | ||
file_path: "dbm-ui/poetry.lock" | ||
calculate_func: "md5" | ||
- uses: cache@2.* | ||
id: cache | ||
with: | ||
cacheKey: "poetry_pip_${{ steps.calculate.outputs.hash_value }}" | ||
cachePaths: "/tmp/ci_py_venv" | ||
restoreKeys: "poetry_pip_" | ||
skipSaveWhenCacheHit: false | ||
- name: "Mysql服务" | ||
id: "mysql" | ||
uses: "mysqlservice@1.*" | ||
with: | ||
imageName: "mysql:5.7" | ||
port: "3306" | ||
mysqlPw: "db_for_unit_test" | ||
initCmd: "set names utf8mb4;" | ||
- name: "Redis服务" | ||
id: "redis" | ||
uses: "redisservice@1.*" | ||
with: | ||
imageName: "redis:5.0.9" | ||
redisPw: "redis_for_unit_test" | ||
- name: "执行单元测试" | ||
run: |- | ||
source ./dbm-ui/scripts/ci/env.sh | ||
export DB_HOST=${{ jobs.unit_test.steps.mysql.outputs.MYSQL_IP }} | ||
export DBA_APP_BK_BIZ_ID=0 | ||
export DB_PASSWORD="db_for_unit_test" | ||
export REDIS_HOST=${{ jobs.unit_test.steps.redis.outputs.REDIS_IP }} | ||
export REDIS_PORT=${{ jobs.unit_test.steps.redis.outputs.REDIS_PORT }} | ||
export REDIS_PASSWORD="redis_for_unit_test" | ||
export BROKER_URL="redis://:${REDIS_PASSWORD}@${REDIS_HOST}:${REDIS_PORT}/1" | ||
./dbm-ui/scripts/ci/bk_ci.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
parameters: | ||
- name: receivers | ||
type: array | ||
default: [ "${{ ci.actor }}" ] | ||
|
||
gates: | ||
- name: open-source-gate | ||
rule: | ||
- "CodeccCheckAtomDebug.all_risk <= 0" | ||
- "CodeccCheckAtomDebug.high_med_new_issue <= 0" | ||
- "CodeccCheckAtomDebug.ccn_new_max_value <= 55" | ||
- "CodeccCheckAtomDebug.sensitive_defect <= 0" | ||
- "CodeccCheckAtomDebug.dupc_average <= 15" | ||
- "CodeccCheckAtomDebug.ccn_average <= 3.5" | ||
- "CodeccCheckAtomDebug.ccn_funcmax <= 55" | ||
- "CodeccCheckAtomDebug.pyLint_after_defect <= 0" | ||
- "CodeccCheckAtomDebug.woodpecker_all_defect <= 0" | ||
- "CodeccCheckAtomDebug.horuspy_all_defect <= 0" | ||
- "CodeccCheckAtomDebug.go_serious_defect <= 0" | ||
- "CodeccCheckAtomDebug.go_all_defect <= 100" | ||
notify-on-fail: | ||
- type: wework-message | ||
receivers: ${{ parameters.receivers }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
######## Code generated by gonote. DO NOT EDIT. >>>>> | ||
|
||
# [!勿修改模板!] 生成了默认值模板,请根据实际情况调整对应的配置值 | ||
# [!最高优先级!] 本项目的特殊配置,会覆盖命令行输入的参数 | ||
gonote: | ||
split_ch_and_en: false # [选项开关] 修复行注释(//...)中英文词没有空格间隔,但不修复注释块(/*...*/) | ||
without_import: true # [选项开关] 关闭 import 强制分组功能 | ||
no_line_break: false # [选项开关] 关闭过长自动换行功能 | ||
no_complete_general: false # [选项开关] 关闭补全通用注释,默认填充 ServeHTTP/String/Error 等通用注释 | ||
complete_general_config: # 内置了腾讯代码规范中的例外函数,你可以覆盖或添加更多配置 | ||
- pattern: "Run()" | ||
annotation: Command Run | ||
limits: | ||
- type_func | ||
- pattern: "Init()" | ||
annotation: prepare run env | ||
limits: | ||
- type_func | ||
- pattern: "Validate()" | ||
annotation: run selfdefine validate function | ||
limits: | ||
- type_func | ||
- pattern: "Example()" | ||
annotation: subcommand example input | ||
limits: | ||
- type_func | ||
- pattern: "PreCheck()" | ||
annotation: pre run pre check | ||
limits: | ||
- type_func | ||
- pattern: "New.*Command" | ||
annotation: create new subcommand | ||
limits: | ||
- func | ||
- pattern: "Install()" | ||
annotation: install | ||
limits: | ||
- type_func | ||
- func | ||
# - pattern: '(.*)Req' # 匹配该正则所有的关键词 | ||
# annotation: '函数 $1 入参' # 参考 nginx 的 URL 重写 ListReq =正则匹配并解析group=> (List)Req =取出group=> ($1)Req =group替换=> 函数 List 入参 | ||
# limits: | ||
# - func # 函数注释 | ||
# - type_func # 类型函数注释,常见结构体函数 | ||
# - type # 类型,常见结构体注释 | ||
linters: | ||
disable_all: false | ||
enable: | ||
- oversize_func_arg # 函数入参过多,不能超过5个 | ||
- large_file # 超大文件检查,普通<800行,单测<1600行 | ||
- large_func # 超长函数体检查,普通<80行,单测<160行 | ||
- switch_default # switch 需要 default 分支 | ||
- bad_name # 不符合规范的命名 | ||
|
||
######## Code generated by gonote. DO NOT EDIT. <<<<< | ||
|
||
source: | ||
# 文件或目录使用绝对路径,绝对路径按代码库根目录计算,以/开头。 | ||
# 提供产品代码库中编写的测试代码存放目录或文件名格式,以便后续代码统计环节进行排除等特殊处理 | ||
# 不要使用.*/等正则表达式屏蔽掉所有代码,会导致部门代码量骤减从而影响部门代码得分,还会导致Coverity扫不到任何代码而失败 | ||
# 请勿使用Tab键,将会导致yaml解析出错 | ||
test_source: | ||
#用于匹配文件; 匹配方式为正则表达式。 | ||
filepath_regex: [".*/test.py"] | ||
# 提供产品代码库中工具或框架自动生成的且在代码库中的代码,没有可为空。以便后续代码统计环节进行排除等特殊处理。 | ||
auto_generate_source: | ||
# 自动生成代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例 | ||
filepath_regex: [".*/migrations/.*"] | ||
# 提供产品代码库中直接以源码形式存在的第三方代码目录或代码文件名的正则表达。 | ||
# 此处备注的第三方代码在后续统计代码量环节会被排除,若代码库中不存在需要排除的第三方代码,该项配置标识可为空 | ||
third_party_source: | ||
#第三方代码文件的正则表达式,若无统一标识格式,可以指定具体目录,样例可参考test_source举例 | ||
filepath_regex: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.venv | ||
.codecc | ||
.idea | ||
.vscode | ||
tmp* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# public | ||
/.github @zhangzhw8 @iSecloud | ||
/docs @zhangzhw8 @iSecloud | ||
/*.md @zhangzhw8 @iSecloud | ||
/helm-charts @zhangzhw8 @iSecloud | ||
|
||
# dbm-ui | ||
/dbm-ui @zhangzhw8 @iSecloud | ||
/dbm-ui/frontend @hLinx @jinquantianxia | ||
|
||
# dbm-services common | ||
/dbm-services/common @seanlook @xfwduke @lukemakeit @xiepaup @ymakedaq | ||
/dbm-services/common/db-config @seanlook @xfwduke | ||
/dbm-services/common/db-resource @ymakedaq @seanlook @xfwduke | ||
/dbm-services/common/db-dns @omg-by @xiepaup @lukemakeit | ||
/dbm-services/common/dbha @xjxia | ||
|
||
# bigdata | ||
/dbm-services/bigdata @zhangrq5 @zvictorino @wangyao963 | ||
/dbm-services/es @zhangrq5 @zvictorino @wangyao963 | ||
/dbm-services/hdfs @zhangrq5 @zvictorino @wangyao963 | ||
/dbm-services/kafka @zhangrq5 @zvictorino @wangyao963 | ||
|
||
# mysql | ||
/dbm-services/mysql @seanlook @xfwduke @yksitu @ymakedaq | ||
/dbm-services/mysql/db-partition @fanfanyangyang @xfan0805 | ||
/dbm-services/mysql/db-priv @fanfanyangyang @xfwduke @seanlook | ||
/dbm-services/mysql/db-remote-service @xfwduke @seanlook | ||
/dbm-services/mysql/db-simulation @seanlook @xfwduke @ymakedaq | ||
|
||
# redis | ||
/dbm-services/redis @lukemakeit @xiepaup @omg-by @mikluo @yyhenryyy @cycker @cuiguobin | ||
|
||
# riak | ||
/dbm-services/riak @fanfanyangyang | ||
|
||
# sqlserver | ||
/dbm-services/sqlserver @yksitu | ||
|
||
# mongodb | ||
/dbm-services/mongodb @cycker @yyhenryyy @xiepaup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 参与者公约 | ||
## 我们的承诺 | ||
为建设开放友好的环境,我们贡献者和维护者承诺:不论年龄、体型、身体健全与否、民族、性征、性别认同与表征、经验水平、教育程度、社会地位、 | ||
国籍、相貌、种族、信仰、性取向,我们项目和社区的参与者皆免于骚扰。 | ||
|
||
## 我们的准则 | ||
|
||
有助于创造积极环境的行为包括但不限于: | ||
|
||
- 措辞友好且包容 | ||
- 尊重不同的观点和经验 | ||
- 耐心接受有益批评 | ||
- 关注对社区最有利的事情 | ||
- 与社区其他成员友善相处 | ||
|
||
参与者不应采取的行为包括但不限于: | ||
|
||
- 发布与性有关的言论或图像、不受欢迎地献殷勤 | ||
- 捣乱/煽动/造谣行为、侮辱/贬损的评论、人身及政治攻击 | ||
- 公开或私下骚扰 | ||
- 未经明确授权便发布他人的资料,如住址、电子邮箱等 | ||
- 其他有理由认定为违反职业操守的不当行为 | ||
|
||
## 我们的义务 | ||
|
||
项目维护者有义务诠释何谓“妥当行为”,并妥善公正地纠正已发生的不当行为。 | ||
|
||
项目维护者有权利和义务去删除、编辑、拒绝违背本行为标准的评论(comments)、提交(commits)、代码、wiki 编辑、问题(issues)等贡献; | ||
项目维护者可暂时或永久地封禁任何他们认为行为不当、威胁、冒犯、有害的参与者。 | ||
|
||
## 适用范围 | ||
|
||
本行为标准适用于本项目。当有人代表本项目或本社区时,本标准亦适用于此人所处的公共平台。 | ||
|
||
代表本项目或本社区的情形包括但不限于:使用项目的官方电子邮件、通过官方媒体账号发布消息、作为指定代表参与在线或线下活动等。 | ||
|
||
代表本项目的行为可由项目维护者进一步定义及解释。 | ||
|
||
## 贯彻落实 | ||
|
||
违反行为准则的行为可以报告给本仓库的 OWNER,向项目团队举报滥用、 | ||
骚扰及不当行为。 | ||
|
||
维护团队将审议并调查全部投诉,妥善地予以必要的回应。项目团队有义务保密举报者信息。具体执行方针或将另行发布。 | ||
|
||
未切实遵守或执行本行为标准的项目维护人员,经项目负责人或其他成员决议,可能被暂时或永久地剥夺参与本项目的资格。 | ||
|
||
## 来源 | ||
|
||
本行为标准改编自参与者公约,版本 1.4 可在此查阅:https://www.contributor-covenant.org/zh-cn/version/1/4/code-of-conduct.html |
Oops, something went wrong.