Alanxtl opened a new issue, #3581: URL: https://github.com/apache/dubbo-go/issues/3581
## Background The `tools` directory has not been comprehensively refreshed for a long time. Several tool READMEs, version constants, installation commands, dependencies, and generated-code templates still reflect older pre-migration or early v3-era usage. This is especially visible in `dubbogo-cli`: newly generated projects still include old dependency versions and old `protoc-gen-go-triple` generated code, so users can create a brand-new project and immediately get deprecated-style code and stale usage patterns. ## Scope ### 1. Update tools documentation Refresh the documentation for: - `tools/dubbogo-cli/README.md` - `tools/dubbogo-cli/README_CN.md` - `tools/protoc-gen-go-triple/README.md` - `tools/protoc-gen-triple-openapi/README.md` The docs should remove stale pre-migration paths such as: - `github.com/dubbogo/*` - `github.com/apache/dubbo-go/tools/...` Installation examples should use the current module paths, for example: ```bash go install dubbo.apache.org/dubbo-go/v3/tools/<tool>@latest ``` The generated-project workflow and `proto-gen` commands should also be updated to match the current toolchain. ### 2. Update tool version constants Some tools still report old versions, for example `dubbogo-cli` reports `1.0.0`. Please review and update version constants for tools such as: - `dubbogo-cli` - `imports-formatter` - `protoc-gen-go-triple` - `protoc-gen-triple-openapi` ### 3. Upgrade tool module dependencies Review and update dependencies in: - `tools/dubbogo-cli/go.mod` - `tools/imports-formatter/go.mod` - `tools/protoc-gen-go-triple/go.mod` - `tools/protoc-gen-triple-openapi/go.mod` Known stale examples in `tools/dubbogo-cli/go.mod` include: - `dubbo.apache.org/dubbo-go/v3 v3.0.1` - `github.com/spf13/cobra v1.4.0` - `github.com/spf13/viper v1.10.1` - `github.com/stretchr/testify v1.7.1` ### 4. Fix `dubbogo-cli install` `dubbogo-cli install` still points to old or no-longer-existing tool paths, such as: - `github.com/dubbogo/tools/cmd/imports-formatter@latest` - `github.com/dubbogo/tools/cmd/protoc-gen-dubbo3grpc@latest` - `github.com/dubbogo/protoc-gen-go-triple/v3@latest` It should install supported tools from the current repository/module paths. `install all` should only include tools that actually exist and are still supported. Consider including currently maintained tools such as: - `imports-formatter` - `protoc-gen-go-triple` - `protoc-gen-triple-openapi` ### 5. Refresh `dubbogo-cli` generated templates `dubbogo-cli newApp` and `dubbogo-cli newDemo` currently include generated files such as: - `api.pb.go` - `api_triple.pb.go` - `samples_api.pb.go` - `samples_api_triple.pb.go` These files still show old generator versions, for example: - `protoc-gen-go v1.26.0` - `protoc v3.14.0` - `protoc-gen-go-triple v1.0.8` They also still reference older generated-code dependencies such as: - `github.com/dubbogo/grpc-go` - `github.com/dubbogo/triple` Please regenerate these templates with the current `protoc-gen-go` and the current in-repository `protoc-gen-go-triple`, so newly created projects do not start with deprecated code. ### 6. Simplify generated dependency snapshots The generated templates currently include large stale indirect dependency snapshots and old `go.sum` content. Suggested direction: - Keep generated `go.mod` files focused on necessary direct dependencies. - Let `go mod tidy` produce the final `go.sum` for the generated project. - Avoid hard-coding historical indirect dependency snapshots into new projects. ## Acceptance Criteria - `dubbogo-cli install all` installs only valid, supported tool paths. - `dubbogo-cli newApp` and `dubbogo-cli newDemo` no longer emit deprecated-style Triple generated code. - Generated templates no longer pin `dubbo-go` to old versions such as `v3.0.1`. - Tools documentation contains no stale pre-migration repository paths or install commands. - Tool module dependencies are refreshed and tidied. - The following pass: ```bash cd tools/dubbogo-cli && go test ./... cd tools/imports-formatter && go test ./... cd tools/protoc-gen-go-triple && go test ./... cd tools/protoc-gen-triple-openapi && go test ./... ``` - If generated protobuf/Triple files are updated, regenerate them in an environment with the complete toolchain, such as WSL or CI, and include the generated diff in the PR. ## Suggested PR Split This can be split into smaller PRs: 1. Documentation and install-path fixes. 2. Tool dependency upgrades. 3. CLI generated-template regeneration. 4. Version constants and release-process 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]
