You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by GitBox <gi...@apache.org> on 2022/06/14 05:04:58 UTC

[GitHub] [incubator-devlake] narrowizard opened a new pull request, #2182: feat: collect jira status

narrowizard opened a new pull request, #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182

   # Summary
   
   <!--
   Thanks for submitting a pull request!
   
   We appreciate you spending the time to work on these changes.
   Please fill out as many sections below as possible.
   -->
   
   ### Does this close any open issues?
   closes #2181 
   
   ### Screenshots
   Include any relevant screenshots here.
   
   ### Other Information
   Any other information that is important to this PR.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896823905


##########
plugins/jira/models/connection.go:
##########
@@ -45,19 +45,27 @@ type JiraConnection struct {
 	RemotelinkCommitShaPattern string `gorm:"type:varchar(255);comment='golang regexp, the first group will be recognized as commit sha, ref https://github.com/google/re2/wiki/Syntax'" json:"remotelinkCommitShaPattern"`
 }
 
+func (JiraConnection) TableName() string {
+	return "_tool_jira_connections"
+}
+
 type JiraIssueTypeMapping struct {
 	ConnectionID uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType     string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	StandardType string `gorm:"type:varchar(50)" json:"standardType" validate:"required"`
 }
 
+func (JiraIssueTypeMapping) TableName() string {
+	return "_tool_jira_issue_type_mappings"
+}
+
 type JiraIssueStatusMapping struct {
 	ConnectionID   uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType       string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	UserStatus     string `gorm:"type:varchar(50);primaryKey" json:"userStatus" validate:"required"`
 	StandardStatus string `gorm:"type:varchar(50)" json:"standardStatus" validate:"required"`
 }
 
