keon94 commented on code in PR #4695:
URL:
https://github.com/apache/incubator-devlake/pull/4695#discussion_r1142717417
##########
backend/server/services/remote/plugin/connection_api.go:
##########
@@ -22,15 +22,22 @@ import (
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
+ "github.com/apache/incubator-devlake/server/api/shared"
"github.com/apache/incubator-devlake/server/services/remote/bridge"
)
func (pa *pluginAPI) TestConnection(input *plugin.ApiResourceInput)
(*plugin.ApiResourceOutput, errors.Error) {
err := pa.invoker.Call("test-connection", bridge.DefaultContext,
input.Body).Err
if err != nil {
Review Comment:
we can't assume the error will always be 401. What if the endpoint was
offline or gave us another error code? I think TestConnection needs to have a
contract where it writes the datasource's response into a standardized output
with a Http Code on it. It might as well be the ApiResourceOutput struct, but
written for Python.
--
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]