chore(ci): replace hardcoded server commit with latest release#732
Open
lokidundun wants to merge 8 commits intoapache:masterfrom
Open
chore(ci): replace hardcoded server commit with latest release#732lokidundun wants to merge 8 commits intoapache:masterfrom
lokidundun wants to merge 8 commits intoapache:masterfrom
Conversation
Agent-Logs-Url: https://github.com/lokidundun/hugegraph-toolchain/sessions/6d86bea0-38a3-45d5-8e70-13d5e64b21bf Co-authored-by: lokidundun <206712414+lokidundun@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates CI workflows to follow the latest Apache HugeGraph stable release automatically (instead of pinned SHAs), and adjusts the Go Gremlin client to work with HugeGraph 1.7.0+ graph-space traversal source bindings.
Changes:
- CI: replace hardcoded
COMMIT_IDin multiple workflows with agithub-scriptstep that resolves the latest release tag to a commit SHA. - CI (loader): key the HugeGraph server cache using the resolved release commit.
- Go client: send default Gremlin
aliaseson POST requests and update Gremlin tests to useg.V().
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
hugegraph-client-go/api/v1/gremlin/gemlin.go |
Switch Gremlin POST aliases to a map and auto-inject default aliases for HugeGraph 1.7.0+. |
hugegraph-client-go/api/v1/gremlin/gemlin_test.go |
Update Gremlin test to use g.V() and improve failure reporting. |
.github/workflows/tools-ci.yml |
Resolve COMMIT_ID from latest HugeGraph release tag via actions/github-script. |
.github/workflows/spark-connector-ci.yml |
Resolve COMMIT_ID from latest HugeGraph release tag via actions/github-script. |
.github/workflows/loader-ci.yml |
Resolve COMMIT_ID dynamically and adjust server cache key/path to the resolved commit. |
.github/workflows/hubble-ci.yml |
Resolve COMMIT_ID from latest HugeGraph release tag via actions/github-script. |
.github/workflows/client-go-ci.yml |
Resolve COMMIT_ID from latest HugeGraph release tag via actions/github-script. |
.github/workflows/client-ci.yml |
Resolve COMMIT_ID from latest HugeGraph release tag via actions/github-script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const { data: tag } = await github.rest.git.getTag({ owner, repo, tag_sha: sha }); | ||
| sha = tag.object.sha; | ||
| } | ||
| sha = sha.substring(0, 7); |
| const { data: tag } = await github.rest.git.getTag({ owner, repo, tag_sha: sha }); | ||
| sha = tag.object.sha; | ||
| } | ||
| sha = sha.substring(0, 7); |
Comment on lines
+134
to
+145
| 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, | ||
| } | ||
| } |
Comment on lines
+132
to
+133
| // Sending these aliases lets scripts use `g.V()` against the active graph | ||
| // regardless of how the server names its bindings internally. |
Comment on lines
+42
to
+43
| t.Errorf("client.Gremlin.Post status=%d, message=%s", | ||
| respPost.StatusCode, respPost.Data.Message) |
| const { data: tag } = await github.rest.git.getTag({ owner, repo, tag_sha: sha }); | ||
| sha = tag.object.sha; | ||
| } | ||
| sha = sha.substring(0, 7); |
| const { data: tag } = await github.rest.git.getTag({ owner, repo, tag_sha: sha }); | ||
| sha = tag.object.sha; | ||
| } | ||
| sha = sha.substring(0, 7); |
| const { data: tag } = await github.rest.git.getTag({ owner, repo, tag_sha: sha }); | ||
| sha = tag.object.sha; | ||
| } | ||
| sha = sha.substring(0, 7); |
| const { data: tag } = await github.rest.git.getTag({ owner, repo, tag_sha: sha }); | ||
| sha = tag.object.sha; | ||
| } | ||
| sha = sha.substring(0, 7); |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #732 +/- ##
=============================================
- Coverage 62.49% 39.34% -23.16%
- Complexity 1903 2199 +296
=============================================
Files 262 468 +206
Lines 9541 17353 +7812
Branches 886 1819 +933
=============================================
+ Hits 5963 6828 +865
- Misses 3190 10038 +6848
- Partials 388 487 +99 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose of the PR
Main Changes
All 6 workflows (client-ci, client-go-ci, hubble-ci, loader-ci, spark-connector-ci, tools-ci) previously had a # TODO: replace it with the (latest - n) commit id (n >= 15)
reminder with a manually-pinned COMMIT_ID. These SHAs drift out of date and silently miss server-side regressions.
Replaced the static value with an actions/github-script@v7 step that:
CI now follows the most recent stable release with zero manual upkeep.
Reused the resolved release SHA as a cache key (~/hugegraph-cache-${commit_id}) so subsequent CI runs skip the server build entirely as long as the upstream release hasn't
moved.
Server 1.7.0 introduced graph spaces and changed how the gremlin engine registers traversal sources — the graph is no longer a top-level Groovy global named , it's now
aliased as __g_DEFAULT- (where DEFAULT is the default graph space). The Java client was updated for this in GremlinManager.java; the Go client was not, so every gremlin
POST against a 1.7.0+ server failed with:
Could not rebind [g] to [__g_hugegraph] as [__g_hugegraph] not in the Graph or TraversalSource global bindings
Ported the Java behavior:
"__g_DEFAULT-"} when the caller hasn't supplied custom aliases.
JSON aliases query params due to a Jersey URI-template parser conflict on { / }.
to match Java's g.V().count() convention, and surfaced server status/message on failure for easier diagnosis.
Verifying these changes
Does this PR potentially affect the following parts?
Documentation Status
Doc - TODODoc - DoneDoc - No Need