-func (JiraConnection) TableName() string {
-	return "_tool_jira_connections"
+func (JiraIssueStatusMapping) TableName() string {

Review Comment:
   there is not a table named `_tool_jira_issue_status_mappings`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896768282


##########
models/migrationscripts/updateSchemas2022061402.go:
##########
@@ -0,0 +1,37 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+    http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+	"context"
+
+	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
+	"gorm.io/gorm"
+)
+
+type updateSchemas2022061402 struct{}
+
+func (*updateSchemas2022061402) Up(ctx context.Context, db *gorm.DB) error {
+	return db.Migrator().AutoMigrate(&ticket.Changelog{})

Review Comment:
   migration scripts should not refer to structs defined in models



##########
plugins/jira/models/migrationscripts/updateSchemas20220614.go:
##########
@@ -0,0 +1,41 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+	"context"
+
+	"github.com/apache/incubator-devlake/plugins/jira/models"
+	"gorm.io/gorm"
+)
+
+type UpdateSchemas20220614 struct{}
+
+func (*UpdateSchemas20220614) Up(ctx context.Context, db *gorm.DB) error {
+	return db.Migrator().AutoMigrate(
+		&models.JiraStatus{},

Review Comment:
   migration scripts should not refer to structs defined in models



##########
plugins/jira/tasks/shared.go:
##########
@@ -35,3 +38,26 @@ func GetTotalPagesFromResponse(res *http.Response, args *helper.ApiCollectorArgs
 	}
 	return pages, nil
 }
+
+func GetStdStatus(statusKey string) string {
+	if statusKey == "done" {
+		return ticket.DONE
+	} else if statusKey == "new" {
+		return ticket.TODO
+	} else {
+		return ticket.IN_PROGRESS
+	}
+}
+
+func GetStatusInfo(db *gorm.DB) (map[string]models.JiraStatus, error) {
+	data := make([]models.JiraStatus, 0)
+	err := db.Table("_tool_jira_statuses").Scan(&data).Error

Review Comment:
   we could replace `db.Table` with `db.Model` to avoid hard coding the table name



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896823905


##########
plugins/jira/models/connection.go:
##########
@@ -45,19 +45,27 @@ type JiraConnection struct {
 	RemotelinkCommitShaPattern string `gorm:"type:varchar(255);comment='golang regexp, the first group will be recognized as commit sha, ref https://github.com/google/re2/wiki/Syntax'" json:"remotelinkCommitShaPattern"`
 }
 
+func (JiraConnection) TableName() string {
+	return "_tool_jira_connections"
+}
+
 type JiraIssueTypeMapping struct {
 	ConnectionID uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType     string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	StandardType string `gorm:"type:varchar(50)" json:"standardType" validate:"required"`
 }
 
+func (JiraIssueTypeMapping) TableName() string {
+	return "_tool_jira_issue_type_mappings"
+}
+
 type JiraIssueStatusMapping struct {
 	ConnectionID   uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType       string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	UserStatus     string `gorm:"type:varchar(50);primaryKey" json:"userStatus" validate:"required"`
 	StandardStatus string `gorm:"type:varchar(50)" json:"standardStatus" validate:"required"`
 }
 
-func (JiraConnection) TableName() string {
-	return "_tool_jira_connections"
+func (JiraIssueStatusMapping) TableName() string {

Review Comment:
   there is no table named `_tool_jira_issue_status_mappings`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] narrowizard commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
narrowizard commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896869878


##########
plugins/jira/models/connection.go:
##########
@@ -45,19 +45,27 @@ type JiraConnection struct {
 	RemotelinkCommitShaPattern string `gorm:"type:varchar(255);comment='golang regexp, the first group will be recognized as commit sha, ref https://github.com/google/re2/wiki/Syntax'" json:"remotelinkCommitShaPattern"`
 }
 
+func (JiraConnection) TableName() string {
+	return "_tool_jira_connections"
+}
+
 type JiraIssueTypeMapping struct {
 	ConnectionID uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType     string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	StandardType string `gorm:"type:varchar(50)" json:"standardType" validate:"required"`
 }
 
+func (JiraIssueTypeMapping) TableName() string {

Review Comment:
   It reports an error that cannot find table `jira_issue_type_mappings` when running issue extractor.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r897461497


##########
plugins/jira/models/migrationscripts/updateSchemas20220614.go:
##########
@@ -0,0 +1,41 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+	"context"
+
+	"github.com/apache/incubator-devlake/plugins/jira/models"
+	"gorm.io/gorm"
+)
+
+type UpdateSchemas20220614 struct{}
+
+func (*UpdateSchemas20220614) Up(ctx context.Context, db *gorm.DB) error {
+	return db.Migrator().AutoMigrate(
+		&models.JiraStatus{},

Review Comment:
   No, we should import from `github.com/apache/incubator-devlake/models/migrationscripts/archived`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] narrowizard commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
narrowizard commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896878378


##########
plugins/jira/models/connection.go:
##########
@@ -45,19 +45,27 @@ type JiraConnection struct {
 	RemotelinkCommitShaPattern string `gorm:"type:varchar(255);comment='golang regexp, the first group will be recognized as commit sha, ref https://github.com/google/re2/wiki/Syntax'" json:"remotelinkCommitShaPattern"`
 }
 
+func (JiraConnection) TableName() string {
+	return "_tool_jira_connections"
+}
+
 type JiraIssueTypeMapping struct {
 	ConnectionID uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType     string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	StandardType string `gorm:"type:varchar(50)" json:"standardType" validate:"required"`
 }
 
+func (JiraIssueTypeMapping) TableName() string {
+	return "_tool_jira_issue_type_mappings"
+}
+
 type JiraIssueStatusMapping struct {
 	ConnectionID   uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType       string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	UserStatus     string `gorm:"type:varchar(50);primaryKey" json:"userStatus" validate:"required"`
 	StandardStatus string `gorm:"type:varchar(50)" json:"standardStatus" validate:"required"`
 }
 
-func (JiraConnection) TableName() string {
-	return "_tool_jira_connections"
+func (JiraIssueStatusMapping) TableName() string {

Review Comment:
   Seems used by issue_extractor? Is this a mistake?  
   https://github.com/apache/incubator-devlake/blob/04e4a01d94c13a98b240628205f3ce3123f2a3ab/plugins/jira/tasks/issue_extractor.go#L60-L61



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] narrowizard commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
narrowizard commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896873314


##########
models/migrationscripts/updateSchemas2022061402.go:
##########
@@ -0,0 +1,37 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+    http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+	"context"
+
+	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
+	"gorm.io/gorm"
+)
+
+type updateSchemas2022061402 struct{}
+
+func (*updateSchemas2022061402) Up(ctx context.Context, db *gorm.DB) error {
+	return db.Migrator().AutoMigrate(&ticket.Changelog{})

Review Comment:
   fixed, but still refer to common package's structure. Is that allowed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896819924


##########
plugins/jira/models/connection.go:
##########
@@ -45,19 +45,27 @@ type JiraConnection struct {
 	RemotelinkCommitShaPattern string `gorm:"type:varchar(255);comment='golang regexp, the first group will be recognized as commit sha, ref https://github.com/google/re2/wiki/Syntax'" json:"remotelinkCommitShaPattern"`
 }
 
+func (JiraConnection) TableName() string {
+	return "_tool_jira_connections"
+}
+
 type JiraIssueTypeMapping struct {
 	ConnectionID uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType     string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	StandardType string `gorm:"type:varchar(50)" json:"standardType" validate:"required"`
 }
 
+func (JiraIssueTypeMapping) TableName() string {

Review Comment:
   do we need this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] narrowizard commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
narrowizard commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896878378


##########
plugins/jira/models/connection.go:
##########
@@ -45,19 +45,27 @@ type JiraConnection struct {
 	RemotelinkCommitShaPattern string `gorm:"type:varchar(255);comment='golang regexp, the first group will be recognized as commit sha, ref https://github.com/google/re2/wiki/Syntax'" json:"remotelinkCommitShaPattern"`
 }
 
+func (JiraConnection) TableName() string {
+	return "_tool_jira_connections"
+}
+
 type JiraIssueTypeMapping struct {
 	ConnectionID uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType     string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	StandardType string `gorm:"type:varchar(50)" json:"standardType" validate:"required"`
 }
 
+func (JiraIssueTypeMapping) TableName() string {
+	return "_tool_jira_issue_type_mappings"
+}
+
 type JiraIssueStatusMapping struct {
 	ConnectionID   uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType       string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	UserStatus     string `gorm:"type:varchar(50);primaryKey" json:"userStatus" validate:"required"`
 	StandardStatus string `gorm:"type:varchar(50)" json:"standardStatus" validate:"required"`
 }
 
-func (JiraConnection) TableName() string {
-	return "_tool_jira_connections"
+func (JiraIssueStatusMapping) TableName() string {

Review Comment:
   Seems used by issue_extractor? Is this a mistake?  
   https://github.com/apache/incubator-devlake/blob/04e4a01d94c13a98b240628205f3ce3123f2a3ab/plugins/jira/tasks/issue_extractor.go#L61



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] narrowizard commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
narrowizard commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896869878


##########
plugins/jira/models/connection.go:
##########
@@ -45,19 +45,27 @@ type JiraConnection struct {
 	RemotelinkCommitShaPattern string `gorm:"type:varchar(255);comment='golang regexp, the first group will be recognized as commit sha, ref https://github.com/google/re2/wiki/Syntax'" json:"remotelinkCommitShaPattern"`
 }
 
+func (JiraConnection) TableName() string {
+	return "_tool_jira_connections"
+}
+
 type JiraIssueTypeMapping struct {
 	ConnectionID uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType     string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	StandardType string `gorm:"type:varchar(50)" json:"standardType" validate:"required"`
 }
 
+func (JiraIssueTypeMapping) TableName() string {

Review Comment:
   It reports an error that cannot find table `jira_issue_type_mappings` when running issue extractor.  
   
   https://github.com/apache/incubator-devlake/blob/04e4a01d94c13a98b240628205f3ce3123f2a3ab/plugins/jira/tasks/issue_extractor.go#L44



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] narrowizard commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
narrowizard commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896869878


##########
plugins/jira/models/connection.go:
##########
@@ -45,19 +45,27 @@ type JiraConnection struct {
 	RemotelinkCommitShaPattern string `gorm:"type:varchar(255);comment='golang regexp, the first group will be recognized as commit sha, ref https://github.com/google/re2/wiki/Syntax'" json:"remotelinkCommitShaPattern"`
 }
 
+func (JiraConnection) TableName() string {
+	return "_tool_jira_connections"
+}
+
 type JiraIssueTypeMapping struct {
 	ConnectionID uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType     string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	StandardType string `gorm:"type:varchar(50)" json:"standardType" validate:"required"`
 }
 
+func (JiraIssueTypeMapping) TableName() string {

Review Comment:
   It reports an error that cannot find table `jira_issue_type_mappings` when running issue extractor.  
   https://github.com/apache/incubator-devlake/blob/main/plugins/jira/tasks/issue_extractor.go#L44



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] narrowizard commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
narrowizard commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896873678


##########
plugins/jira/tasks/shared.go:
##########
@@ -35,3 +38,26 @@ func GetTotalPagesFromResponse(res *http.Response, args *helper.ApiCollectorArgs
 	}
 	return pages, nil
 }
+
+func GetStdStatus(statusKey string) string {
+	if statusKey == "done" {
+		return ticket.DONE
+	} else if statusKey == "new" {
+		return ticket.TODO
+	} else {
+		return ticket.IN_PROGRESS
+	}
+}
+
+func GetStatusInfo(db *gorm.DB) (map[string]models.JiraStatus, error) {
+	data := make([]models.JiraStatus, 0)
+	err := db.Table("_tool_jira_statuses").Scan(&data).Error

Review Comment:
   fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] narrowizard commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
narrowizard commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896873314


##########
models/migrationscripts/updateSchemas2022061402.go:
##########
@@ -0,0 +1,37 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+    http://www.apache.org/licenses/LICENSE-2.0
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+	"context"
+
+	"github.com/apache/incubator-devlake/models/domainlayer/ticket"
+	"gorm.io/gorm"
+)
+
+type updateSchemas2022061402 struct{}
+
+func (*updateSchemas2022061402) Up(ctx context.Context, db *gorm.DB) error {
+	return db.Migrator().AutoMigrate(&ticket.Changelog{})

Review Comment:
   fixed, but still refer to domainlayer package's structure. Is that allowed?



##########
plugins/jira/models/migrationscripts/updateSchemas20220614.go:
##########
@@ -0,0 +1,41 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+	"context"
+
+	"github.com/apache/incubator-devlake/plugins/jira/models"
+	"gorm.io/gorm"
+)
+
+type UpdateSchemas20220614 struct{}
+
+func (*UpdateSchemas20220614) Up(ctx context.Context, db *gorm.DB) error {
+	return db.Migrator().AutoMigrate(
+		&models.JiraStatus{},

Review Comment:
   fixed, but still refer to common package's structure. Is that allowed?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] narrowizard commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
narrowizard commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r896869878


##########
plugins/jira/models/connection.go:
##########
@@ -45,19 +45,27 @@ type JiraConnection struct {
 	RemotelinkCommitShaPattern string `gorm:"type:varchar(255);comment='golang regexp, the first group will be recognized as commit sha, ref https://github.com/google/re2/wiki/Syntax'" json:"remotelinkCommitShaPattern"`
 }
 
+func (JiraConnection) TableName() string {
+	return "_tool_jira_connections"
+}
+
 type JiraIssueTypeMapping struct {
 	ConnectionID uint64 `gorm:"primaryKey" json:"jiraConnectionId" validate:"required"`
 	UserType     string `gorm:"type:varchar(50);primaryKey" json:"userType" validate:"required"`
 	StandardType string `gorm:"type:varchar(50)" json:"standardType" validate:"required"`
 }
 
+func (JiraIssueTypeMapping) TableName() string {

Review Comment:
   It reports an error that cannot find table `jira_issue_type_mappings` when running issue extractor.  
   
   https://github.com/apache/incubator-devlake/blob/04e4a01d94c13a98b240628205f3ce3123f2a3ab/plugins/jira/tasks/issue_extractor.go#L43-L44



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r897456059


##########
plugins/jira/models/migrationscripts/updateSchemas20220614.go:
##########
@@ -0,0 +1,54 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+	"context"
+
+	"github.com/apache/incubator-devlake/models/common"
+	"gorm.io/gorm"
+)
+
+type JiraStatus struct {
+	common.NoPKModel

Review Comment:
   we are supposed to import the `NoPKModel` in the package `github.com/apache/incubator-devlake/models/migrationscripts/archived`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud commented on a diff in pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
mindlesscloud commented on code in PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182#discussion_r897456059


##########
plugins/jira/models/migrationscripts/updateSchemas20220614.go:
##########
@@ -0,0 +1,54 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+	"context"
+
+	"github.com/apache/incubator-devlake/models/common"
+	"gorm.io/gorm"
+)
+
+type JiraStatus struct {
+	common.NoPKModel

Review Comment:
   we are supposed to import the `NoPKModel` from the package `github.com/apache/incubator-devlake/models/migrationscripts/archived`



##########
models/migrationscripts/updateSchemas2022061402.go:
##########
@@ -0,0 +1,56 @@
+/*
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package migrationscripts
+
+import (
+	"context"
+	"time"
+
+	"github.com/apache/incubator-devlake/models/domainlayer"
+	"gorm.io/gorm"
+)
+
+type Changelog struct {
+	domainlayer.DomainEntity

Review Comment:
   we are supposed to import `DomainEntity` from `github.com/apache/incubator-devlake/models/migrationscripts/archived`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-devlake] mindlesscloud merged pull request #2182: feat: collect jira status

Posted by GitBox <gi...@apache.org>.
mindlesscloud merged PR #2182:
URL: https://github.com/apache/incubator-devlake/pull/2182


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@devlake.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org