Skip to content

fix: update dubbogo CLI templates for Dubbo-Go 3.3 - #3587

Merged
AlexStocks merged 10 commits into
developfrom
codex/fix-cli-template-logger
Aug 1, 2026
Merged

fix: update dubbogo CLI templates for Dubbo-Go 3.3#3587
AlexStocks merged 10 commits into
developfrom
codex/fix-cli-template-logger

Conversation

@AlexStocks

Copy link
Copy Markdown
Contributor

Description

Update dubbogo-cli application and demo templates to compile against Dubbo-Go v3.3.1 and the current Triple client/server API.

This is a follow-up to the v3.3.2 release audit; no separate issue was created.

Changes

  • replace the removed common/logger import with the supported gost logger
  • regenerate embedded Triple stubs with the current generator API and use .triple.go file names
  • update client construction and server registration to NewGreeter and RegisterGreeterHandler
  • implement the generated bidirectional stream handler contract
  • update template Go/Dubbo-Go dependency metadata to Go 1.24 and Dubbo-Go v3.3.1
  • add regression coverage that compiles both generated projects
  • synchronize the English and Chinese README file trees

Testing

Windows, Go 1.26.2:

  • go test ./... -count=1 in tools/dubbogo-cli
  • go test ./... -count=1 in generated newApp
  • go test ./... -count=1 in generated newDemo
  • go vet ./... in all three modules
  • go mod tidy -diff in both generated modules
  • gofmt -l on changed Go files
  • git diff --cached --check

Linux/WSL was not run because the available WSL environment does not have Go installed (go: not found).

Checklist

  • I confirm the target branch is develop
  • Code has passed local testing
  • I have added tests that prove my fix is effective

AI assistance: code / tests / docs
Human verification: reviewed the complete diff and ran the commands listed above

AlexStocks and others added 2 commits August 1, 2026 02:11
Regenerate the embedded Triple stubs for the current client and server APIs, update template dependencies, and compile generated projects in regression tests.

Constraint: Limit the change to tools/dubbogo-cli templates, generated fixtures, dependency metadata, tests, and matching README file names.

Confidence: High; generator-to-golden equality, direct generated-project compilation, module tests, vet, tidy-diff, formatting, and staged diff checks passed.

Scope-risk: Generated applications now require Go 1.24 and Dubbo-Go v3.3.1; Linux was not locally exercised because WSL has no Go toolchain.

Red: TestGeneratedProjectsCompile failed on the removed logger package, legacy NewGreeterClient signature, and legacy RegisterGreeterServer contract.

Green: CLI, newApp, and newDemo tests and vet passed; both generated modules are tidy and compile against Dubbo-Go v3.3.1.

Tested: go test ./... and go vet ./... in tools/dubbogo-cli, newApp, and newDemo; go mod tidy -diff for both generated modules; gofmt -l; git diff --cached --check.

Not-tested: WSL/Linux because go is not installed in the available WSL environment.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
Group the generated project logger import according to the repository imports-formatter rules and keep generator sources synchronized with golden files.

Constraint: Limit the change to the three affected generator templates and their three golden outputs.

Confidence: High; the repository format steps produced no additional diff after the import grouping change.

Scope-risk: Import layout only; generated application behavior and dependencies are unchanged.

Red: The Linux CI Check Code Format step rewrote three golden files and failed make check-fmt.

Green: The equivalent modernize, go fmt, imports-formatter, and CLI go fmt chain leaves no unstaged diff.

Tested: go test ./... and go vet ./... in tools/dubbogo-cli; go vet ./... and go mod tidy -diff in both generated modules; git diff --cached --check.

Not-tested: WSL/Linux locally because Go is not installed in WSL; GitHub Actions will provide the Linux confirmation.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
@codecov-commenter

codecov-commenter commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 54.53%. Comparing base (60d1c2a) to head (ed3c393).
⚠️ Report is 878 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3587      +/-   ##
===========================================
+ Coverage    46.76%   54.53%   +7.76%     
===========================================
  Files          295      460     +165     
  Lines        17172    35443   +18271     
===========================================
+ Hits          8031    19328   +11297     
- Misses        8287    14560    +6273     
- Partials       854     1555     +701     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the tools/dubbogo-cli project/application/demo templates so newly generated projects compile against Dubbo-Go v3.3.1 and the current Triple client/server APIs, including regenerated embedded Triple stubs and new regression tests to prevent template drift.

Changes:

  • Migrates generated templates from the removed dubbo.apache.org/dubbo-go/v3/common/logger to github.com/dubbogo/gost/log/logger, and updates client/server wiring to NewGreeter and RegisterGreeterHandler.
  • Regenerates embedded Triple stubs using the newer generator output and renames generated stub files to *.triple.go.
  • Adds regression tests to ensure generated templates don’t import the removed logger package and that both generated projects compile.

