refactor: remove config package dependency from dubbogo-cli sample generator#3217
Closed
CAICAIIs wants to merge 4 commits intoapache:developfrom
Closed
Conversation
…nerator Replace deprecated config.Load() pattern with direct server.NewServer() and client.NewClient() API in tools/dubbogo-cli/generator/sample. Changes: - Remove config package imports from gen_client.go and gen_server.go - Replace config.SetConsumerService() with client.NewClient() + api.NewGreeterClient() - Replace config.SetProviderService() with server.NewServer() + api.RegisterGreeterServer() - Remove DUBBO_GO_CONFIG_PATH environment variable dependency - Disable YAML config file generation (gen_c_conf.go, gen_s_conf.go) - Use programmatic configuration via Go API options This aligns with the config-free migration strategy and removes the dependency on the deprecated config package for code generation. Related: apache#3204
Delete client and server config files (dubbogo.yaml) from the testGenCode/template/newDemo directory. This aligns with the config-free approach implemented in the sample generator. - Removed go-client/conf/dubbogo.yaml - Removed go-server/conf/dubbogo.yaml - New Demo now only generates 6 files (no config files) Fixes test failure: TestNewDemo expects 6 files instead of 8
Update go-client/cmd/client.go and go-server/cmd/server.go in testGenCode/template/newDemo/ to match the new config-free approach: - Replace config.SetConsumerService() + config.Load() with client.NewClient() - Replace config.SetProviderService() + config.Load() with server.NewServer() - Use api.NewGreeterClient(cli) instead of grpcGreeterImpl - Use api.RegisterGreeterServer(srv, provider) instead of config registration - Remove DUBBO_GO_CONFIG_PATH environment variable comments This aligns the test templates with the generator implementation, fixing the TestNewDemo test failure. Related: apache#3204
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Replace deprecated config.Load() pattern with direct server.NewServer() and client.NewClient() API in tools/dubbogo-cli/generator/sample.
Changes:
This aligns with the config-free migration strategy and removes the dependency on the deprecated config package for code generation.
Description
Related: #3204
Checklist
develop