Vanillaxi opened a new pull request, #3413:
URL: https://github.com/apache/dubbo-go/pull/3413
### Why
Before making changes, I scanned `tools/variadicrpccheck` for remaining
legacy `config` references. The tool itself does not directly import
`dubbo.apache.org/dubbo-go/v3/config`, but its scanner rules and test fixtures
still kept legacy config-based registration handling, including:
- `(*config.ServiceConfig).Implement(...)`
- `config.SetProviderService(...)`
- `config.SetProviderServiceWithInfo(...)`
These references were mainly in:
- `tools/variadicrpccheck/scan.go`
- `tools/variadicrpccheck/helpers_test.go`
- `tools/variadicrpccheck/scan_test.go`
Although these were not runtime imports, they kept `variadicrpccheck` aware
of the legacy `config` package and would become stale anchors when the `config`
package is removed later.
### What changed
This PR removes legacy `config` registration handling and related fixtures
from `tools/variadicrpccheck`.
Changes include:
1. Remove legacy config-based registration matching from `scan.go`:
- Remove `dubboConfigPkgPath`
- Remove `configServiceConfigType`
- Stop matching `(*config.ServiceConfig).Implement(...)`
- Stop matching `config.SetProviderService(...)`
- Stop matching `config.SetProviderServiceWithInfo(...)`
2. Keep the currently relevant registration paths:
- `server.Register(...)`
- `server.RegisterService(...)`
- `(*server.ServiceOptions).Implement(...)`
- root package `dubbo.SetProviderService(...)`
- root package `dubbo.SetProviderServiceWithInfo(...)`
- generated `Register*Handler(...)`
- wrapper forwarding tracing
3. Clean up legacy `config` fixtures in `scan_test.go`:
- Remove the test dedicated to `config.SetProviderServiceWithInfo(...)`
- Update wrapper and interface-variable fixtures from
`config.SetProviderServiceWithInfo(...)` to root
`dubbo.SetProviderServiceWithInfo(...)`
4. Clean up synthetic `config` objects in `helpers_test.go`:
- Remove `types.NewPackage("dubbo.apache.org/dubbo-go/v3/config",
"config")`
- Remove `ServiceConfig.Implement` coverage
- Update related selector/object tests to use root
`dubbo.SetProviderService(...)`
### Scope
This PR only changes `tools/variadicrpccheck` scanner rules and tests.
It does not change runtime business logic, and it does not modify `go.mod`
or `go.sum`.
The scanner can still detect variadic RPC contracts registered through the
currently retained registration paths, but it no longer keeps compatibility
logic for the legacy `config` registration APIs.
This PR intentionally does not touch `compat.go`, `dubbo_test.go`,
`compat_test.go`, or graceful-shutdown related files, since those are separate
cleanup targets under #3396.
### Verification
Passed:
```bash
go test ./tools/variadicrpccheck
make rpc-contract-check
git diff --check
```
Also verified that no legacy `config` package path or legacy config
registration API remains under `tools/variadicrpccheck`:
```bash
rg -n
"dubbo\.apache\.org/dubbo-go/v3/config|dubboConfigPkgPath|configServiceConfigType|configPkg|legacyconfig"
tools/variadicrpccheck
rg -n
"config\.SetProviderService|config\.SetProviderServiceWithInfo|config\.ServiceConfig|ServiceConfig\.Implement"
tools/variadicrpccheck
```
Both `rg` checks returned no matches.
### Related issue
Part of #3396
--
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]