You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "abeizn (via GitHub)" <gi...@apache.org> on 2023/02/08 11:40:19 UTC

[GitHub] [incubator-devlake] abeizn opened a new pull request, #4361: feat: sonarqube issue project update

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

   
   ### Summary
   sonarqube issue project update
   
   ### Does this close any open issues?
   part of #2305 
   
   ### 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] warren830 merged pull request #4361: feat: sonarqube issue project update

Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 merged PR #4361:
URL: https://github.com/apache/incubator-devlake/pull/4361


-- 
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] warren830 commented on a diff in pull request #4361: feat: sonarqube issue project update

Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4361:
URL: https://github.com/apache/incubator-devlake/pull/4361#discussion_r1100072123


##########
backend/plugins/sonarqube/tasks/issues_extractor.go:
##########
@@ -82,7 +82,6 @@ func ExtractIssues(taskCtx plugin.SubTaskContext) errors.Error {
 						ConnectionId: data.Options.ConnectionId,
 						IssueKey:     sonarqubeIssue.Key,
 						Component:    location.Component,
-						Project:      body.Project,

Review Comment:
   why do you delete this line...



-- 
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] warren830 commented on a diff in pull request #4361: feat: sonarqube issue project update

Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4361:
URL: https://github.com/apache/incubator-devlake/pull/4361#discussion_r1100038387


##########
backend/plugins/sonarqube/tasks/issue_code_blocks_convertor.go:
##########
@@ -35,8 +35,10 @@ func ConvertIssueCodeBlocks(taskCtx plugin.SubTaskContext) errors.Error {
 	db := taskCtx.GetDal()
 	rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_ISSUES_TABLE)
 
-	cursor, err := db.Cursor(dal.From(&models.SonarqubeIssueCodeBlock{}), dal.Where("connection_id = ? and project = ? ",
-		data.Options.ConnectionId, data.Options.ProjectKey))
+	cursor, err := db.Cursor(
+		dal.From("_tool_sonarqube_issue_code_blocks icb"),
+		dal.Join("_tool_sonarqube_issues i on i.key = icb.issue_key"),
+		dal.Where("connection_id = ? ", data.Options.ConnectionId))

Review Comment:
   and i.project = ?  data.Options.ProjectKey



-- 
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] warren830 commented on a diff in pull request #4361: feat: sonarqube issue project update

Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4361:
URL: https://github.com/apache/incubator-devlake/pull/4361#discussion_r1100039359


##########
backend/plugins/sonarqube/tasks/issue_code_blocks_convertor.go:
##########
@@ -50,16 +52,15 @@ func ConvertIssueCodeBlocks(taskCtx plugin.SubTaskContext) errors.Error {
 		Convert: func(inputRow interface{}) ([]interface{}, errors.Error) {
 			sonarqubeIssueCodeBlock := inputRow.(*models.SonarqubeIssueCodeBlock)
 			domainIssueCodeBlock := &securitytesting.StIssueCodeBlock{
-				DomainEntity: domainlayer.DomainEntity{Id: idGen.Generate(data.Options.ConnectionId, sonarqubeIssueCodeBlock.Id)},
-				Id:           sonarqubeIssueCodeBlock.Id,
-				IssueKey:     sonarqubeIssueCodeBlock.IssueKey,
-				Component:    sonarqubeIssueCodeBlock.Component,
-				Msg:          sonarqubeIssueCodeBlock.Msg,
-				Project:      sonarqubeIssueCodeBlock.Project,
-				StartLine:    sonarqubeIssueCodeBlock.StartLine,
-				EndLine:      sonarqubeIssueCodeBlock.EndLine,
-				StartOffset:  sonarqubeIssueCodeBlock.StartOffset,
-				EndOffset:    sonarqubeIssueCodeBlock.EndOffset,
+				DomainEntity:     domainlayer.DomainEntity{Id: idGen.Generate(data.Options.ConnectionId, sonarqubeIssueCodeBlock.Id)},
+				IssueCodeBlockId: sonarqubeIssueCodeBlock.Id,
+				IssueKey:         sonarqubeIssueCodeBlock.IssueKey,

Review Comment:
   please map to domain issue...



-- 
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] warren830 commented on a diff in pull request #4361: feat: sonarqube issue project update

Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4361:
URL: https://github.com/apache/incubator-devlake/pull/4361#discussion_r1100025239


##########
backend/core/models/domainlayer/securitytesting/st_issue_code_blocks.go:
##########
@@ -21,10 +21,9 @@ import "github.com/apache/incubator-devlake/core/models/domainlayer"
 
 type StIssueCodeBlock struct {
 	domainlayer.DomainEntity
-	Id          string `gorm:"primaryKey"`
+	Id          string `json:"id"`

Review Comment:
   will this Id be duplicated with domainEntity?



-- 
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