abeizn commented on code in PR #4360:
URL: 
https://github.com/apache/incubator-devlake/pull/4360#discussion_r1099870105


##########
backend/core/models/domainlayer/securitytesting/st_issues.go:
##########
@@ -29,7 +29,7 @@ type StIssue struct {
        Rule              string           `json:"rule" 
gorm:"type:varchar(255)"`
        Severity          string           `json:"severity" 
gorm:"type:varchar(255)"`
        Component         string           `json:"component" 
gorm:"type:varchar(255)"`
-       Project           string           `json:"project" 
gorm:"type:varchar(255)"`
+       ProjectKey        string           `gorm:"index;type:varchar(255)"` 
//domain project key

Review Comment:
   What's the differenct?



##########
backend/plugins/sonarqube/tasks/hotspots_convertor.go:
##########
@@ -47,19 +47,20 @@ func ConvertHotspots(taskCtx plugin.SubTaskContext) 
errors.Error {
        }
        defer cursor.Close()
 
-       accountIdGen := 
didgen.NewDomainIdGenerator(&sonarqubeModels.SonarqubeHotspot{})
+       issueIdGen := 
didgen.NewDomainIdGenerator(&sonarqubeModels.SonarqubeHotspot{})
+       projectIdGen := 
didgen.NewDomainIdGenerator(&sonarqubeModels.SonarqubeProject{})
        converter, err := api.NewDataConverter(api.DataConverterArgs{
                InputRowType:       
reflect.TypeOf(sonarqubeModels.SonarqubeHotspot{}),
                Input:              cursor,
                RawDataSubTaskArgs: *rawDataSubTaskArgs,
                Convert: func(inputRow interface{}) ([]interface{}, 
errors.Error) {
                        sonarqubeHotspot := 
inputRow.(*sonarqubeModels.SonarqubeHotspot)
                        domainHotspot := &securitytesting.StIssue{
-                               DomainEntity:      domainlayer.DomainEntity{Id: 
accountIdGen.Generate(data.Options.ConnectionId, sonarqubeHotspot.Key)},
+                               DomainEntity:      domainlayer.DomainEntity{Id: 
issueIdGen.Generate(data.Options.ConnectionId, sonarqubeHotspot.Key)},
                                BatchId:           sonarqubeHotspot.BatchId,
                                Key:               sonarqubeHotspot.Key,
                                Component:         sonarqubeHotspot.Component,
-                               Project:           sonarqubeHotspot.Project,
+                               ProjectKey:        
projectIdGen.Generate(data.Options.ConnectionId, sonarqubeHotspot.Project),

Review Comment:
   need connectionId?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to