Copilot commented on code in PR #732:
URL: 
https://github.com/apache/hugegraph-toolchain/pull/732#discussion_r3207285869


##########
.github/actions/get-hugegraph-commit/action.yml:
##########
@@ -0,0 +1,30 @@
+name: 'Get HugeGraph stable commit id'
+description: 'Fetch the latest HugeGraph release commit SHA and expose it as 
output and env variable'
+
+outputs:
+  commit_id:
+    description: 'The commit SHA of the latest HugeGraph release'
+    value: ${{ steps.get-commit.outputs.commit_id }}
+
+runs:
+  using: composite
+  steps:
+    - name: Get HugeGraph stable commit id
+      id: get-commit
+      uses: actions/github-script@v7
+      with:
+        script: |
+          const owner = 'apache';
+          const repo = 'hugegraph';
+          const { data: release } = await github.rest.repos.getLatestRelease({ 
owner, repo });
+          const { data: ref } = await github.rest.git.getRef({
+            owner, repo, ref: `tags/${release.tag_name}`
+          });
+          let sha = ref.object.sha;
+          if (ref.object.type === 'tag') {
+            const { data: tag } = await github.rest.git.getTag({ owner, repo, 
tag_sha: sha });
+            sha = tag.object.sha;
+          }
+          core.exportVariable('COMMIT_ID', sha);
+          core.setOutput('commit_id', sha);
+          console.log(`Using HugeGraph release ${release.tag_name} (${sha})`);

Review Comment:
   The PR description says this step “exports the 7-char SHA as COMMIT_ID”, but 
the action currently exports/outputs the full 40-char SHA. Either shorten the 
SHA before exporting/setting the output, or update the PR description/docs so 
cache keys, log messages, and downstream scripts consistently reflect the full 
SHA length.



##########
.github/actions/setup-java-env/action.yml:
##########
@@ -0,0 +1,40 @@
+name: 'Setup Java and Maven Environment'
+description: 'Install JDK, cache Maven packages, and optionally apply staged 
Maven repository settings'
+
+inputs:
+  java-version:
+    description: 'Java version to install'
+    required: false
+    default: '11'
+  distribution:
+    description: 'JDK distribution'
+    required: false
+    default: 'zulu'
+  use-stage:
+    description: 'Whether to apply staged Maven repository settings'
+    required: false
+    default: 'true'
+
+runs:
+  using: composite
+  steps:
+    - name: Install JDK ${{ inputs.java-version }}
+      uses: actions/setup-java@v4
+      with:
+        java-version: ${{ inputs.java-version }}
+        distribution: ${{ inputs.distribution }}
+        cache: 'maven'
+
+    - name: Cache Maven packages
+      uses: actions/cache@v4
+      with:
+        path: ~/.m2/repository
+        key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
+        restore-keys: ${{ runner.os }}-maven-
+

Review Comment:
   `actions/setup-java` with `cache: 'maven'` already manages a Maven 
dependency cache; adding a separate `actions/cache` step for `~/.m2/repository` 
is redundant and can increase CI time/complexity. Consider dropping one of the 
caching mechanisms (usually keep `setup-java`'s built-in cache) to avoid double 
cache save/restore work.
   



##########
hugegraph-client-go/api/v1/gremlin/gemlin.go:
##########
@@ -132,6 +126,19 @@ func (g Post) WithGremlin(gremlin string) func(request 
*PostRequest) {
     }
 }
 
+func buildDefaultAliases(transport api.Transport) map[string]string {
+    cfg := transport.GetConfig()
+    graphSpace := cfg.GraphSpace
+    if graphSpace == "" {
+        graphSpace = "DEFAULT"
+    }
+    full := graphSpace + "-" + cfg.Graph
+    return map[string]string{
+        "graph": full,
+        "g":     "__g_" + full,
+    }

Review Comment:
   `buildDefaultAliases()` always falls back to graphSpace="DEFAULT" when 
`cfg.GraphSpace` is empty, which forces graph-space style aliases ("graph": 
"DEFAULT-<graph>", "g": "__g_DEFAULT-<graph>") even when the client is 
configured without a graph space. This differs from the Java client's logic (it 
uses legacy aliases when GS isn't supported) and can break Gremlin POSTs 
against servers that don't support graph spaces (they typically only have 
bindings like "__g_<graph>"). Consider making the default alias behavior 
conditional (e.g., legacy aliases when `GraphSpace` is empty), or adding a 
lightweight capability/version check similar to the Java client before choosing 
GS-style aliases.



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