Copilot commented on code in PR #1477:
URL: https://github.com/apache/dubbo-admin/pull/1477#discussion_r3487690453


##########
pkg/core/versioning/normalize.go:
##########
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package versioning
+
+import (
+       "crypto/sha256"
+       "encoding/hex"
+       "encoding/json"
+       "fmt"
+
+       "google.golang.org/protobuf/encoding/protojson"
+       "google.golang.org/protobuf/proto"
+
+       meshproto "github.com/apache/dubbo-admin/api/mesh/v1alpha1"
+       "github.com/apache/dubbo-admin/pkg/common/bizerror"
+       meshresource 
"github.com/apache/dubbo-admin/pkg/core/resource/apis/mesh/v1alpha1"
+       coremodel "github.com/apache/dubbo-admin/pkg/core/resource/model"
+)
+
+// DeleteSpecJSON is the canonical snapshot stored for a rule delete marker.
+const DeleteSpecJSON = "{}"
+
+// NormalizeSpec returns canonical JSON and its hash for stable comparisons.
+// It does not validate whether the spec is acceptable to the registry.
+func NormalizeSpec(spec coremodel.ResourceSpec) (string, string, error) {
+       if spec == nil {
+               return HashSpecJSON(DeleteSpecJSON), DeleteSpecJSON, nil

Review Comment:
   `NormalizeSpec` currently returns `(hash, specJSON, err)` (see the return 
statements), but the comment says it returns canonical JSON and its hash. This 
is misleading and can easily cause call sites to swap the values when using the 
helper. Please clarify the return order (or use named return values) so future 
uses are unambiguous.



##########
ui-vue3/src/views/traffic/tagRule/tabs/formView.vue:
##########
@@ -97,6 +97,16 @@
               }}
             </a-typography-paragraph>
           </a-descriptions-item>
+          <a-descriptions-item label="版本历史" :labelStyle="{ fontWeight: 'bold' 
}">

Review Comment:
   This descriptions label is hard-coded as "版本历史" while the rest of the labels 
in this section use i18n (`$t(...)`). This will show Chinese even when the UI 
locale is English. Use the existing `flowControlDomain.versionRecords` key for 
the label as well.



-- 
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]

Reply via email to