You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by "d4x1 (via GitHub)" <gi...@apache.org> on 2023/09/11 07:42:28 UTC
[GitHub] [incubator-devlake] d4x1 opened a new pull request, #6050: feat(webhook): plugin webhook's detail and list api can get api key info now
d4x1 opened a new pull request, #6050:
URL: https://github.com/apache/incubator-devlake/pull/6050
### ⚠️ Pre Checklist
> Please complete _ALL_ items in this checklist, and remove before submitting
- [x] I have read through the [Contributing Documentation](https://devlake.apache.org/community/).
- [x] I have added relevant tests.
- [x] I have added relevant documentation.
- [x] I will add labels to the PR, such as `pr-type/bug-fix`, `pr-type/feature-development`, etc.
<!--
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.
-->
### Summary
What does this PR do?
1. add ApiKey field for plugin webhook's list and detail APIs, in order to make it possible to regenerabe webhook's api key with the api `HTTP PUT/api-keys/:apiKeyId/`.
2. Simplify the response struct to make code less.
3. add fields `postIssuesEndpoint` `closeIssuesEndpoint` `postPipelineTaskEndpoint` `postPipelineDeployTaskEndpoint` `closePipelineEndpoint` to help to simplify the front end codes.
### Does this close any open issues?
Closes xx
### Screenshots
Include any relevant screenshots here.
1.
<img width="1414" alt="image" src="https://github.com/apache/incubator-devlake/assets/5844806/c310cb9e-822c-4645-b94a-f46f9ebd6f48">
<img width="1425" alt="image" src="https://github.com/apache/incubator-devlake/assets/5844806/464e3c20-5cb8-4178-8a9c-139a49b66158">
3.
<img width="1426" alt="image" src="https://github.com/apache/incubator-devlake/assets/5844806/6e303d5a-829c-471a-a37e-d4468abbaa74">
### 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] d4x1 commented on a diff in pull request #6050: feat(webhook): plugin webhook's detail and list api can get api key info now
Posted by "d4x1 (via GitHub)" <gi...@apache.org>.
d4x1 commented on code in PR #6050:
URL: https://github.com/apache/incubator-devlake/pull/6050#discussion_r1321264662
##########
backend/plugins/webhook/api/connection.go:
##########
@@ -150,9 +153,13 @@ func ListConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput,
if err != nil {
return nil, err
}
- responseList := []WebhookConnectionResponse{}
+ var responseList []*WebhookConnectionResponse
for _, connection := range connections {
- responseList = append(responseList, *formatConnection(&connection))
+ webhookConnectionResponse, err := formatConnection(&connection, true)
Review Comment:
Updated. Please review again. @klesh
--
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] klesh merged pull request #6050: feat(webhook): plugin webhook's detail and list api can get api key info now
Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh merged PR #6050:
URL: https://github.com/apache/incubator-devlake/pull/6050
--
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] d4x1 commented on a diff in pull request #6050: feat(webhook): plugin webhook's detail and list api can get api key info now
Posted by "d4x1 (via GitHub)" <gi...@apache.org>.
d4x1 commented on code in PR #6050:
URL: https://github.com/apache/incubator-devlake/pull/6050#discussion_r1321243048
##########
backend/plugins/webhook/api/connection.go:
##########
@@ -150,9 +153,13 @@ func ListConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput,
if err != nil {
return nil, err
}
- responseList := []WebhookConnectionResponse{}
+ var responseList []*WebhookConnectionResponse
for _, connection := range connections {
- responseList = append(responseList, *formatConnection(&connection))
+ webhookConnectionResponse, err := formatConnection(&connection, true)
Review Comment:
Got it.
--
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] klesh commented on a diff in pull request #6050: feat(webhook): plugin webhook's detail and list api can get api key info now
Posted by "klesh (via GitHub)" <gi...@apache.org>.
klesh commented on code in PR #6050:
URL: https://github.com/apache/incubator-devlake/pull/6050#discussion_r1321241552
##########
backend/plugins/webhook/api/connection.go:
##########
@@ -150,9 +153,13 @@ func ListConnections(input *plugin.ApiResourceInput) (*plugin.ApiResourceOutput,
if err != nil {
return nil, err
}
- responseList := []WebhookConnectionResponse{}
+ var responseList []*WebhookConnectionResponse
for _, connection := range connections {
- responseList = append(responseList, *formatConnection(&connection))
+ webhookConnectionResponse, err := formatConnection(&connection, true)
Review Comment:
I think we should delete the `api key hash` from the response to reduce the attach surface.
--
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