Reviewed changes

Copilot reviewed 18 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/dubbogo-cli/README.md Updates documented generated file tree to the new *.triple.go stub naming.
tools/dubbogo-cli/README_CN.md Mirrors the README tree updates for the Chinese documentation.
tools/dubbogo-cli/generator/sample/mod.go Updates the newDemo module template dependencies and Go version metadata.
tools/dubbogo-cli/generator/sample/gen_server.go Updates generated server template to new handler registration API and implements stream handler contract.
tools/dubbogo-cli/generator/sample/gen_client.go Updates generated client template to new NewGreeter constructor and client URL format.
tools/dubbogo-cli/generator/sample/api_tripe.go Regenerates embedded Triple stub template and switches output filename to samples_api.triple.go.
tools/dubbogo-cli/generator/application/pkg.go Updates generated application service implementation to new stream handler signature + gost logger.
tools/dubbogo-cli/generator/application/gomod.go Updates the newApp module template dependencies and Go version metadata.
tools/dubbogo-cli/generator/application/cmd.go Updates generated application main to use RegisterGreeterHandler.
tools/dubbogo-cli/generator/application/api.go Replaces embedded Triple stubs with the new generated API and writes api.triple.go.
tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go.mod Updates the checked-in newDemo template module metadata for Dubbo-Go v3.3.1.
tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go-server/cmd/server.go Updates the checked-in demo server template for the new server registration + streaming contract.
tools/dubbogo-cli/cmd/testGenCode/template/newDemo/go-client/cmd/client.go Updates the checked-in demo client template for the new NewGreeter constructor and URL format.
tools/dubbogo-cli/cmd/testGenCode/template/newDemo/api/samples_api.triple.go Adds regenerated checked-in Triple stub file with the new API surface.
tools/dubbogo-cli/cmd/testGenCode/template/newDemo/api/samples_api_triple.pb.go Removes the legacy *_triple.pb.go generated stub file.
tools/dubbogo-cli/cmd/testGenCode/template/newApp/pkg/service/service.go Updates checked-in app service implementation for gost logger and streaming handler contract.
tools/dubbogo-cli/cmd/testGenCode/template/newApp/go.mod Updates the checked-in newApp template module metadata for Dubbo-Go v3.3.1.
tools/dubbogo-cli/cmd/testGenCode/template/newApp/cmd/app.go Updates checked-in app main to use RegisterGreeterHandler.
tools/dubbogo-cli/cmd/testGenCode/template/newApp/api/api.triple.go Adds regenerated checked-in Triple stub file with the new API surface.
tools/dubbogo-cli/cmd/testGenCode/template/newApp/api/api_triple.pb.go Removes the legacy *_triple.pb.go generated stub file.
tools/dubbogo-cli/cmd/gen_test.go Adds regression tests for removed logger import and compilation of both generated template projects.
Files not reviewed (3)
  • tools/dubbogo-cli/cmd/testGenCode/template/newApp/api/api.triple.go: Generated file
  • tools/dubbogo-cli/cmd/testGenCode/template/newDemo/api/samples_api.triple.go: Generated file
  • tools/dubbogo-cli/generator/sample/api_tripe.go: Generated file

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 245 to 251
func init() {
fileMap["apiTripleFile"] = &fileGenerator{
path: "./api",
file: "samples_api_triple.pb.go",
file: "samples_api.triple.go",
context: license + "\n" + apiTripleFile,
}
}
AlexStocks and others added 7 commits August 1, 2026 11:18
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
Record the exact merge conflict policy, TDD steps, Linux E2E coverage, mutation proof, and race-safe push checks needed to reconcile the two CLI template pull requests.

Constraint: Preserve the scaffold architecture already merged through PR 3585

Tested: plan placeholder scan and staged whitespace validation

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
Merge the latest develop history while resolving all overlapping CLI scaffold files to the architecture already accepted through PR 3585.

Constraint: Do not restore embedded generated sources or template go.sum files

Tested: staged tree matches origin/develop except the approved design and plan documents

Related: Task 1/7

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
Replace the dated prerelease dependency in both generators and golden projects while retaining the removed-logger regression guard.

Constraint: Keep the generated module language version at Go 1.25

Tested: targeted generator version logger and golden consistency tests

Related: Task 2/7

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
Generate protocol sources and tidy modules before compilation, then exercise that public workflow against newly generated app and demo projects.

Constraint: Generated protobuf and Triple sources remain outside the templates

