lokidundun opened a new pull request, #732:
URL: https://github.com/apache/hugegraph-toolchain/pull/732
<!--
Thank you very much for contributing to Apache HugeGraph, we are happy
that you want to help us improve it!
Here are some tips for you:
1. If this is your first time, please read the [contributing
guidelines](https://github.com/apache/hugegraph/blob/master/CONTRIBUTING.md)
2. If a PR fix/close an issue, type the message "close xxx" (xxx is the
link of related
issue) in the content, GitHub will auto link it (Required)
3. Name the PR title in "Google Commit Format", start with "feat | fix |
perf | refactor | doc | chore",
such like: "feat(core): support the PageRank algorithm" or "fix: wrong
break in the compute loop" (module is optional)
skip it if you are unsure about which is the best component.
4. One PR address one issue, better not to mix up multiple issues.
5. Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]` (or click
it directly after
published)
-->
## Purpose of the PR
- close #xxx <!-- or use "fix #xxx", "xxx" is the ID-link of related issue,
e.g: close #1024 -->
<!--
Please explain more context in this section, clarify why the changes are
needed.
e.g:
- If you propose a new API, clarify the use case for a new API.
- If you fix a bug, you can clarify why it is a bug, and should be
associated with an issue.
-->
## Main Changes
1. CI: track latest HugeGraph stable release instead of hardcoded commit
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:
- queries apache/hugegraph's latest GitHub release via getLatestRelease
- resolves the tag through getRef and dereferences annotated tags via
getTag (lightweight tags work too)
- exports the 7-char SHA as COMMIT_ID for downstream
install-hugegraph-from-source.sh $COMMIT_ID
CI now follows the most recent stable release with zero manual upkeep.
2. loader-ci: cache the built HugeGraph server
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.
3. hugegraph-client-go: adapt gremlin to HugeGraph 1.7.0+ graph-space
bindings
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 <graph>, it's now
aliased as __g_DEFAULT-<graph> (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:
- gemlin.go: aliases field on PostRequest / PostRequestData is now
map[string]string (was an empty anonymous struct that silently dropped values).
- Added buildDefaultAliases(transport) mirroring GremlinManager.java:46-56
and HugeClientBuilder.DEFAULT_GRAPHSPACE = "DEFAULT": returns {"graph":
"DEFAULT-<g>", "g":
"__g_DEFAULT-<g>"} when the caller hasn't supplied custom aliases.
- PostRequest.Do auto-injects on every gremlin POST. GET is intentionally
untouched — the Java client has no GET equivalent, and the server's /gremlin
GET endpoint cannot accept
JSON aliases query params due to a Jersey URI-template parser conflict on
{ / }.
- gemlin_test.go: removed the GET assertion (would 500 on 1.7.0+
regardless of client changes), changed the POST script from
hugegraph.traversal().V().limit(3) to g.V().limit(3)
to match Java's g.V().count() convention, and surfaced server
status/message on failure for easier diagnosis.
---
<!-- Please clarify what changes you are proposing. The purpose of this
section is to outline the changes and how this PR fixes the issue. These change
logs are helpful for better ant faster reviews.)
For example:
- If you introduce a new feature, please show detailed design here or add
the link of design documentation.
- If you refactor some codes with changing classes, showing the class
hierarchy will help reviewers.
- If there is a discussion in the mailing list, please add the link. -->
## Verifying these changes
<!-- Please pick the proper options below -->
- [ ] Trivial rework / code cleanup without any test coverage. (No Need)
- [ ] Already covered by existing tests, such as *(please modify tests
here)*.
- [ ] Need tests and can be verified as follows:
- xxx
## Does this PR potentially affect the following parts?
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] Nope
- [ ] Dependencies (add/update license info) <!-- Don't forget to
add/update the info in "LICENSE" & "NOTICE" files (both in root & dist module)
-->
- [ ] Modify configurations
- [ ] The public API
- [ ] Other affects (typed here)
## Documentation Status
<!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
- [ ] `Doc - TODO` <!-- Your PR changes impact docs and you will update
later -->
- [ ] `Doc - Done` <!-- Related docs have been already added or updated -->
- [ ] `Doc - No Need` <!-- Your PR changes don't impact/need docs -->
--
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]