starsz commented on a change in pull request #1592:
URL: https://github.com/apache/apisix-dashboard/pull/1592#discussion_r594002376



##########
File path: api/internal/handler/schema/schema.go
##########
@@ -0,0 +1,76 @@
+/*

Review comment:
       I think you can merge `plugin.go` to `schema.go`.

##########
File path: api/test/e2enew/schema/schema_suite_test.go
##########
@@ -23,5 +23,5 @@ import (
 )
 
 func TestPlugin(t *testing.T) {

Review comment:
       Rename to TestSchema?

##########
File path: api/internal/handler/schema/plugin_test.go
##########
@@ -60,84 +58,9 @@ func TestPlugin(t *testing.T) {
                        basicAuthConsumerSchema = string(consumerSchemaByte)
                        assert.Nil(t, err)
                }
-
-               assert.Contains(t, conf.Plugins, plugin["name"])
        }
-
-       assert.Contains(t, conf.Plugins, "server-info")
-       assert.Contains(t, conf.Plugins, "traffic-split")
-       assert.NotContains(t, conf.Plugins, "dubbo-proxy")
-
        // plugin type
        assert.ElementsMatch(t, []string{"basic-auth", "jwt-auth", "hmac-auth", 
"key-auth", "wolf-rbac"}, authPlugins)
        // consumer schema
        assert.Equal(t, 
`{"additionalProperties":false,"properties":{"password":{"type":"string"},"username":{"type":"string"}},"required":["password","username"],"title":"work
 with consumer object","type":"object"}`, basicAuthConsumerSchema)
-

Review comment:
       Why delete those tests?

##########
File path: api/internal/handler/schema/plugin.go
##########
@@ -90,11 +65,9 @@ func (h *Handler) Plugins(c droplet.Context) (interface{}, 
error) {
        var ret []string
        list := plugins.Map()
        for pluginName := range list {
-               if res, ok := conf.Plugins[pluginName]; !ok || !res {
-                       continue
+               if pluginName != "serverless-post-function" && pluginName != 
"serverless-pre-function" {
+                       ret = append(ret, pluginName)

Review comment:
       The logic had changed?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to