Tested: DUBBOGO_CLI_E2E=1 generated-project compilation and golden consistency tests

Related: Task 3/7

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
Use errors.Is in both generator templates and golden outputs so wrapped end-of-stream errors terminate normally instead of being returned as failures.

Constraint: Preserve the existing stream control flow outside EOF classification

Tested: generated-output EOF assertions golden consistency and fresh-project compilation

Related: Task 4/7

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
Install the protocol generators used by fresh projects and run the explicit generated-project E2E target before the existing repository checks.

Constraint: Ordinary CLI unit tests remain independent of a local protoc toolchain

Tested: make generated-project target and environment-gated skip behavior

Related: Task 5/7

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
Comment thread .github/workflows/github-actions.yml Outdated
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
Resolve protoc-gen-go through the root go.mod and go.sum with -mod=readonly so the CI toolchain remains pinned to v1.34.2 without an inline version literal.

Constraint: Keep the generated-project toolchain reproducible and satisfy SonarCloud githubactions:S8545 without suppressions

Tested: isolated GOBIN install plus make -C tools/dubbogo-cli test-generated-projects

Related: PR #3587 SonarCloud follow-up

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
@sonarqubecloud

sonarqubecloud Bot commented Aug 1, 2026

Copy link
Copy Markdown

@AlexStocks
AlexStocks merged commit 144d127 into develop Aug 1, 2026
8 checks passed
AlexStocks added a commit that referenced this pull request Aug 1, 2026
Include the toolchain and generated-project work merged through PRs #3585 and #3587 so the canonical changelog reflects the release candidate now present on develop.

Constraint: Limit the repository change to CHANGELOG.md while maintaining the separate unpublished Release and Discussion drafts outside the checkout.

Confidence: high

Scope-risk: narrow

Tested: git diff --cached --check; 106-link release-range gate; direct source checks for tool versions, generator defaults, CLI proto generation, wrapped EOF handling, and Linux generated-project CI.

Not-tested: Code tests were not rerun because this follow-up changes release prose only and the merged implementation PRs already passed their GitHub checks.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
AlexStocks added a commit that referenced this pull request Aug 1, 2026
* docs: make the Dubbo-Go 3.3.2 release scope auditable

Record the exact v3.3.1-to-3.3.2 release range so maintainers and users can identify upgrade-impacting changes, notable fixes, supporting documentation, CI updates, and contributors from one canonical changelog entry.

Constraint: Limit the release-documentation commit to CHANGELOG.md and changes merged in v3.3.1..53d81d1.

Confidence: high

Scope-risk: narrow

Tested: git diff --cached --check; exact release-range validation for all 104 linked PRs; contributor-set validation for 34 human contributors.

Not-tested: Code tests were not run because this commit changes release documentation only.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>

* docs: keep v3.3.2 notes aligned with the final merge range

Include the toolchain and generated-project work merged through PRs #3585 and #3587 so the canonical changelog reflects the release candidate now present on develop.

Constraint: Limit the repository change to CHANGELOG.md while maintaining the separate unpublished Release and Discussion drafts outside the checkout.

Confidence: high

Scope-risk: narrow

Tested: git diff --cached --check; 106-link release-range gate; direct source checks for tool versions, generator defaults, CLI proto generation, wrapped EOF handling, and Linux generated-project CI.

Not-tested: Code tests were not rerun because this follow-up changes release prose only and the merged implementation PRs already passed their GitHub checks.

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>

* docs: describe the final 3.3.2 CLI scaffold state

Remove the superseded dependency-lock claim because PR #3585 deleted the template go.sum files and replaced embedded dependency metadata with generated-project proto and tidy workflows.

Constraint: Limit the repository fix to the reviewed CHANGELOG.md line and keep unpublished release drafts outside the PR.

Confidence: high

Scope-risk: narrow

Tested: git diff --cached --check; 105-link release-range gate; final develop tree check for removed go.sum and gosum.go artifacts; stale-claim scan across Release and Discussion drafts.

Not-tested: Code tests were not rerun because this correction changes release prose only.

Related: PR #3588 review comment 3694862025

Co-authored-by: OmX <omx@oh-my-codex.dev>
Signed-off-by: Xin.Zh <alexstocks@foxmail.com>

* docs: standardize Dubbo-go naming in 3.3.2 notes

Signed-off-by: Xin.Zh <alexstocks@foxmail.com>

---------

Signed-off-by: Xin.Zh <alexstocks@foxmail.com>
Co-authored-by: OmX <omx@oh-my-codex.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.3.2 version 3.3.2 ☢️ Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

全面升级 tools:更新文档、版本号、依赖与代码生成模板

5 participants