From 5ab84bb65c90461889b728057dcc4ea2dcc4cd8a Mon Sep 17 00:00:00 2001 From: hejieehe <904696180@qq.com> Date: Tue, 8 Oct 2024 10:45:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat=EF=BC=9A=E5=B7=A5=E8=9C=82=20MR=20?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E5=A2=9E=E5=8A=A0=20action=3Dedit=20#11024?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/webhook/enums/code/tgit/TGitMrEventAction.kt | 5 +++-- .../sql/5001_init_dml/5001_ci_store-init_dml_mysql.sql | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/enums/code/tgit/TGitMrEventAction.kt b/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/enums/code/tgit/TGitMrEventAction.kt index fa3abd648c6..7d579b1d0d8 100644 --- a/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/enums/code/tgit/TGitMrEventAction.kt +++ b/src/backend/ci/core/common/common-webhook/api-common-webhook/src/main/kotlin/com/tencent/devops/common/webhook/enums/code/tgit/TGitMrEventAction.kt @@ -39,7 +39,8 @@ enum class TGitMrEventAction(val value: String) { CLOSE("close"), REOPEN("reopen"), PUSH_UPDATE("push-update"), - MERGE("merge"); + MERGE("merge"), + EDIT("edit"); companion object { fun getActionValue(event: GitMergeRequestEvent): String? { @@ -51,7 +52,7 @@ enum class TGitMrEventAction(val value: String) { if (event.object_attributes.extension_action == TGitMergeExtensionActionKind.PUSH_UPDATE.value) { PUSH_UPDATE.value } else { - null + EDIT.value } } TGitMergeActionKind.MERGE.value -> MERGE.value diff --git a/support-files/sql/5001_init_dml/5001_ci_store-init_dml_mysql.sql b/support-files/sql/5001_init_dml/5001_ci_store-init_dml_mysql.sql index 3300592451b..8337aa9505d 100755 --- a/support-files/sql/5001_init_dml/5001_ci_store-init_dml_mysql.sql +++ b/support-files/sql/5001_init_dml/5001_ci_store-init_dml_mysql.sql @@ -24,7 +24,7 @@ REPLACE INTO `T_ATOM` (`ID`, `NAME`, `ATOM_CODE`, `CLASS_TYPE`, `SERVICE_SCOPE`, REPLACE INTO `T_ATOM` (`ID`, `NAME`, `ATOM_CODE`, `CLASS_TYPE`, `SERVICE_SCOPE`, `JOB_TYPE`, `OS`, `CLASSIFY_ID`, `DOCS_LINK`, `ATOM_TYPE`, `ATOM_STATUS`, `ATOM_STATUS_MSG`, `SUMMARY`, `DESCRIPTION`, `CATEGROY`, `VERSION`, `LOGO_URL`, `ICON`, `DEFAULT_FLAG`, `LATEST_FLAG`, `BUILD_LESS_RUN_FLAG`, `REPOSITORY_HASH_ID`, `CODE_SRC`, `PAY_FLAG`, `HTML_TEMPLATE_VERSION`, `PROPS`, `DATA`, `PUBLISHER`, `WEIGHT`, `CREATOR`, `MODIFIER`, `CREATE_TIME`, `UPDATE_TIME`, `VISIBILITY_LEVEL`) VALUES ('24425d3fa0b645dc8ab23013e9f1df5e','TGit','codeTGitWebHookTrigger','codeTGitWebHookTrigger','[ \"pipeline\" ]','AGENT','[ \"LINUX\", \"MACOS\", \"WINDOWS\" ]','e1bea5430f574f9ea3e0312dc7de9efa','',0,7,NULL,'Start the pipeline when listening to related events of the TGit repository','Start the pipeline when listening to related events of the TGit repository',0,'1.0.0','/ms/artifactory/api/user/artifactories/file/download?filePath=%2Ffile%2Fpng%2FtgitTrigger.png&logo=true',NULL,b'1',b'0',b'0',NULL,NULL,b'0','1.1','{ "input": { "repositoryType": { "rule": {}, "component": "conditional-input-selector", "required": true, "label": "Repository", "list": [ { "value": "ID", "label": "ID", "key": "repositoryHashId", "rule": {}, "hasAddItem": true, "type": "request-selector", "searchable": true, "placeholder": "Select by repository ID", "required": true, "default": "", "url": "/repository/api/user/repositories/{projectId}/hasPermissionList?permission=USE&repositoryType=CODE_TGIT&page=1&pageSize=1000", "paramId": "repositoryHashId", "paramName": "aliasName", "tools": { "edit": true, "del": false } }, { "value": "NAME", "label": "NAME", "key": "repositoryName", "rule": {}, "type": "vuex-input", "required": true, "hidden": true, "placeholder": "Please select a repository name", "default": "" } ], "default": "ID", "desc": "" }, "eventType": { "rule": {}, "required": false, "component": "enum-input", "type": "enum-input", "label": "Event Type", "list": [ { "label": "Commit Push Hook", "value": "PUSH" }, { "label": "Tag Push Hook", "value": "TAG_PUSH" }, { "label": "Merge Request Hook", "value": "MERGE_REQUEST" }, { "label": "Merge Request Accept Hook", "value": "MERGE_REQUEST_ACCEPT" }, { "label": "Issue Hook", "value": "ISSUES" }, { "label": "Note Hook", "value": "NOTE" } ], "default": "PUSH" }, "branchSettings": { "type": "group", "label": "Branch", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" }, { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "MERGE_REQUEST_ACCEPT" } ] }, "children": [ { "key": "branchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Listen to the following target branches", "placeholder": "The default is all branches, and multiple branches should be separated by commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" } ] } }, { "key": "excludeBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Exclude the following target branches", "placeholder": "Multiple branches should be separated by commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" } ] } }, { "key": "branchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Listen to the following target branches", "labelWidth": "105", "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "MERGE_REQUEST_ACCEPT" } ] } }, { "key": "excludeBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Exclude the following target branches", "labelWidth": "105", "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "MERGE_REQUEST_ACCEPT" } ] } }, { "key": "includeSourceBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Listen to the following source branches", "labelWidth": 105, "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "MERGE_REQUEST_ACCEPT" } ] } }, { "key": "excludeSourceBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Exclude the following source branches", "labelWidth": 105, "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "MERGE_REQUEST_ACCEPT" } ] } } ] }, "tagSettings": { "type": "group", "label": "Tag", "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "TAG_PUSH" } ] }, "children": [ { "rule": {}, "key": "tagName", "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Listen to the following tags", "placeholder": "The default is all tags, and multiple tags should be separated by commas", "default": "" }, { "rule": {}, "key": "excludeTagName", "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Exclude the following tags", "placeholder": "Multiple tags should be separated by commas", "default": "" } ] }, "fromBranches": { "rule": {}, "type": "vuex-input", "required": false, "component": "vuex-input", "label": "Listen to the following source branches", "desc": "Tags created by the Git client do not contain information about the branch they were created from. In this case, tags created cannot be used to listen to the target branch", "placeholder": "Multiple branches should be separated by commas", "default": "", "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "TAG_PUSH" } ] } }, "pathSettings": { "type": "group", "label": "Path", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" }, { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "MERGE_REQUEST_ACCEPT" } ] }, "children": [ { "key": "pathFilterType", "rule": {}, "type": "groupItem", "component": "enum-button", "required": true, "list": [ { "value": "NamePrefixFilter", "label": "Matching by Path Prefix" }, { "value": "RegexBasedFilter", "label": "Matching by Wildcard" } ], "default": "NamePrefixFilter", "desc": "" }, { "key": "includePaths", "rule": {}, "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Listen to the following paths", "placeholder": "Separate multiple paths with commas", "default": "" }, { "key": "excludePaths", "rule": {}, "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Exclude the following paths", "placeholder": "Separate multiple paths with commas", "default": "" } ] }, "userSettings": { "type": "group", "label": "User", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" }, { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "MERGE_REQUEST_ACCEPT" }, { "key": "eventType", "value": "TAG_PUSH" } ] }, "children": [ { "key": "includeUsers", "type": "groupItem", "rule": {}, "component": "staff-input", "required": false, "multiSelect": true, "prependText": "Includes following people", "desc": "", "default": [] }, { "key": "excludeUsers", "type": "groupItem", "rule": {}, "component": "staff-input", "required": false, "multiSelect": true, "prependText": "Exclude the following people", "desc": "", "default": [] } ] }, "enableCheck": { "rule": {}, "type": "atom-checkbox", "component": "atom-checkbox", "required": false, "text": "Write commit check", "desc": "", "default": true, "hidden": false, "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "MERGE_REQUEST_ACCEPT" }, { "key": "eventType", "value": "PUSH" } ] } }, "block": { "rule": {}, "type": "atom-checkbox", "component": "atom-checkbox", "required": false, "text": "Lock Commit", "default": false, "hidden": false, "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "enableCheck", "value": true } ] } }, "skipWip": { "rule": {}, "type": "boolean", "component": "atom-checkbox", "required": false, "text": "Skip wip", "desc": "If checked, then check if the title contains the keyword \"WIP\" or \"[WIP]\". If it does, do not trigger", "default": false, "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, "includeNoteTypes": { "label": "Listening to the following types of comments", "component": "atom-checkbox-list", "multiSelect": true, "list": [ { "id": "Commit", "name": "Providing comments on commit" }, { "id": "Review", "name": "Providing comments on reviews" }, { "id": "Issue", "name": "Providing comments on issue" } ], "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "NOTE" } ] } }, "includeNoteComment": { "rule": {}, "type": "vuex-input", "required": false, "component": "vuex-textarea", "label": "Listening to the following comment", "desc": "", "placeholder": "Separate multiple comments with commas", "default": "", "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "NOTE" } ] } }, "includeIssueAction": { "label": "Listen to the following action", "component": "atom-checkbox-list", "list": [ { "id": "open", "name": "open" }, { "id": "close", "name": "close" }, { "id": "reopen", "name": "reopen" }, { "id": "update", "name": "update" } ], "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "ISSUES" } ] } } } }','{}','BlueKing','2','system','system','2020-08-29 12:18:20','2020-09-03 10:43:18', 0); REPLACE INTO `T_ATOM` (`ID`, `NAME`, `ATOM_CODE`, `CLASS_TYPE`, `SERVICE_SCOPE`, `JOB_TYPE`, `OS`, `CLASSIFY_ID`, `DOCS_LINK`, `ATOM_TYPE`, `ATOM_STATUS`, `ATOM_STATUS_MSG`, `SUMMARY`, `DESCRIPTION`, `CATEGROY`, `VERSION`, `LOGO_URL`, `ICON`, `DEFAULT_FLAG`, `LATEST_FLAG`, `BUILD_LESS_RUN_FLAG`, `REPOSITORY_HASH_ID`, `CODE_SRC`, `PAY_FLAG`, `HTML_TEMPLATE_VERSION`, `PROPS`, `DATA`, `PUBLISHER`, `WEIGHT`, `CREATOR`, `MODIFIER`, `CREATE_TIME`, `UPDATE_TIME`, `VISIBILITY_LEVEL`) VALUES - ('b7373cdb56ec4a779488f30e26c96208','TGit','codeTGitWebHookTrigger','codeTGitWebHookTrigger','[ \"pipeline\" ]','AGENT','[ \"LINUX\", \"MACOS\", \"WINDOWS\" ]','e1bea5430f574f9ea3e0312dc7de9efa','',0,7,NULL,'Start the pipeline when listening to related events of the TGit repository','Start the pipeline when listening to related events of the TGit repository',0,'2.0.0','/ms/artifactory/api/user/artifactories/file/download?filePath=%2Ffile%2Fpng%2FtgitTrigger.png&logo=true',NULL,b'1',b'1',b'0',NULL,NULL,b'0','1.1','{ "input": { "tips": { "label": "", "type": "tips-simple", "tipStr": "The event type \"Merge Request Accept\" has been adjusted to the action \"merged\" corresponding to the \"Merge Request\" event" }, "repositoryType": { "rule": {}, "component": "conditional-input-selector", "required": true, "label": "Repository", "list": [ { "value": "ID", "label": "ID", "key": "repositoryHashId", "rule": {}, "hasAddItem": true, "type": "request-selector", "searchable": true, "placeholder": "Select by repository ID", "required": true, "default": "", "url": "/repository/api/user/repositories/{projectId}/hasPermissionList?permission=USE&repositoryType=CODE_TGIT&page=1&pageSize=1000", "paramId": "repositoryHashId", "paramName": "aliasName", "tools": { "edit": true, "del": false } }, { "value": "NAME", "label": "NAME", "key": "repositoryName", "rule": {}, "type": "vuex-input", "required": true, "hidden": true, "placeholder": "Please select a repository name", "default": "" } ], "default": "ID", "desc": "" }, "eventType": { "rule": {}, "required": false, "component": "enum-input", "type": "enum-input", "label": "Event Type", "list": [ { "label": "Push", "value": "PUSH" }, { "label": "Tag", "value": "TAG_PUSH" }, { "label": "Merge Request", "value": "MERGE_REQUEST" }, { "label": "Issue", "value": "ISSUES" }, { "label": "Note", "value": "NOTE" } ], "default": "PUSH" }, "includePushAction": { "label": "Action", "bottomDivider": true, "component": "atom-checkbox-list", "multiSelect": true, "list": [ { "id": "push-file", "name": "Modify File" }, { "id": "new-branch", "name": "Create Branch" } ], "default": [ "push-file", "new-branch" ], "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "PUSH" } ] } }, "includeMrAction": { "label": "Action", "component": "atom-checkbox-list", "required": true, "list": [ { "id": "open", "name": "Created" }, { "id": "close", "name": "Closed" }, { "id": "reopen", "name": "Reopened" }, { "id": "push-update", "name": "Push-Updated" }, { "id": "merge", "name": "Merged" } ], "default": [ "open", "reopen", "push-update" ], "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, "branchSettings": { "type": "group", "label": "Branch", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" }, { "key": "eventType", "value": "MERGE_REQUEST" } ] }, "children": [ { "key": "branchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Listen to the following target branches", "placeholder": "The default is all branches, and multiple branches should be separated by commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" } ] } }, { "key": "excludeBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Exclude the following target branches", "placeholder": "Multiple branches should be separated by commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" } ] } }, { "key": "branchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Listen to the following target branches", "labelWidth": "105", "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, { "key": "excludeBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Exclude the following target branches", "labelWidth": "105", "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, { "key": "includeSourceBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Listen to the following source branches", "labelWidth": 105, "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, { "key": "excludeSourceBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Exclude the following source branches", "labelWidth": 105, "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } } ] }, "tagSettings": { "type": "group", "label": "Tag", "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "TAG_PUSH" } ] }, "children": [ { "rule": {}, "key": "tagName", "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Listen to the following tags", "placeholder": "The default is all tags, and multiple tags should be separated by commas", "default": "" }, { "rule": {}, "key": "excludeTagName", "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Exclude the following tags", "placeholder": "Multiple tags should be separated by commas", "default": "" } ] }, "fromBranches": { "rule": {}, "type": "vuex-input", "required": false, "component": "vuex-input", "label": "Listen to the following source branches", "desc": "Tags created by the Git client do not contain information about the branch they were created from. In this case, tags created cannot be used to listen to the target branch", "placeholder": "Multiple branches should be separated by commas", "default": "", "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "TAG_PUSH" } ] } }, "pathSettings": { "type": "group", "label": "Path", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" }, { "key": "eventType", "value": "MERGE_REQUEST" } ] }, "children": [ { "key": "pathFilterType", "rule": {}, "type": "groupItem", "component": "enum-button", "required": true, "list": [ { "value": "NamePrefixFilter", "label": "Matching by Path Prefix" }, { "value": "RegexBasedFilter", "label": "Matching by Wildcard" } ], "default": "NamePrefixFilter", "desc": "" }, { "key": "includePaths", "rule": {}, "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Listen to the following paths", "placeholder": "Separate multiple paths with commas", "default": "" }, { "key": "excludePaths", "rule": {}, "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Exclude the following paths", "placeholder": "Separate multiple paths with commas", "default": "" } ] }, "userSettings": { "type": "group", "label": "User", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" }, { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "TAG_PUSH" } ] }, "children": [ { "key": "includeUsers", "type": "groupItem", "rule": {}, "component": "staff-input", "required": false, "multiSelect": true, "prependText": "Includes following people", "desc": "", "default": [] }, { "key": "excludeUsers", "type": "groupItem", "rule": {}, "component": "staff-input", "required": false, "multiSelect": true, "prependText": "Exclude the following people", "desc": "", "default": [] } ] }, "enableCheck": { "rule": {}, "type": "atom-checkbox", "component": "atom-checkbox", "required": false, "text": "Write commit check", "desc": "", "default": true, "hidden": false, "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "PUSH" } ] } }, "block": { "rule": {}, "type": "atom-checkbox", "component": "atom-checkbox", "required": false, "text": "Lock Commit", "default": false, "hidden": false, "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "enableCheck", "value": true } ] } }, "skipWip": { "rule": {}, "type": "boolean", "component": "atom-checkbox", "required": false, "text": "Skip wip", "desc": "If checked, then check if the title contains the keyword \"WIP\" or \"[WIP]\". If it does, do not trigger", "default": false, "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, "includeNoteTypes": { "label": "Listening to the following types of comments", "component": "atom-checkbox-list", "multiSelect": true, "list": [ { "id": "Commit", "name": "Providing comments on commit" }, { "id": "Review", "name": "Providing comments on reviews" }, { "id": "Issue", "name": "Providing comments on issue" } ], "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "NOTE" } ] } }, "includeNoteComment": { "rule": {}, "type": "vuex-input", "required": false, "component": "vuex-textarea", "label": "Listening to the following comment", "desc": "", "placeholder": "Separate multiple comments with commas", "default": "", "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "NOTE" } ] } }, "includeIssueAction": { "label": "Listen to the following action", "component": "atom-checkbox-list", "list": [ { "id": "open", "name": "open" }, { "id": "close", "name": "close" }, { "id": "reopen", "name": "reopen" }, { "id": "update", "name": "update" } ], "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "ISSUES" } ] } } } }','{}','BlueKing','2','system','system','2024-05-09 12:00:00','2024-05-09 12:00:00', 0); + ('b7373cdb56ec4a779488f30e26c96208','TGit','codeTGitWebHookTrigger','codeTGitWebHookTrigger','[ \"pipeline\" ]','AGENT','[ \"LINUX\", \"MACOS\", \"WINDOWS\" ]','e1bea5430f574f9ea3e0312dc7de9efa','',0,7,NULL,'Start the pipeline when listening to related events of the TGit repository','Start the pipeline when listening to related events of the TGit repository',0,'2.0.0','/ms/artifactory/api/user/artifactories/file/download?filePath=%2Ffile%2Fpng%2FtgitTrigger.png&logo=true',NULL,b'1',b'1',b'0',NULL,NULL,b'0','1.1','{ "input": { "tips": { "label": "", "type": "tips-simple", "tipStr": "The event type \"Merge Request Accept\" has been adjusted to the action \"merged\" corresponding to the \"Merge Request\" event" }, "repositoryType": { "rule": {}, "component": "conditional-input-selector", "required": true, "label": "Repository", "list": [ { "value": "ID", "label": "ID", "key": "repositoryHashId", "rule": {}, "hasAddItem": true, "type": "request-selector", "searchable": true, "placeholder": "Select by repository ID", "required": true, "default": "", "url": "/repository/api/user/repositories/{projectId}/hasPermissionList?permission=USE&repositoryType=CODE_TGIT&page=1&pageSize=1000", "paramId": "repositoryHashId", "paramName": "aliasName", "tools": { "edit": true, "del": false } }, { "value": "NAME", "label": "NAME", "key": "repositoryName", "rule": {}, "type": "vuex-input", "required": true, "hidden": true, "placeholder": "Please select a repository name", "default": "" } ], "default": "ID", "desc": "" }, "eventType": { "rule": {}, "required": false, "component": "enum-input", "type": "enum-input", "label": "Event Type", "list": [ { "label": "Push", "value": "PUSH" }, { "label": "Tag", "value": "TAG_PUSH" }, { "label": "Merge Request", "value": "MERGE_REQUEST" }, { "label": "Issue", "value": "ISSUES" }, { "label": "Note", "value": "NOTE" } ], "default": "PUSH" }, "includePushAction": { "label": "Action", "bottomDivider": true, "component": "atom-checkbox-list", "multiSelect": true, "list": [ { "id": "push-file", "name": "Modify File" }, { "id": "new-branch", "name": "Create Branch" } ], "default": [ "push-file", "new-branch" ], "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "PUSH" } ] } }, "includeMrAction": { "label": "Action", "component": "atom-checkbox-list", "required": true, "list": [ { "id": "open", "name": "Created" }, { "id": "close", "name": "Closed" }, { "id": "reopen", "name": "Reopened" }, { "id": "push-update", "name": "Push-Updated" }, { "id": "merge", "name": "Merged" }, { "id": "edit", "name": "Edited" } ], "default": [ "open", "reopen", "push-update" ], "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, "branchSettings": { "type": "group", "label": "Branch", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" }, { "key": "eventType", "value": "MERGE_REQUEST" } ] }, "children": [ { "key": "branchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Listen to the following target branches", "placeholder": "The default is all branches, and multiple branches should be separated by commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" } ] } }, { "key": "excludeBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Exclude the following target branches", "placeholder": "Multiple branches should be separated by commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" } ] } }, { "key": "branchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Listen to the following target branches", "labelWidth": "105", "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, { "key": "excludeBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Exclude the following target branches", "labelWidth": "105", "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, { "key": "includeSourceBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Listen to the following source branches", "labelWidth": 105, "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, { "key": "excludeSourceBranchName", "type": "groupItem", "rule": {}, "required": false, "component": "composite-input", "prependText": "Exclude the following source branches", "labelWidth": 105, "placeholder": "Separate multiple paths with commas", "default": "", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } } ] }, "tagSettings": { "type": "group", "label": "Tag", "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "TAG_PUSH" } ] }, "children": [ { "rule": {}, "key": "tagName", "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Listen to the following tags", "placeholder": "The default is all tags, and multiple tags should be separated by commas", "default": "" }, { "rule": {}, "key": "excludeTagName", "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Exclude the following tags", "placeholder": "Multiple tags should be separated by commas", "default": "" } ] }, "fromBranches": { "rule": {}, "type": "vuex-input", "required": false, "component": "vuex-input", "label": "Listen to the following source branches", "desc": "Tags created by the Git client do not contain information about the branch they were created from. In this case, tags created cannot be used to listen to the target branch", "placeholder": "Multiple branches should be separated by commas", "default": "", "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "TAG_PUSH" } ] } }, "pathSettings": { "type": "group", "label": "Path", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" }, { "key": "eventType", "value": "MERGE_REQUEST" } ] }, "children": [ { "key": "pathFilterType", "rule": {}, "type": "groupItem", "component": "enum-button", "required": true, "list": [ { "value": "NamePrefixFilter", "label": "Matching by Path Prefix" }, { "value": "RegexBasedFilter", "label": "Matching by Wildcard" } ], "default": "NamePrefixFilter", "desc": "" }, { "key": "includePaths", "rule": {}, "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Listen to the following paths", "placeholder": "Separate multiple paths with commas", "default": "" }, { "key": "excludePaths", "rule": {}, "type": "groupItem", "required": false, "component": "composite-input", "prependText": "Exclude the following paths", "placeholder": "Separate multiple paths with commas", "default": "" } ] }, "userSettings": { "type": "group", "label": "User", "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "PUSH" }, { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "TAG_PUSH" } ] }, "children": [ { "key": "includeUsers", "type": "groupItem", "rule": {}, "component": "staff-input", "required": false, "multiSelect": true, "prependText": "Includes following people", "desc": "", "default": [] }, { "key": "excludeUsers", "type": "groupItem", "rule": {}, "component": "staff-input", "required": false, "multiSelect": true, "prependText": "Exclude the following people", "desc": "", "default": [] } ] }, "enableCheck": { "rule": {}, "type": "atom-checkbox", "component": "atom-checkbox", "required": false, "text": "Write commit check", "desc": "", "default": true, "hidden": false, "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "eventType", "value": "PUSH" } ] } }, "block": { "rule": {}, "type": "atom-checkbox", "component": "atom-checkbox", "required": false, "text": "Lock Commit", "default": false, "hidden": false, "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" }, { "key": "enableCheck", "value": true } ] } }, "skipWip": { "rule": {}, "type": "boolean", "component": "atom-checkbox", "required": false, "text": "Skip wip", "desc": "If checked, then check if the title contains the keyword \"WIP\" or \"[WIP]\". If it does, do not trigger", "default": false, "rely": { "operation": "OR", "expression": [ { "key": "eventType", "value": "MERGE_REQUEST" } ] } }, "includeNoteTypes": { "label": "Listening to the following types of comments", "component": "atom-checkbox-list", "multiSelect": true, "list": [ { "id": "Commit", "name": "Providing comments on commit" }, { "id": "Review", "name": "Providing comments on reviews" }, { "id": "Issue", "name": "Providing comments on issue" } ], "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "NOTE" } ] } }, "includeNoteComment": { "rule": {}, "type": "vuex-input", "required": false, "component": "vuex-textarea", "label": "Listening to the following comment", "desc": "", "placeholder": "Separate multiple comments with commas", "default": "", "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "NOTE" } ] } }, "includeIssueAction": { "label": "Listen to the following action", "component": "atom-checkbox-list", "list": [ { "id": "open", "name": "open" }, { "id": "close", "name": "close" }, { "id": "reopen", "name": "reopen" }, { "id": "update", "name": "update" } ], "rely": { "operation": "AND", "expression": [ { "key": "eventType", "value": "ISSUES" } ] } } } }','{}','BlueKing','2','system','system','2024-05-09 12:00:00','2024-05-09 12:00:00', 0); REPLACE INTO `T_ATOM` (`ID`, `NAME`, `ATOM_CODE`, `CLASS_TYPE`, `SERVICE_SCOPE`, `JOB_TYPE`, `OS`, `CLASSIFY_ID`, `DOCS_LINK`, `ATOM_TYPE`, `ATOM_STATUS`, `ATOM_STATUS_MSG`, `SUMMARY`, `DESCRIPTION`, `CATEGROY`, `VERSION`, `LOGO_URL`, `ICON`, `DEFAULT_FLAG`, `LATEST_FLAG`, `BUILD_LESS_RUN_FLAG`, `REPOSITORY_HASH_ID`, `CODE_SRC`, `PAY_FLAG`, `HTML_TEMPLATE_VERSION`, `PROPS`, `DATA`, `PUBLISHER`, `WEIGHT`, `CREATOR`, `MODIFIER`, `CREATE_TIME`, `UPDATE_TIME`, `VISIBILITY_LEVEL`) VALUES ('39580f08e9574fc291cdd8c51f39ddee','P4','codeP4WebHookTrigger','codeP4WebHookTrigger','[ \"pipeline\" ]','AGENT','[ \"LINUX\", \"MACOS\", \"WINDOWS\" ]','e1bea5430f574f9ea3e0312dc7de9efa','',0,7,NULL,'Start the pipeline when listening to related events of the Perforce repository',' start the pipeline when listening to related events of the Perforce repository',0,'1.0.0','/ms/artifactory/api/user/artifactories/file/download?filePath=%2Ffile%2Fpng%2Fp4Trigger.png&logo=true',NULL,b'1',b'0',b'0',NULL,NULL,b'0','1.1','{"input":{"notice":{"label":"","type":"tips","tipStr":"1. The trigger will create a devops_trigger depot in the repository
2. To create a trigger, the credentials associated with the repository must have administrator privileges
3. Deleting the trigger plugin will not delete the server-side trigger, you need to delete it manually
"},"repositoryType":{"rule":{},"type":"enum-input","required":true,"label":"Repository","list":[{"value":"ID","label":"Select by repository ID"},{"value":"NAME","label":"Enter by repository alias"}],"default":"ID","desc":""},"repositoryHashId":{"rule":{},"label":"","hasAddItem":true,"type":"request-selector","searchable":true,"placeholder":"Please select a repository name","required":true,"default":"","url":"/repository/api/user/repositories/{projectId}/hasPermissionList?permission=USE&repositoryType=CODE_P4&page=1&pageSize=100","paramId":"repositoryHashId","paramName":"aliasName","tools":{"edit":true,"del":false},"rely":{"operation":"OR","expression":[{"key":"repositoryType","value":"ID"}]}},"repositoryName":{"rule":{},"type":"vuex-input","required":true,"label":"","placeholder":"请Enter a repository alias","default":"","rely":{"operation":"AND","expression":[{"key":"repositoryType","value":"NAME"}]}},"eventType":{"rule":{},"required":false,"type":"enum-input","label":"Event Type","list":[{"label":"change commit","value":"CHANGE_COMMIT"},{"label":"change content","value":"CHANGE_CONTENT"},{"label":"change submit","value":"CHANGE_SUBMIT"},{"label":"shelve commit","value":"SHELVE_COMMIT"},{"label":"shelve submit","value":"SHELVE_SUBMIT"}],"default":"CHANGE_COMMIT"},"noticePath":{"label":"","type":"tips","tipStr":"The Perforce path matching starts from the depot path. For example, if there is a demo depot, the configuration rules are as follows:
1. Listen to the aaa stream under //demo, //demo/aaa/**
2. Listen to //demo The java file under, //demo/*.java"},"includePaths":{"rule":{},"required":true,"type":"vuex-input","label":"Listen to the following paths","placeholder":"Separate multiple paths with commas","default":""},"excludePaths":{"rule":{},"required":false,"type":"vuex-input","label":"Exclude the following paths","placeholder":"Separate multiple paths with commas","default":""}}}','{}','BlueKing','2','system','system','2021-11-16 12:18:20','2021-11-16 12:18:20', 0); REPLACE INTO `T_ATOM` (`ID`, `NAME`, `ATOM_CODE`, `CLASS_TYPE`, `SERVICE_SCOPE`, `JOB_TYPE`, `OS`, `CLASSIFY_ID`, `DOCS_LINK`, `ATOM_TYPE`, `ATOM_STATUS`, `ATOM_STATUS_MSG`, `SUMMARY`, `DESCRIPTION`, `CATEGROY`, `VERSION`, `LOGO_URL`, `ICON`, `DEFAULT_FLAG`, `LATEST_FLAG`, `BUILD_LESS_RUN_FLAG`, `REPOSITORY_HASH_ID`, `CODE_SRC`, `PAY_FLAG`, `HTML_TEMPLATE_VERSION`, `PROPS`, `DATA`, `PUBLISHER`, `WEIGHT`, `CREATOR`, `MODIFIER`, `CREATE_TIME`, `UPDATE_TIME`, `VISIBILITY_LEVEL`) VALUES From 56dc96ceca3d14b72e2918af54d9983e6f72f682 Mon Sep 17 00:00:00 2001 From: hejieehe <904696180@qq.com> Date: Tue, 8 Oct 2024 11:22:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?feat=EF=BC=9A=E5=B7=A5=E8=9C=82=20MR=20?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=E5=A2=9E=E5=8A=A0=20action=3Dedit=20#11024?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/schema/V3_0/ci.json | 4 ++-- support-files/i18n/process/message_en_US.properties | 2 +- support-files/i18n/process/message_zh_CN.properties | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend/ci/core/common/common-pipeline-yaml/src/main/resources/schema/V3_0/ci.json b/src/backend/ci/core/common/common-pipeline-yaml/src/main/resources/schema/V3_0/ci.json index 9b985d281e1..3497a7f3d08 100644 --- a/src/backend/ci/core/common/common-pipeline-yaml/src/main/resources/schema/V3_0/ci.json +++ b/src/backend/ci/core/common/common-pipeline-yaml/src/main/resources/schema/V3_0/ci.json @@ -213,7 +213,7 @@ "type" : "array", "uniqueItems" : true, "items" : { - "enum" : [ "open", "close", "reopen", "push-update", "merge" ] + "enum" : [ "open", "close", "reopen", "push-update", "merge", "edit" ] }, "additionalItems" : false }, @@ -904,7 +904,7 @@ "type" : "array", "uniqueItems" : true, "items" : { - "enum" : [ "open", "close", "reopen", "push-update", "merge" ] + "enum" : [ "open", "close", "reopen", "push-update", "merge", "edit" ] }, "additionalItems" : false }, diff --git a/support-files/i18n/process/message_en_US.properties b/support-files/i18n/process/message_en_US.properties index 49f3c01cf90..263a23a36f2 100644 --- a/support-files/i18n/process/message_en_US.properties +++ b/support-files/i18n/process/message_en_US.properties @@ -442,7 +442,7 @@ bkTgitIssueUpdatedEventDesc=Issue [!{1}] updat bkTgitIssueClosedEventDesc=Issue [!{1}] closed by {2} bkTgitIssueReopenedEventDesc=Issue [!{1}] reopened by {2} bkTgitMrCreatedEventDesc=Merge requests [!{1}] opened by {2} -bkTgitMrUpdatedEventDesc=Merge requests [!{1}] updated by {2} +bkTgitMrUpdatedEventDesc=Merge requests [!{1}] edited by {2} bkTgitMrClosedEventDesc=Merge requests [!{1}] closed by {2} bkTgitMrReopenedEventDesc=Merge requests [!{1}] reopened by {2} bkTgitMrPushUpdatedEventDesc=Merge requests [!{1}] push updated by {2} diff --git a/support-files/i18n/process/message_zh_CN.properties b/support-files/i18n/process/message_zh_CN.properties index 2acaf0e63ac..e69439601f7 100644 --- a/support-files/i18n/process/message_zh_CN.properties +++ b/support-files/i18n/process/message_zh_CN.properties @@ -442,7 +442,7 @@ bkTgitIssueUpdatedEventDesc=议题 [!{1}] 由 bkTgitIssueClosedEventDesc=议题 [!{1}] 由 {2} 关闭 bkTgitIssueReopenedEventDesc=议题 [!{1}] 由 {2} 重新打开 bkTgitMrCreatedEventDesc=合并请求 [!{1}] 由 {2} 创建 -bkTgitMrUpdatedEventDesc=合并请求 [!{1}] 由 {2} 更新 +bkTgitMrUpdatedEventDesc=合并请求 [!{1}] 由 {2} 编辑 bkTgitMrClosedEventDesc=合并请求 [!{1}] 由 {2} 关闭 bkTgitMrReopenedEventDesc=合并请求 [!{1}] 由 {2} 重新打开 bkTgitMrPushUpdatedEventDesc=合并请求 [!{1}] 由 {2} 在源分支提交代码触发