Copilot commented on code in PR #1397:
URL: https://github.com/apache/dubbo-admin/pull/1397#discussion_r2701950299
##########
pkg/version/version.go:
##########
@@ -19,40 +19,33 @@ package version
import (
"fmt"
- "runtime"
"strings"
)
var (
- buildVersion = "unknown"
+ buildVersion = "0.7.0"
)
-// type BuildInfo struct {
-// Version string `json:"version"`
-// }
-
-func (b BuildInfo) String() string {
- return fmt.Sprintf("%v", b.Version)
-}
-
-func (b BuildInfo) LongForm() string {
- return fmt.Sprintf("%#v", b)
-}
+var Build BuildInfo
func init() {
- Info = BuildInfo{
- Version: buildVersion,
+ Build = BuildInfo{
+ Product: Product,
+ Version: version,
+ GitTag: gitTag,
+ GitCommit: gitCommit,
+ BuildDate: buildDate,
+ BasedOnDubbo: basedOnDubbo,
}
}
var (
- Product = "Dubbo"
- basedOndubbo = ""
- version = "unknown"
- gitTag = "unknown"
- gitCommit = "unknown"
- buildDate = "unknown"
- Envoy = "unknown"
+ Product = "Dubbo Admin"
+ basedOnDubbo = "Dubbo3.x"
Review Comment:
The variable name has a typo: "basedOndubbo" should be "basedOnDubbo"
(capital D). This inconsistency with the struct field "BasedOnDubbo" could lead
to confusion.
##########
pkg/engine/kubernetes/listerwatcher/runtime_instance.go:
##########
@@ -243,7 +249,10 @@ func (p *PodListerWatcher) getDubboRPCPort(pod *v1.Pod)
int64 {
}
func (p *PodListerWatcher) getDubboMesh(pod *v1.Pod) string {
- identifier := p.cfg.Properties.DubboRegistryIdentifier
+ identifier := p.cfg.Properties.DubboDiscoveryIdentifier
Review Comment:
The field name has changed from "DubboRegistryIdentifier" to
"DubboDiscoveryIdentifier" at line 252. However, the variable is still named
"identifier" which doesn't reflect this semantic change. Consider verifying
this rename is intentional and all usages are updated accordingly, as
"registry" and "discovery" may have different meanings in the domain.
##########
pkg/governor/nacos2/governor.go:
##########
@@ -104,6 +107,8 @@ func (g *RuleGovernor) DeleteRule(r coremodel.Resource)
error {
logger.Errorf("failed to get store in %s, res: %s, cause: %s",
r.String(), r.ResourceMesh(), err)
return nil
}
+ // wait for the config to be deleted indeed
+ <-time.After(2 * time.Second)
Review Comment:
Similar issue with hardcoded sleep. Using arbitrary sleep durations (2
seconds) to wait for config deletion is fragile and adds unnecessary latency.
Consider implementing proper completion notifications or polling mechanisms.
--
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]