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/09 12:14:42 UTC
[GitHub] [incubator-devlake] abeizn opened a new pull request, #4371: feat: sonarqube account e2e
abeizn opened a new pull request, #4371:
URL: https://github.com/apache/incubator-devlake/pull/4371
### Summary
feat: sonarqube account e2e
### Does this close any open issues?
part of #2305
### Screenshots
### 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 commented on a diff in pull request #4371: feat: sonarqube account e2e
Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4371:
URL: https://github.com/apache/incubator-devlake/pull/4371#discussion_r1102343909
##########
backend/plugins/sonarqube/tasks/projects_extractor.go:
##########
@@ -28,13 +28,39 @@ import (
var _ plugin.SubTaskEntryPoint = ExtractProjects
func ExtractProjects(taskCtx plugin.SubTaskContext) errors.Error {
- rawDataSubTaskArgs, data := CreateRawDataSubTaskArgs(taskCtx, RAW_PROJECTS_TABLE)
+ // As we need to assign data.LastAnalysisDate, we can not use CreateRawDataSubTaskArgs
+ data := taskCtx.GetData().(*SonarqubeTaskData)
+ var params = SonarqubeApiParams{
+ ConnectionId: data.Options.ConnectionId,
+ ProjectKey: data.Options.ProjectKey,
+ }
+ rawDataSubTaskArgs := &helper.RawDataSubTaskArgs{
+ Ctx: taskCtx,
+ Params: params,
+ Table: RAW_PROJECTS_TABLE,
+ }
extractor, err := helper.NewApiExtractor(helper.ApiExtractorArgs{
RawDataSubTaskArgs: *rawDataSubTaskArgs,
Extract: func(resData *helper.RawData) ([]interface{}, errors.Error) {
- body := &models.SonarqubeProject{}
- err := errors.Convert(json.Unmarshal(resData.Data, body))
- body.ConnectionId = data.Options.ConnectionId
+ var res struct {
+ ProjectKey string `json:"key"`
+ Name string `json:"name"`
+ Qualifier string `json:"qualifier"`
+ Visibility string `json:"visibility"`
+ LastAnalysisDate *helper.Iso8601Time `json:"lastAnalysisDate"`
+ Revision string `json:"revision"`
+ }
+ err := errors.Convert(json.Unmarshal(resData.Data, &res))
+ body := &models.SonarqubeProject{
+ ConnectionId: data.Options.ConnectionId,
+ ProjectKey: res.ProjectKey,
+ Name: res.Name,
+ Qualifier: res.Qualifier,
+ Visibility: res.Visibility,
+ LastAnalysisDate: res.LastAnalysisDate,
+ Revision: res.Revision,
+ }
+ data.LastAnalysisDate = body.LastAnalysisDate.ToNullableTime()
Review Comment:
What is this? I remember I already changed 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] warren830 commented on a diff in pull request #4371: feat: sonarqube account e2e
Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4371:
URL: https://github.com/apache/incubator-devlake/pull/4371#discussion_r1102275552
##########
backend/plugins/sonarqube/e2e/snapshot_tables/_tool_sonarqube_accounts.csv:
##########
@@ -0,0 +1,5 @@
+connection_id,login,batch_id,name,email,active,local
Review Comment:
there should not be batch_id
--
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] abeizn merged pull request #4371: feat: sonarqube account e2e
Posted by "abeizn (via GitHub)" <gi...@apache.org>.
abeizn merged PR #4371:
URL: https://github.com/apache/incubator-devlake/pull/4371
--
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] abeizn commented on a diff in pull request #4371: feat: sonarqube account e2e
Posted by "abeizn (via GitHub)" <gi...@apache.org>.
abeizn commented on code in PR #4371:
URL: https://github.com/apache/incubator-devlake/pull/4371#discussion_r1102347721
##########
backend/plugins/sonarqube/e2e/raw_tables/_raw_sonarqube_projects.csv:
##########
@@ -0,0 +1,12 @@
+"id","params","data","url","input","created_at"
+642,"{""connectionId"":1,""ProjectKey"":""fa2cf9cd-c448-4fc3-99a5-1c893f15d84c""}","{""key"":""fa2cf9cd-c448-4fc3-99a5-1c893f15d84c"",""name"":""activeadmin"",""qualifier"":""TRK"",""visibility"":""public"",""lastAnalysisDate"":""2022-12-23T13:52:39+0000"",""revision"":""51689e48ec3faa51127b8462b2219e5e0c09ad8a""}","http://35.89.154.221:30008/api/projects/search?p=1&ps=100","null","2023-02-10 02:46:14.044"
Review Comment:
Can be understood as interference data?
--
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 #4371: feat: sonarqube account e2e
Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4371:
URL: https://github.com/apache/incubator-devlake/pull/4371#discussion_r1102346993
##########
backend/plugins/sonarqube/e2e/raw_tables/_raw_sonarqube_projects.csv:
##########
@@ -0,0 +1,12 @@
+"id","params","data","url","input","created_at"
+642,"{""connectionId"":1,""ProjectKey"":""fa2cf9cd-c448-4fc3-99a5-1c893f15d84c""}","{""key"":""fa2cf9cd-c448-4fc3-99a5-1c893f15d84c"",""name"":""activeadmin"",""qualifier"":""TRK"",""visibility"":""public"",""lastAnalysisDate"":""2022-12-23T13:52:39+0000"",""revision"":""51689e48ec3faa51127b8462b2219e5e0c09ad8a""}","http://35.89.154.221:30008/api/projects/search?p=1&ps=100","null","2023-02-10 02:46:14.044"
+643,"{""connectionId"":1,""ProjectKey"":""""}","{""key"":""a67b8166-5768-46a5-8830-6d86d797419a"",""name"":""actix-web"",""qualifier"":""TRK"",""visibility"":""public"",""lastAnalysisDate"":""2023-01-04T22:36:46+0000"",""revision"":""08c2cdf6416287d63387584213ea3dd41b007ef6""}","http://35.89.154.221:30008/api/projects/search?p=1&ps=100","null","2023-02-10 02:46:14.044"
+644,"{""connectionId"":2,""ProjectKey"":""""}","{""key"":""a7c268ed-525b-438d-8729-18e83229e66c"",""name"":""Aerial"",""qualifier"":""TRK"",""visibility"":""public"",""lastAnalysisDate"":""2022-12-22T18:26:29+0000"",""revision"":""405bc2494af895f8b9ccbf12f3d0c9530a154011""}","http://35.89.154.221:30008/api/projects/search?p=1&ps=100","null","2023-02-10 02:46:14.044"
+645,"{""connectionId"":2,""ProjectKey"":""""}","{""key"":""f5a50c63-2e8f-4107-9014-853f6f467757"",""name"":""aerosolve"",""qualifier"":""TRK"",""visibility"":""public"",""lastAnalysisDate"":""2023-01-02T06:58:08+0000"",""revision"":""442e76ebb7cbc7f60b04fbfac30dbf862aaffc67""}","http://35.89.154.221:30008/api/projects/search?p=1&ps=100","null","2023-02-10 02:46:14.044"
Review Comment:
same as above
--
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 #4371: feat: sonarqube account e2e
Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4371:
URL: https://github.com/apache/incubator-devlake/pull/4371#discussion_r1102205939
##########
backend/plugins/sonarqube/e2e/raw_tables/_raw_sonarqube_accounts.csv:
##########
@@ -0,0 +1,6 @@
+"id","params","data","url","input","created_at"
+1,"{""connectionId"":1,""ProjectKey"":""""}","{""login"":""admin"",""name"":""Administrator"",""active"":true,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
+2,"{""connectionId"":1,""ProjectKey"":""""}","{""login"":""admin1"",""name"":""Administrator1"",""active"":false,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
+3,"{""connectionId"":1,""ProjectKey"":""""}","{""login"":""admin2"",""name"":""Administrator2"",""email"":""aaa@email.com"",""active"":true,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
+4,"{""connectionId"":1,""ProjectKey"":""""}","{""login"":""admin3"",""name"":""Administrator3"",""active"":false,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
+5,"{""connectionId"":1,""ProjectKey"":""""}","{""login"":""admin4"",""name"":""Administrator4"",""active"":true,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
Review Comment:
please add some interfered data:
like connectionId = 2, 3
--
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 #4371: feat: sonarqube account e2e
Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4371:
URL: https://github.com/apache/incubator-devlake/pull/4371#discussion_r1102346870
##########
backend/plugins/sonarqube/e2e/raw_tables/_raw_sonarqube_projects.csv:
##########
@@ -0,0 +1,12 @@
+"id","params","data","url","input","created_at"
+642,"{""connectionId"":1,""ProjectKey"":""fa2cf9cd-c448-4fc3-99a5-1c893f15d84c""}","{""key"":""fa2cf9cd-c448-4fc3-99a5-1c893f15d84c"",""name"":""activeadmin"",""qualifier"":""TRK"",""visibility"":""public"",""lastAnalysisDate"":""2022-12-23T13:52:39+0000"",""revision"":""51689e48ec3faa51127b8462b2219e5e0c09ad8a""}","http://35.89.154.221:30008/api/projects/search?p=1&ps=100","null","2023-02-10 02:46:14.044"
Review Comment:
next 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 #4371: feat: sonarqube account e2e
Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4371:
URL: https://github.com/apache/incubator-devlake/pull/4371#discussion_r1102275841
##########
backend/plugins/sonarqube/e2e/raw_tables/_raw_sonarqube_accounts.csv:
##########
@@ -0,0 +1,8 @@
+"id","params","data","url","input","created_at"
+1,"{""connectionId"":1,""ProjectKey"":""""}","{""login"":""admin"",""name"":""Administrator"",""active"":true,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
+2,"{""connectionId"":1,""ProjectKey"":""""}","{""login"":""admin1"",""name"":""Administrator1"",""active"":false,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
+3,"{""connectionId"":2,""ProjectKey"":""""}","{""login"":""admin2"",""name"":""Administrator2"",""email"":""aaa@email.com"",""active"":true,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
+4,"{""connectionId"":2,""ProjectKey"":""""}","{""login"":""admin3"",""name"":""Administrator3"",""active"":false,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
+5,"{""connectionId"":1,""ProjectKey"":""xxx""}","{""login"":""admin4"",""name"":""Administrator4"",""active"":true,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
+6,"{""connectionId"":2,""ProjectKey"":""xxx""}","{""login"":""admin4"",""name"":""Administrator4"",""active"":true,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
+7,"{""connectionId"":3,""ProjectKey"":""""}","{""login"":""admin4"",""name"":""Administrator4"",""active"":true,""groups"":[""sonar-administrators"",""sonar-users""],""tokensCount"":3,""local"":true,""externalIdentity"":""admin"",""externalProvider"":""sonarqube"",""lastConnectionDate"":""2023-02-09T11:28:44+0000""}","http://35.89.154.221:30008/api/users/search?p=1&ps=100","null","2023-02-09 11:55:28.770"
Review Comment:
please add an empty line at the end of file
--
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 #4371: feat: sonarqube account e2e
Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4371:
URL: https://github.com/apache/incubator-devlake/pull/4371#discussion_r1102346534
##########
backend/plugins/sonarqube/e2e/raw_tables/_raw_sonarqube_projects.csv:
##########
@@ -0,0 +1,12 @@
+"id","params","data","url","input","created_at"
+642,"{""connectionId"":1,""ProjectKey"":""fa2cf9cd-c448-4fc3-99a5-1c893f15d84c""}","{""key"":""fa2cf9cd-c448-4fc3-99a5-1c893f15d84c"",""name"":""activeadmin"",""qualifier"":""TRK"",""visibility"":""public"",""lastAnalysisDate"":""2022-12-23T13:52:39+0000"",""revision"":""51689e48ec3faa51127b8462b2219e5e0c09ad8a""}","http://35.89.154.221:30008/api/projects/search?p=1&ps=100","null","2023-02-10 02:46:14.044"
Review Comment:
projectKey is empty in param
--
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