Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
Alanxtl commented on code in PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#discussion_r4022911863 ## CHANGELOG.md: ## Review Comment: 这个不用提交 -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5693364463 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
Alanxtl commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5692793455 Instance YAML 的格式需要明确一下 当前实现的规则是: ```yaml dubbo: extensions: hystrix: enabled: true ``` 会作为 Instance 配置。 而: ```yaml dubbo: extensions: hystrix: consumer: ... provider: ... ``` 会根据 client/server 分别选择对应分支。 改成这种是不是好一些: ```yaml hystrix: instance: enabled: true ``` -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
XnLemon commented on code in PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#discussion_r4023142355 ## CHANGELOG.md: ## Review Comment: okay 删了 -w- -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
Alanxtl merged PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687 -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
XnLemon commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5693315234 > > > Instance YAML 的格式需要明确一下 > > > 当前实现的规则是: > > > ```yaml > > > dubbo: > > > extensions: > > > hystrix: > > > enabled: true > > > ``` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 会作为 Instance 配置。 > > > 而: > > > ```yaml > > > dubbo: > > > extensions: > > > hystrix: > > > consumer: > > > ... > > > provider: > > > ... > > > ``` > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 会根据 client/server 分别选择对应分支。 > > > 改成这种是不是好一些: > > > ```yaml > > > dubbo: > > > extensions: > > > hystrix: > > > instance: > > > ... > > > ``` > > > > > > changed style like > > ```yaml > > dubbo: > > extensions: > >my-extension: > > instance: > >consumer: > > some-instance-setting: foo > >provider: > > another-instance-setting: bar > > consumer: > >client-setting: baz > > provider: > >server-setting: qux > > ``` > > 如果像这个例子这样 同时出现 instance consumer provider 会出现冲突吗 no 只根据扩展配置最外层的键选择分支 instance to Instance 配置 consumer to Client 配置 provider to Server 配置 -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
Alanxtl commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5693336813 lgtm pls fix the ci -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5693112596 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
Alanxtl commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5693273845 > > Instance YAML 的格式需要明确一下 > > 当前实现的规则是: > > ```yaml > > dubbo: > > extensions: > > hystrix: > > enabled: true > > ``` > > > > > > > > > > > > > > > > > > > > > > > > 会作为 Instance 配置。 > > 而: > > ```yaml > > dubbo: > > extensions: > > hystrix: > > consumer: > > ... > > provider: > > ... > > ``` > > > > > > > > > > > > > > > > > > > > > > > > 会根据 client/server 分别选择对应分支。 > > 改成这种是不是好一些: > > ```yaml > > dubbo: > > extensions: > > hystrix: > > instance: > > ... > > ``` > > changed style like > > ```yaml > dubbo: > extensions: >my-extension: > instance: >consumer: > some-instance-setting: foo >provider: > another-instance-setting: bar > consumer: >client-setting: baz > provider: >server-setting: qux > ``` 如果像这个例子这样 同时出现 instance consumer provider 会出现冲突吗 -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
XnLemon commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5693118287 > Instance YAML 的格式需要明确一下 > > 当前实现的规则是: > > ```yaml > dubbo: > extensions: > hystrix: > enabled: true > ``` > > 会作为 Instance 配置。 > > 而: > > ```yaml > dubbo: > extensions: > hystrix: > consumer: > ... > provider: > ... > ``` > > 会根据 client/server 分别选择对应分支。 > > 改成这种是不是好一些: > > ```yaml > dubbo: > extensions: > hystrix: > instance: > ... > ``` changed style like ```yaml dubbo: extensions: my-extension: instance: consumer: some-instance-setting: foo provider: another-instance-setting: bar consumer: client-setting: baz provider: server-setting: qux ``` -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5693104730 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
AlexStocks commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5629035104 [Review bot placeholder] 权限验证用,请忽略。 -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5639410272 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
AlexStocks commented on code in PR #3687:
URL: https://github.com/apache/dubbo-go/pull/3687#discussion_r3986408319
##
common/extension/config_loader.go:
##
@@ -0,0 +1,411 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package extension
+
+import (
+ "errors"
+ "fmt"
+ "reflect"
+ "sort"
+ "strings"
+)
+
+import (
+ "github.com/mitchellh/mapstructure"
+)
+
+// Initialize creates and initializes the extensions active for one lifecycle
+// scope. rawConfigs is the map below dubbo.extensions, while options contains
+// typed options declared by the corresponding entry point.
+//
+// Each active extension receives a fresh Config. Its configuration precedence
+// is defaults from Config.New, selected YAML, typed options, and finally
+// Config.Init. Filter names are validated before they are returned, so callers
+// can merge them into their filter configuration atomically after all
+// extensions have initialized successfully.
+func Initialize(rawConfigs map[string]any, options []Option, scope Scope)
([]string, error) {
+ if !scope.valid() {
+ return nil, fmt.Errorf("extension: invalid scope %d", scope)
+ }
+
+ registered := configs.Snapshot()
+ optionsByPrefix, activePrefixes, err := groupOptionsByPrefix(options,
registered)
+ if err != nil {
+ return nil, err
+ }
+ rawByPrefix, err := collectRawConfigs(rawConfigs, scope, registered,
activePrefixes)
+ if err != nil {
+ return nil, err
+ }
+
+ return initializeConfigs(registered, rawByPrefix, optionsByPrefix,
activePrefixes, scope)
+}
+
+func groupOptionsByPrefix(options []Option, registered map[string]Config)
(map[string][]Option, map[string]struct{}, error) {
+ optionsByPrefix := make(map[string][]Option)
+ activePrefixes := make(map[string]struct{})
+
+ for index, option := range options {
+ prefix, err := validateOptionPrefix(option, index, registered)
+ if err != nil {
+ return nil, nil, err
+ }
+ optionsByPrefix[prefix] = append(optionsByPrefix[prefix],
option)
+ activePrefixes[prefix] = struct{}{}
+ }
+
+ return optionsByPrefix, activePrefixes, nil
+}
+
+func validateOptionPrefix(option Option, index int, registered
map[string]Config) (string, error) {
+ if optionIsNil(option) {
+ return "", fmt.Errorf("extension: option %d is nil", index)
+ }
+ rawPrefix := option.Prefix()
+ prefix := strings.TrimSpace(rawPrefix)
+ if prefix == "" {
+ return "", fmt.Errorf("extension: option %d has an empty
prefix", index)
+ }
+ if prefix != rawPrefix {
+ return "", fmt.Errorf("extension: option %d prefix %q must not
contain surrounding whitespace", index, rawPrefix)
+ }
+ if _, ok := registered[prefix]; !ok {
+ return "", fmt.Errorf("extension %q: config is not registered",
prefix)
+ }
+ return prefix, nil
+}
+
+func collectRawConfigs(rawConfigs map[string]any, scope Scope, registered
map[string]Config, activePrefixes map[string]struct{})
(map[string]map[string]any, error) {
+ rawByPrefix := make(map[string]map[string]any)
+ for prefix, value := range rawConfigs {
+ selected, active, err := selectRawConfig(value, scope)
+ if err != nil {
+ return nil, fmt.Errorf("extension %q: invalid YAML
config: %w", prefix, err)
+ }
+ if !active {
+ continue
+ }
+ if _, ok := registered[prefix]; !ok {
+ return nil, fmt.Errorf("extension %q: config is not
registered", prefix)
+ }
+ rawByPrefix[prefix] = selected
+ activePrefixes[prefix] = struct{}{}
+ }
+ return rawByPrefix, nil
+}
+
+func initializeConfigs(registered map[string]Config, rawByPrefix
map[string]map[string]any, optionsByPrefix map[string][]Option, activePrefixes
map[string]struct{}, scope Scope) ([]string, error) {
+ prefixes :=
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
AlexStocks commented on code in PR #3687:
URL: https://github.com/apache/dubbo-go/pull/3687#discussion_r3985798181
##
server/options.go:
##
@@ -96,6 +99,12 @@ func (srvOpts *ServerOptions) init(opts ...ServerOption)
error {
return err
}
+ filterNames, err := extension.Initialize(srvOpts.extensionConfigs,
srvOpts.extensionOptions, extension.ServerScope)
+ if err != nil {
+ return err
+ }
+ providerConf.Filter = extension.MergeFilterNames(providerConf.Filter,
filterNames)
Review Comment:
[P0] 服务端把扩展 filter 合并进 Provider.Filter,会整体替换默认 provider filter 链
`providerConf.Filter` 默认是空串;`server/action.go:373` 的判定是
`if svcConf.Filter == "" { filters = constant.DefaultServiceFilters } else {
filters = svcConf.Filter }`,
而 `ServiceOptions.init` 通过 `dubboutil.CopyFields` 在 `Service.Filter` 为空时把
`Provider.Filter` 抄进去。
所以这里一旦写入扩展贡献的 filter 名,导出 URL 的 `service.filter`
就变成非空,`DefaultServiceFilters` 被整体丢弃。
在 exact Head 1bc7adaf 上按 `defaultServerOptions().init` ->
`defaultServiceOptions().init` -> `getUrlMap()`(与 `Server.genSvcOpts` /
`Export` 同一条链)做探针:
- 不启用扩展:`service.filter =
"echo,token,accesslog,tps,generic_service,execute,pshutdown"`
- 启用一个只贡献 1 个 filter 名的扩展:`service.filter =
"probe-provider-filter"`,`echo`/`token`/`pshutdown` 全部消失
消费端没有这个问题:`client/action.go:444` 用 `MergeValue(ref.Filter, "",
defaultReferenceFilter)` 把扩展 filter 并入默认值,实测为
`cshutdown,probe-consumer-filter`,两端语义不一致。
被丢掉的链里包含 `token`(provider 侧 token 校验,`filter/token/filter.go` 在 `TokenKey`
非空时强制校验)和 `tps`/`execute`(限流与并发限制),因此只要业务启用任意声明 filter 的扩展,服务端默认鉴权与限流就会静默失效。
建议让 `Provider.Filter` 只承载用户显式配置,扩展名在确定 `DefaultServiceFilters` 之后再合并(或复用
`commonCfg.MergeValue` 的语义),并补一条断言导出 URL `service.filter` 的用例。
##
server/options_test.go:
##
@@ -29,11 +30,141 @@ import (
import (
"dubbo.apache.org/dubbo-go/v3/common/constant"
+ "dubbo.apache.org/dubbo-go/v3/common/extension"
+ "dubbo.apache.org/dubbo-go/v3/filter"
"dubbo.apache.org/dubbo-go/v3/global"
"dubbo.apache.org/dubbo-go/v3/protocol"
"dubbo.apache.org/dubbo-go/v3/registry"
)
+type serverEntryConfig struct {
+ prefixstring
+ Value int `yaml:"value"`
+ requiredScope extension.Scope
+ initialized extension.Scope
+ onInitfunc(*serverEntryConfig)
+}
+
+func (c *serverEntryConfig) Prefix() string {
+ return c.prefix
+}
+
+func (c *serverEntryConfig) New() extension.Config {
+ return &serverEntryConfig{
+ prefix:c.prefix,
+ Value: 1,
+ requiredScope: c.requiredScope,
+ onInit:c.onInit,
+ }
+}
+
+func (c *serverEntryConfig) Init(scope extension.Scope) error {
+ if c.requiredScope != 0 && scope != c.requiredScope {
+ return errors.New("server scope is required")
+ }
+ c.initialized = scope
+ if c.onInit != nil {
+ c.onInit(c)
+ }
+ return nil
+}
+
+func (c *serverEntryConfig) FilterNames(extension.Scope) []string {
+ return []string{"server-entry-filter"}
+}
+
+type serverEntryOption struct {
+ prefix string
+ value int
+}
+
+func (o serverEntryOption) Prefix() string {
+ return o.prefix
+}
+
+func (o serverEntryOption) Apply(config extension.Config) error {
+ config.(*serverEntryConfig).Value = o.value
+ return nil
+}
+
+func TestWithExtensionBuildsServerConfigAndMergesFilter(t *testing.T) {
+ const prefix = "server-entry"
+ const filterName = "server-entry-filter"
+
+ extension.UnregisterConfig(prefix)
+ extension.UnregisterFilter(filterName)
+ t.Cleanup(func() {
+ extension.UnregisterConfig(prefix)
+ extension.UnregisterFilter(filterName)
+ })
+
+ var initialized *serverEntryConfig
+ require.NoError(t, extension.RegisterConfig(&serverEntryConfig{
+ prefix:prefix,
+ requiredScope: extension.ServerScope,
+ onInit: func(config *serverEntryConfig) {
+ initialized = config
+ },
+ }))
+ extension.SetFilter(filterName, func() filter.Filter { return nil })
+
+ srv, err := NewServer(
+ SetServerExtensionConfigs(map[string]any{
+ prefix: map[string]any{
+ "provider": map[string]any{"value": 7},
+ },
+ }),
+ WithServerFilter("explicit"),
+ WithExtension(serverEntryOption{prefix: prefix, value: 9}),
+ )
+ require.NoError(t, err)
+ require.NotNil(t, srv)
+ require.NotNil(t, initialized)
+ assert.Equal(t, 9, initialized.Value)
+ assert.Equal(t, extension.ServerScope, initialized.initialized)
+ assert.Equal(t,
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5629578929 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5629402859 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5629262144 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5629083472 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
AlexStocks commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5629038565 ## Review 结果(只读审计,基于 Head ef1f95a8 / Base 832124aa) 已执行:完整 Diff 审查、exact Head 本地复现(`make fmt`、`go test ./common/extension`、`go test -race ./common/extension`、`go test ./client ./server .` 的扩展相关用例、`go vet`,全部通过)。 ### [P1] CI Format required check 失败 `make fmt`(modernize v0.21.1 + imports-formatter)在 `common/extension/config_loader.go` 会产生 3 处改动(`strings.HasPrefix/TrimPrefix` → `strings.CutPrefix`;`strings.Split` → `strings.SplitSeq`),导致 CI "Verify formatter output" 退出码 1,`mergeable_state=unstable`。本地已在 exact Head 复现同样 diff。**请运行 `make fmt` 并提交转换结果。** ### [P2] `options.go:120` InstanceScope 下 filter 名被校验但结果丢弃 `collectFilterNames` 对 InstanceScope 仍强制 `HasFilter` 校验,但 `InstanceOptions.init` 丢弃返回值(Instance 不消费 filter)。扩展在 `FilterNames(InstanceScope)` 返回未注册 filter 名会导致 `NewInstance` 失败。建议 InstanceScope 跳过该校验,或文档明确要求 InstanceScope 返回 nil。 ### [P2] `config_loader.go:111` 多扩展初始化无回滚 按序初始化中第 N 个失败时,前 N-1 个已执行 `Init(scope)`,无清理路径;调用方重试会重复触发已成功扩展的 `Init`(goroutine/连接/全局状态副作用)。建议文档明确 fail-fast 语义或提供清理约定。 ### [P2] `loader.go:175` 热更新不重新初始化扩展 `hotUpdateConfig` 更新了 `extensionConfigs`,但运行中的 Instance 不会重新执行扩展初始化,`dubbo.extensions` 变更被静默忽略。建议检测 extensions 变更并拒绝热更新,或文档声明不支持。 其余核验:Config 原型/New 独立性、Option 顺序、scope 选择、`MergeFilterNames` 与下游 `MergeValue/removeMinus` 的 `-name` 抑制语义闭环、Registry 并发安全(RLock/Lock)、YAML 点分 key 保留、测试隔离(t.Cleanup)均确认无问题。 -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5624907903 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5624906493 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5624835388 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5624622734 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5624364133 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [1 New issue](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
XnLemon commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5508745205 > 现在这个版本合理多了 > > 继续补充入口吧 dubbo.WithExtension(...) client.WithExtension(...) server.WithExtension(...) dubbo.Load() Sure -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] feat(extension): extend config for scoped initialization [dubbo-go]
sonarqubecloud[bot] commented on PR #3687: URL: https://github.com/apache/dubbo-go/pull/3687#issuecomment-5424984422 ## [](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) **Quality Gate passed** Issues  [0 New issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0 Accepted issues](https://sonarcloud.io/project/issues?id=apache_dubbo-go&pullRequest=3687&issueStatuses=ACCEPTED) Measures  [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_dubbo-go&pullRequest=3687&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_coverage&view=list)  [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=apache_dubbo-go&pullRequest=3687&metric=new_duplicated_lines_density&view=list) [See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=apache_dubbo-go&pullRequest=3687) -- 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] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
