You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "warren830 (via GitHub)" <gi...@apache.org> on 2023/02/13 14:42:14 UTC
[GitHub] [incubator-devlake] warren830 opened a new pull request, #4409: feat(sonarqube): add remote api
warren830 opened a new pull request, #4409:
URL: https://github.com/apache/incubator-devlake/pull/4409
### Summary
add remote api
### Does this close any open issues?
same feature as #4396 for sonarqube
### Screenshots
```shell
curl --request GET \
--url 'http://127.0.0.1:8080/plugins/sonarqube/connections/1/search-remote-scopes?search=aerosolve' \
--header 'content-type: multipart/form-data'
```
Response:
```json
[
{
"ConnectionId": 0,
"projectKey": "f5a50c63-2e8f-4107-9014-853f6f467757",
"name": "aerosolve",
"qualifier": "TRK",
"visibility": "public",
"lastAnalysisDate": "2023-01-02T06:58:08+0000",
"revision": "442e76ebb7cbc7f60b04fbfac30dbf862aaffc67"
}
]
```shell
curl --request GET \
--url http://127.0.0.1:8080/plugins/sonarqube/connections/1/remote-scopes \
--header 'content-type: multipart/form-data'
```
Response:
```json
{
"children": [
...,
{
"type": "scope",
"parentId": null,
"id": "e2c6d5e9-a321-4e8c-b322-03d9599ef962",
"data": {
"ConnectionId": 0,
"projectKey": "e2c6d5e9-a321-4e8c-b322-03d9599ef962",
"name": "Android-Universal-Image-Loader",
"qualifier": "TRK",
"visibility": "public",
"lastAnalysisDate": "2022-12-24T18:42:09+0000",
"revision": "458df4da2e23ba9ad76c79241a948cdfcccf72ae"
}
}
],
"nextPageToken": "eyJwYWdlIjoyLCJwZXJfcGFnZSI6MTAsInRhZyI6IiJ9"
}
```
### 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 #4409: feat(sonarqube): add remote api
Posted by "warren830 (via GitHub)" <gi...@apache.org>.
warren830 commented on code in PR #4409:
URL: https://github.com/apache/incubator-devlake/pull/4409#discussion_r1104568056
##########
backend/plugins/gitlab/api/remote.go:
##########
@@ -274,25 +274,27 @@ func SearchRemoteScopes(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutp
search = []string{""}
}
+ var p int
+ var err1 error
page, ok := input.Query["page"]
if !ok || len(page) == 0 {
- page = []string{""}
- }
-
- p, err1 := strconv.Atoi(page[0])
- if err1 != nil {
- return nil, errors.BadInput.Wrap(err1, fmt.Sprintf("failed to Atoi page:%s", page[0]))
+ p = 1
+ } else {
+ p, err1 = strconv.Atoi(page[0])
+ if err != nil {
+ return nil, errors.BadInput.Wrap(err1, fmt.Sprintf("failed to Atoi page:%s", page[0]))
+ }
Review Comment:
if page or pageSize is empty, why do we set it an empty array and use strconv.Atoi?
--
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] mappjzc merged pull request #4409: feat(sonarqube): add remote api
Posted by "mappjzc (via GitHub)" <gi...@apache.org>.
mappjzc merged PR #4409:
URL: https://github.com/apache/incubator-devlake/pull/4409
--
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