This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 20139afe fix: delete some useless code (#3008)
20139afe is described below
commit 20139afef3c6ec9f3ebffcb06e243b145cbef8c6
Author: tsoc <[email protected]>
AuthorDate: Thu Sep 8 21:30:38 2022 +0800
fix: delete some useless code (#3008)
---
plugins/bitbucket/bitbucket.go | 25 +++----------------------
plugins/bitbucket/tasks/task_data.go | 27 ---------------------------
2 files changed, 3 insertions(+), 49 deletions(-)
diff --git a/plugins/bitbucket/bitbucket.go b/plugins/bitbucket/bitbucket.go
index d80dec18..f4a056a8 100644
--- a/plugins/bitbucket/bitbucket.go
+++ b/plugins/bitbucket/bitbucket.go
@@ -36,30 +36,11 @@ func main() {
_ = cmd.MarkFlagRequired("owner")
_ = cmd.MarkFlagRequired("repo")
- prType := cmd.Flags().String("prType", "type/(.*)$", "pr type")
- prComponent := cmd.Flags().String("prComponent", "component/(.*)$", "pr
component")
- prBodyClosePattern := cmd.Flags().String("prBodyClosePattern",
"(?mi)(fix|close|resolve|fixes|closes|resolves|fixed|closed|resolved)[\\s]*.*(((and
)?(#|https:\\/\\/api.bitbucket.org\\/2.0\\/%s\\/%s\\/issues\\/)\\d+[ ]*)+)",
"pr body close pattern")
- issueSeverity := cmd.Flags().String("issueSeverity", "severity/(.*)$",
"issue severity")
- issuePriority := cmd.Flags().String("issuePriority",
"^(highest|high|medium|low)$", "issue priority")
- issueComponent := cmd.Flags().String("issueComponent",
"component/(.*)$", "issue component")
- issueTypeBug := cmd.Flags().String("issueTypeBug",
"^(bug|failure|error)$", "issue type bug")
- issueTypeIncident := cmd.Flags().String("issueTypeIncident", "", "issue
type incident")
- issueTypeRequirement := cmd.Flags().String("issueTypeRequirement",
"^(feat|feature|proposal|requirement)$", "issue type requirement")
-
cmd.Run = func(cmd *cobra.Command, args []string) {
runner.DirectRun(cmd, args, PluginEntry, map[string]interface{}{
- "connectionId": *connectionId,
- "owner": *owner,
- "repo": *repo,
- "prType": *prType,
- "prComponent": *prComponent,
- "prBodyClosePattern": *prBodyClosePattern,
- "issueSeverity": *issueSeverity,
- "issuePriority": *issuePriority,
- "issueComponent": *issueComponent,
- "issueTypeBug": *issueTypeBug,
- "issueTypeIncident": *issueTypeIncident,
- "issueTypeRequirement": *issueTypeRequirement,
+ "connectionId": *connectionId,
+ "owner": *owner,
+ "repo": *repo,
})
}
runner.RunCmd(cmd)
diff --git a/plugins/bitbucket/tasks/task_data.go
b/plugins/bitbucket/tasks/task_data.go
index f1aae65b..157ad682 100644
--- a/plugins/bitbucket/tasks/task_data.go
+++ b/plugins/bitbucket/tasks/task_data.go
@@ -54,33 +54,6 @@ func DecodeAndValidateTaskOptions(options
map[string]interface{}) (*BitbucketOpt
if op.Repo == "" {
return nil, errors.Default.New("repo is required for Bitbucket
execution")
}
- if op.PrType == "" {
- op.PrType = "type/(.*)$"
- }
- if op.PrComponent == "" {
- op.PrComponent = "component/(.*)$"
- }
- if op.PrBodyClosePattern == "" {
- op.PrBodyClosePattern =
"(?mi)(fix|close|resolve|fixes|closes|resolves|fixed|closed|resolved)[\\s]*.*(((and
)?(#|https:\\/\\/api.bitbucket.org\\/2.0\\/%s\\/%s\\/issues\\/)\\d+[ ]*)+)"
- }
- if op.IssueSeverity == "" {
- op.IssueSeverity = "severity/(.*)$"
- }
- if op.IssuePriority == "" {
- op.IssuePriority = "^(highest|high|medium|low)$"
- }
- if op.IssueComponent == "" {
- op.IssueComponent = "component/(.*)$"
- }
- if op.IssueTypeBug == "" {
- op.IssueTypeBug = "^(bug|failure|error)$"
- }
- if op.IssueTypeIncident == "" {
- op.IssueTypeIncident = ""
- }
- if op.IssueTypeRequirement == "" {
- op.IssueTypeRequirement =
"^(feat|feature|proposal|requirement)$"
- }
// find the needed Bitbucket now
if op.ConnectionId == 0 {