diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f78f698..e5788c3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,7 +42,7 @@ jobs: with: build-root-directory: src/backend/core gradle-version: 6.7.1 - arguments: clean buildAndCopyZip -DmavenCredUserName=${{ secrets.NAME }} -DmavenCredPassword=${{ secrets.GITHUB_TOKEN }} -DmavenRepoUrl=http://maven.aliyun.com/nexus/content/groups/public/ + arguments: clean buildZipWithEn -DmavenCredUserName=${{ secrets.NAME }} -DmavenCredPassword=${{ secrets.GITHUB_TOKEN }} -DmavenRepoUrl=http://maven.aliyun.com/nexus/content/groups/public/ - name: Upload a Build Artifact uses: actions/upload-artifact@v2 with: @@ -59,7 +59,7 @@ jobs: release_name: ${{ github.ref }} draft: true prerelease: true - - name: Upload Release Asset + - name: Upload ZH_CN Release Asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -68,3 +68,12 @@ jobs: asset_path: src/backend/core/build/distributions/CodeCCCheckAtom.zip asset_name: CodeCCCheckAtom.zip asset_content_type: application/zip + - name: Upload EN Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: src/backend/core/build/distributions/CodeCCCheckAtom_en.zip + asset_name: CodeCCCheckAtom_en.zip + asset_content_type: application/zip diff --git a/src/backend/core/build.gradle b/src/backend/core/build.gradle index 1352769..bef7ec9 100644 --- a/src/backend/core/build.gradle +++ b/src/backend/core/build.gradle @@ -120,6 +120,10 @@ allprojects { into "../../frontend/target/frontend" } + task cleanTarget(type:Delete) { + delete "../../../target" + } + task copyDocs(type:Copy) { from "../../../docs" into "../../../target/file/docs" @@ -130,21 +134,33 @@ allprojects { into "../../../target/file/images" } - task buildZip(type: Zip, dependsOn: [shadowJar, copyFrontend, copyDocs, copyImages]) { + task buildZipCn(type: Zip, dependsOn: [shadowJar, copyFrontend, cleanTarget, copyDocs, copyImages]) { from "build/libs", "task.json", "quality.json", "../../frontend/target", "../../../target" into "CodeCCCheckAtom" + archiveName "CodeCCCheckAtom.zip" } - task buildAndCopyZip(type: Copy, dependsOn: [buildZip]) { - from "build/distributions" - into "build/distributions" + task renameEnTaskJson(type:Copy) { + from "task_en.json" + into "../../../target/" rename { String fileName -> // a simple way is to remove the "-$version" from the jar filename // but you can customize the filename replacement rule as you wish. - fileName = "CodeCCCheckAtom.zip" + fileName = "task.json" } } + task buildZipWithEn(type: Zip, dependsOn: [buildZipCn, renameEnTaskJson]) { + from "build/libs", "quality.json", "../../frontend/target", "../../../target" + into "CodeCCCheckAtom" + archiveName "CodeCCCheckAtom_en.zip" + } + +// task buildAndCopyZip(type: Copy, dependsOn: [buildZipCn, buildZipEn]) { +// from "build/distributions" +// into "build/distributions" +// } + check.dependsOn ktlint // 固定入口类 不要改 diff --git a/src/backend/core/task.json b/src/backend/core/task.json index 6919fac..eed9fa8 100644 --- a/src/backend/core/task.json +++ b/src/backend/core/task.json @@ -12,10 +12,10 @@ "rule": {}, "type": "atom-checkbox-list", "required": true, - "label": "Programming Language", + "label": "工程语言", "list": [], "default": [], - "desc": "tools will match different programming language", + "desc": "不同代码语言,可选择相匹配的工具", "tabName": "basic" }, "tools": { @@ -23,7 +23,7 @@ "required": true, "hidden": true, "type": "atom-checkbox-list", - "label": "Code Review Tool", + "label": "代码检查工具", "list": [], "default": [], "tabName": "basic" @@ -31,15 +31,15 @@ "asyncTask": { "rule": {}, "type": "enum-input", - "label": "Sync Method", + "label": "执行方式", "list": [ { "value": false, - "label": "Synchronize" + "label": "同步" }, { "value": true, - "label": "Asynchronous" + "label": "异步" } ], "default": false, @@ -52,14 +52,14 @@ "asyncTaskRequired": true }, "type": "task-select", - "label": "Task", + "label": "任务", "required": true, "tabName": "async", "inline": true, "list": {}, "default": "", "rely": {}, - "desc": "You can choose to create a task yourself in the CodeCC service, or you can directly enter the task ID. The task ID can be obtained from the CodeCC link (in /codecc/myproj/task/25324/, 25324 is the task ID). Support pipeline variables." + "desc": "可选择CodeCC服务中自建任务,也可以直接输入任务ID。ID可从CodeCC链接中获取到,例如/codecc/myproj/task/25324/中的数字。支持流水线变量。" }, "goPath": { "rule": {}, @@ -67,8 +67,8 @@ "label": "GOPATH", "default": "", "required": false, - "desc": "Help find the code path of the dependent library to get a more useful result", - "placeholder": "Relative paths under {WORKSPACE}, please use comma to separate multiple paths, support pipeline variables", + "desc": "可帮助工具查找依赖库代码路径,更好地扫描告警", + "placeholder": "${WORKSPACE}下相对路径,多路径请用英文逗号分割,支持使用流水线变量", "tabName": "basic", "inline": true, "rely": { @@ -84,7 +84,7 @@ "pyVersion": { "rule": {}, "type": "enum-input", - "label": "Python Version", + "label": "Python版本", "required": true, "list": [ { @@ -112,7 +112,7 @@ "scriptType": { "rule": {}, "type": "enum-input", - "label": "Script Type", + "label": "脚本类型", "required": true, "hidden": false, "list": [ @@ -131,12 +131,12 @@ "rule": { "scriptRequired": true }, - "label": "Script", + "label": "脚本内容", "hidden": false, - "default": "#Coverity/Klocwork will compile your code by calling the compilation script to identify defects\n# Please use build tools such as maven/cmake to write a compilation script build.sh\n# Make sure build.sh can compile the code\n# cd path/to/build.sh\n# sh build.sh", + "default": "# Coverity/Klocwork将通过调用编译脚本来编译您的代码,以追踪深层次的缺陷\n# 请使用依赖的构建工具如maven/cmake等写一个编译脚本build.sh\n# 确保build.sh能够编译代码\n# cd path/to/build.sh\n# sh build.sh", "required": true, "type": "atom-ace-editor", - "desc": "The corresponding tool will use this script to compile the code in order to track the compilation process and find code defects", + "desc": "相应工具将使用该脚本编译代码,以便追踪编译过程,发现代码缺陷", "tabName": "basic" }, "languageRuleSetMap": { @@ -166,52 +166,52 @@ }, "multiPipelineMark": { "rule": {}, - "label": "label", - "placeholder": "Optional. Only numbers, letters, and underscores are supported.", + "label": "附加标识", + "placeholder": "默认可不填。仅支持数字、字母和下划线。", "type": "vuex-input", "default": "", "tabName": "basic", - "desc": "If the pipeline has multiple code analysis plugins, a label can be used to distinguish them.", + "desc": "若流水线有多个代码分析插件可用此字段区分。", "inline": true }, "toolScanType": { "rule": {}, "type": "radio-group", - "label": "Scan Method", + "label": "扫描方式", "required": true, "list": [ { - "label": "Incremental Scan(recommended)", + "label": "增量扫描(推荐)", "value": "1" }, { - "label": "MR/PR Scan", + "label": "MR/PR扫描", "value": "2" }, { - "label": "Full Scan", + "label": "全量扫描", "value": "0" } ], "default": "1", - "desc": "Incremental scan: Scan the difference code between current build and previous build. Full scan will be used in the first time.\nMR/PR Scan: Scan the difference code between the source branch and the target branch of MR/PR. The source branch code needs to be pulled to the workspace\nFull Scan: Scan all codes. Klocwork, Pinpoint, Gometalinter, and repetition rate only support this scanning method." + "desc": "增量扫描:扫描本次构建与上次构建的差异代码。首次为全量扫描。\nMR/PR扫描:扫描MR/PR的源分支与目标分支的差异代码。源分支代码需拉取到工作空间。\n全量扫描:扫描全部代码。Klocwork、Pinpoint、Gometalinter、重复率仅支持该扫描方式。" }, "mrCommentEnable": { "label": "", "default": true, "type": "atom-checkbox", - "text": "Sync the defect info to Tencent internal Git viewing page" + "text": "将扫描出的问题同步到工蜂代码查看页面" }, "newDefectJudgeFromDate": { "default": "", - "label": "New Alerts Threshold", - "desc": "Alerts sent after the selected date are New Alerts" + "label": "新告警判定", + "desc": "所选日期之后产生的告警为新告警" }, "transferAuthorList": { "default": [], "type": "author-transfer", - "label": "change owner", - "desc": "Alerts will sent to the new owner when the tools's ownership changed " + "label": "处理人转换", + "desc": "各工具原处理人的告警都将自动转给新处理人" }, "path": { "default": [], @@ -226,8 +226,8 @@ "default": false, "placeholder": "", "type": "atom-checkbox", - "text": "use open sourced tool to scan project", - "desc": "Use open sourced scanning tool when selected", + "text": "是否是开源扫描项目", + "desc": "选中则走开源扫描流程", "required": false, "disabled": false, "hidden": true @@ -236,16 +236,16 @@ "output": { "BK_CI_CODECC_TASK_ID": { "type": "string", - "description": "CodeCC task id" + "description": "CodeCC的任务id" }, "BK_CI_CODECC_TASK_STATUS": { "type": "string", - "description": "Whether the CodeCC task runs successfully" + "description": "CodeCC任务是否运行成功,成功则未true,不然取不到" } }, "releaseInfo": { "projectId": "demo", - "name": "CodeCC Code Check", + "name": "CodeCC代码检查", "language": "java", "logoUrl": "${{indexFile(\"images/logo.png\")}}", "category": "TASK", @@ -253,8 +253,8 @@ "jobType": "AGENT", "os": ["LINUX", "MACOS", "WINDOWS"], "labelCodes": [], - "summary":"Support all CodeCC code inspection tools under Linux, MacOS, and Windows systems, including code defects (bkcheck, etc.), security vulnerabilities (sensitive information, high-risk components, etc.), code specifications (CppLint, CheckStyle, etc.), cyclomatic complexity, repetition rate, etc. .", - "description": "${{indexFile(\"docs/aboutCodeCC_en.md\")}}", + "summary":"支持Linux、MacOS、Windows系统下执行所有CodeCC代码检查工具,包括代码缺陷(bkcheck等)、安全漏洞(敏感信息、高危组件等)、代码规范(CppLint、CheckStyle等)、圈复杂度、重复率等。", + "description": "${{indexFile(\"docs/aboutCodeCC.md\")}}", "configInfo": { "frontendType": "SPECIAL" }, diff --git a/src/backend/core/task_en.json b/src/backend/core/task_en.json new file mode 100644 index 0000000..6919fac --- /dev/null +++ b/src/backend/core/task_en.json @@ -0,0 +1,268 @@ +{ + "atomCode": "CodeCCCheckAtom", + "execution": { + "packagePath": "CodeCCCheckAtom.jar", + "language": "java", + "minimumVersion": "1.8", + "deFmands": [], + "target": "$bk_java_path -Dfile.encoding=utf8 -jar CodeCCCheckAtom.jar" + }, + "input": { + "languages": { + "rule": {}, + "type": "atom-checkbox-list", + "required": true, + "label": "Programming Language", + "list": [], + "default": [], + "desc": "tools will match different programming language", + "tabName": "basic" + }, + "tools": { + "rule": {}, + "required": true, + "hidden": true, + "type": "atom-checkbox-list", + "label": "Code Review Tool", + "list": [], + "default": [], + "tabName": "basic" + }, + "asyncTask": { + "rule": {}, + "type": "enum-input", + "label": "Sync Method", + "list": [ + { + "value": false, + "label": "Synchronize" + }, + { + "value": true, + "label": "Asynchronous" + } + ], + "default": false, + "desc": "", + "tabName": "main", + "inline": true + }, + "asyncTaskId": { + "rule": { + "asyncTaskRequired": true + }, + "type": "task-select", + "label": "Task", + "required": true, + "tabName": "async", + "inline": true, + "list": {}, + "default": "", + "rely": {}, + "desc": "You can choose to create a task yourself in the CodeCC service, or you can directly enter the task ID. The task ID can be obtained from the CodeCC link (in /codecc/myproj/task/25324/, 25324 is the task ID). Support pipeline variables." + }, + "goPath": { + "rule": {}, + "type": "vuex-input", + "label": "GOPATH", + "default": "", + "required": false, + "desc": "Help find the code path of the dependent library to get a more useful result", + "placeholder": "Relative paths under {WORKSPACE}, please use comma to separate multiple paths, support pipeline variables", + "tabName": "basic", + "inline": true, + "rely": { + "operation": "AND", + "expression": [ + { + "key": "tools", + "value": "GOML" + } + ] + } + }, + "pyVersion": { + "rule": {}, + "type": "enum-input", + "label": "Python Version", + "required": true, + "list": [ + { + "label": "Python2", + "value": "py2" + }, + { + "label": "Python3", + "value": "py3" + } + ], + "default": "py3", + "tabName": "basic", + "inline": true, + "rely": { + "operation": "AND", + "expression": [ + { + "key": "tools", + "value": "PYLINT" + } + ] + } + }, + "scriptType": { + "rule": {}, + "type": "enum-input", + "label": "Script Type", + "required": true, + "hidden": false, + "list": [ + { + "id": "sh", + "value": "SHELL", + "label": "Shell" + } + ], + "default": "SHELL", + "tabName": "basic", + "lang": "sh", + "inline": true + }, + "script": { + "rule": { + "scriptRequired": true + }, + "label": "Script", + "hidden": false, + "default": "#Coverity/Klocwork will compile your code by calling the compilation script to identify defects\n# Please use build tools such as maven/cmake to write a compilation script build.sh\n# Make sure build.sh can compile the code\n# cd path/to/build.sh\n# sh build.sh", + "required": true, + "type": "atom-ace-editor", + "desc": "The corresponding tool will use this script to compile the code in order to track the compilation process and find code defects", + "tabName": "basic" + }, + "languageRuleSetMap": { + "hidden": true, + "default": {} + }, + "C_CPP_RULE": { + "rule": { + "ruleSetRequired": true + }, + "type": "rule-set-select", + "label": "C/C++", + "required": true, + "tabName": "basic", + "inline": true, + "list": {}, + "default": [], + "rely": { + "operation": "AND", + "expression": [ + { + "key": "languages", + "value": "C_CPP" + } + ] + } + }, + "multiPipelineMark": { + "rule": {}, + "label": "label", + "placeholder": "Optional. Only numbers, letters, and underscores are supported.", + "type": "vuex-input", + "default": "", + "tabName": "basic", + "desc": "If the pipeline has multiple code analysis plugins, a label can be used to distinguish them.", + "inline": true + }, + "toolScanType": { + "rule": {}, + "type": "radio-group", + "label": "Scan Method", + "required": true, + "list": [ + { + "label": "Incremental Scan(recommended)", + "value": "1" + }, + { + "label": "MR/PR Scan", + "value": "2" + }, + { + "label": "Full Scan", + "value": "0" + } + ], + "default": "1", + "desc": "Incremental scan: Scan the difference code between current build and previous build. Full scan will be used in the first time.\nMR/PR Scan: Scan the difference code between the source branch and the target branch of MR/PR. The source branch code needs to be pulled to the workspace\nFull Scan: Scan all codes. Klocwork, Pinpoint, Gometalinter, and repetition rate only support this scanning method." + }, + "mrCommentEnable": { + "label": "", + "default": true, + "type": "atom-checkbox", + "text": "Sync the defect info to Tencent internal Git viewing page" + }, + "newDefectJudgeFromDate": { + "default": "", + "label": "New Alerts Threshold", + "desc": "Alerts sent after the selected date are New Alerts" + }, + "transferAuthorList": { + "default": [], + "type": "author-transfer", + "label": "change owner", + "desc": "Alerts will sent to the new owner when the tools's ownership changed " + }, + "path": { + "default": [], + "type": "item-edit" + }, + "customPath": { + "default": [], + "type": "item-edit" + }, + "openScanPrj": { + "label": "", + "default": false, + "placeholder": "", + "type": "atom-checkbox", + "text": "use open sourced tool to scan project", + "desc": "Use open sourced scanning tool when selected", + "required": false, + "disabled": false, + "hidden": true + } + }, + "output": { + "BK_CI_CODECC_TASK_ID": { + "type": "string", + "description": "CodeCC task id" + }, + "BK_CI_CODECC_TASK_STATUS": { + "type": "string", + "description": "Whether the CodeCC task runs successfully" + } + }, + "releaseInfo": { + "projectId": "demo", + "name": "CodeCC Code Check", + "language": "java", + "logoUrl": "${{indexFile(\"images/logo.png\")}}", + "category": "TASK", + "classifyCode": "scm", + "jobType": "AGENT", + "os": ["LINUX", "MACOS", "WINDOWS"], + "labelCodes": [], + "summary":"Support all CodeCC code inspection tools under Linux, MacOS, and Windows systems, including code defects (bkcheck, etc.), security vulnerabilities (sensitive information, high-risk components, etc.), code specifications (CppLint, CheckStyle, etc.), cyclomatic complexity, repetition rate, etc. .", + "description": "${{indexFile(\"docs/aboutCodeCC_en.md\")}}", + "configInfo": { + "frontendType": "SPECIAL" + }, + "versionInfo": { + "publisher": "admin", + "releaseType": "NEW", + "version": "1.0.0", + "versionContent": "Test" + } + } +} \ No newline at end of file