Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
187 commits
Select commit Hold shift + click to select a range
4e1fa0f
chore(build): prepare shared validation tools
imbajin Oct 3, 2026
ef29d9c
fix(ci): forward server source selection
imbajin Oct 3, 2026
e9bb4d0
fix(hubble): retain Mockito test compatibility
imbajin Oct 3, 2026
e6210bc
fix(ci): run server fixture contract checks
imbajin Oct 3, 2026
6a57448
fix(ci): include client installer in path filters
imbajin Oct 3, 2026
36afd26
fix(client): prepare legacy graph compatibility
imbajin Oct 3, 2026
726c8cd
chore(spark): prepare connector for java 17
imbajin Oct 3, 2026
f974e79
chore(spark): align runtime license inventory
imbajin Oct 3, 2026
812cb89
fix(spark): use the host logging provider
imbajin Oct 3, 2026
00d84bf
fix(loader): prepare tests and close clients
imbajin Oct 3, 2026
7816bfe
chore(spark): match host-provided logging licenses
imbajin Oct 3, 2026
38f3734
fix(loader): preserve JVM and close failures
imbajin Oct 3, 2026
3e5cfe1
fix(tools): preserve plain HDFS backups
imbajin Oct 3, 2026
5875f81
docs(spark): clarify driver deployment paths
imbajin Oct 3, 2026
38894b0
fix(loader): retain profiles and close state
imbajin Oct 3, 2026
aa59d48
fix(tools): honor auth test server URL
imbajin Oct 3, 2026
02b576e
feat(hubble): prepare Java 17 runtime
imbajin Oct 3, 2026
114f9cd
chore(hubble): validate released Server baseline
imbajin Oct 3, 2026
e9e8fd6
chore(hubble): align runtime license inventory
imbajin Oct 3, 2026
3dec21d
chore(hubble): preserve separate Server JVM
imbajin Oct 3, 2026
2c29a74
chore(hubble): retain baseline dependency entries
imbajin Oct 3, 2026
0a0a2c7
chore(hubble): retain baseline Jetty notice
imbajin Oct 3, 2026
cb431b0
chore(hubble): classify retained baseline license
imbajin Oct 3, 2026
6623e1f
fix(hubble): validate metadata before startup
imbajin Oct 3, 2026
311693f
chore(hubble): cover bundled Jackson licenses
imbajin Oct 3, 2026
b844eb9
fix(hubble): preserve local H2 connection identity
imbajin Oct 3, 2026
cc94156
chore(hubble): use Java 17 for reactor CI
imbajin Oct 3, 2026
6fd131c
chore: collect reviewed module prerequisites
imbajin Oct 3, 2026
882c1c8
chore: complete module prerequisite union
imbajin Oct 3, 2026
d5aa234
fix(spark): run the server fixture on java 11
imbajin Oct 3, 2026
49b8eed
chore: retain server fixture Java isolation
imbajin Oct 3, 2026
b2feece
fix(ci): disable fixture checkout credentials
imbajin Oct 3, 2026
b5c66af
fix: include bundled parser MIT terms
imbajin Oct 3, 2026
886c266
fix(hubble): clarify metadata validation errors
imbajin Oct 3, 2026
04d2c80
fix(spark): define local test runtime settings
imbajin Oct 3, 2026
b7ff93e
feat: require Java 17 candidate SDK
imbajin Oct 3, 2026
3170e0d
chore: align candidate prerequisite ancestry
imbajin Oct 3, 2026
1b0bb2c
fix(client): isolate HTTPS test fixtures
imbajin Oct 3, 2026
b3e7da4
fix(client): isolate HTTPS test fixtures
imbajin Oct 3, 2026
760fd11
fix(spark): exclude credentials from config logs
imbajin Oct 3, 2026
94ddd4a
chore: refresh reviewed module prerequisites
imbajin Oct 3, 2026
1c38dee
chore: incorporate reviewed preparation fixes
imbajin Oct 3, 2026
caf0dca
docs: scope charset options to preparation builds
imbajin Oct 3, 2026
a17476c
fix(spark): reject prefixed test endpoints
imbajin Oct 3, 2026
0515f01
docs: map bundled candidate license grants
imbajin Oct 3, 2026
5b3cea5
chore: retain final module prerequisite ancestry
imbajin Oct 3, 2026
921bf66
chore: include reviewed Spark fixture follow-up
imbajin Oct 3, 2026
942febb
fix(build): exclude binary truststores from lint
imbajin Oct 3, 2026
93f14b0
fix(dist): include complete package legal files
imbajin Oct 4, 2026
da127fb
docs: record verified Java 17 support matrix
imbajin Oct 4, 2026
13a4caa
fix(spark): validate test fixture URL components
imbajin Oct 4, 2026
e65c183
fix(hubble): reject unnamed H2 memory databases
imbajin Oct 4, 2026
1803bda
chore: inherit final module validation fixes
imbajin Oct 4, 2026
5f979da
chore: refresh module preparation heads
imbajin Oct 4, 2026
96e65b4
fix(hubble): verify launcher process identity
imbajin Oct 4, 2026
9360034
chore: inherit Hubble launcher safeguards
imbajin Oct 4, 2026
0b04632
chore: integrate verified launcher guards
imbajin Oct 4, 2026
3c79673
fix: retain sdk proof and clear form errors
imbajin Oct 4, 2026
2499173
docs(spark): retain charset flags for stock sdk
imbajin Oct 4, 2026
9e74317
fix(ci): explain ambiguous server archives
imbajin Oct 4, 2026
12f6988
fix(client): send empty legacy clone config
imbajin Oct 4, 2026
c91c8f5
fix(loader): close clients after logger failure
imbajin Oct 4, 2026
32bc165
fix(tools): guard destructive backup tests
imbajin Oct 4, 2026
8cd3766
fix(client): close HTTP test request stream
imbajin Oct 4, 2026
e515922
fix(loader): clarify client cleanup log
imbajin Oct 4, 2026
5851b41
fix(build): verify server cache provenance
imbajin Oct 4, 2026
33708ba
chore(ci): cancel superseded PR runs
imbajin Oct 4, 2026
7fa20b8
chore(ci): cancel superseded PR runs
imbajin Oct 4, 2026
61a0e53
chore(ci): cancel superseded PR runs
imbajin Oct 4, 2026
8627c29
chore(ci): cancel superseded PR runs
imbajin Oct 4, 2026
060cc85
chore(ci): cancel superseded labeler runs
imbajin Oct 4, 2026
5c2a9ef
chore(ci): cancel superseded labeler runs
imbajin Oct 4, 2026
637b15f
chore(ci): cancel superseded labeler runs
imbajin Oct 4, 2026
a966101
chore(ci): cancel superseded labeler runs
imbajin Oct 4, 2026
1e559e5
chore(ci): cancel superseded PR runs
imbajin Oct 4, 2026
24178ca
docs(spark): clarify logging and runtime checks
imbajin Oct 4, 2026
a799785
fix(loader): reject invalid CLI arguments
imbajin Oct 4, 2026
e45cd2b
fix(hubble): explain read-only H2 failures
imbajin Oct 4, 2026
82a06c5
chore: refresh module 40 prerequisites
imbajin Oct 4, 2026
e6827c3
chore: refresh module 41 prerequisites
imbajin Oct 4, 2026
5571d8a
chore: refresh module 42 prerequisites
imbajin Oct 4, 2026
3f90030
chore: refresh module 43 prerequisites
imbajin Oct 4, 2026
f54242e
chore: refresh module 44 prerequisites
imbajin Oct 4, 2026
43a4eef
chore: refresh module 45 prerequisites
imbajin Oct 4, 2026
60146f1
chore: deduplicate inherited CI concurrency
imbajin Oct 4, 2026
de2e8d6
fix(build): verify candidate SDK packaging
imbajin Oct 4, 2026
0066fcf
chore: inherit verified preparation fixes
imbajin Oct 4, 2026
4c737ff
chore(ci): isolate Chromium dependency setup
imbajin Oct 4, 2026
0a85fca
fix(client): preserve legacy config whitespace
imbajin Oct 4, 2026
c5a5d6b
fix(client): escape legacy config unicode
imbajin Oct 5, 2026
813f155
chore(client): sync merged build preparation
imbajin Oct 5, 2026
4bf8332
chore: reconcile merged build preparation
imbajin Oct 5, 2026
b0542fe
chore: sync merged client preparation
imbajin Oct 5, 2026
f12c1e7
chore: sync merged upstream preparation
imbajin Oct 5, 2026
2152f9f
chore: sync merged upstream preparation
imbajin Oct 5, 2026
0aa883d
chore: sync merged upstream preparation
imbajin Oct 5, 2026
014b42c
chore(hubble): sync finalized client preparation
imbajin Oct 5, 2026
2e9a0a3
chore(hubble): sync merged upstream preparation
imbajin Oct 5, 2026
21c68a7
chore(hubble): coordinate shared release metadata
imbajin Oct 5, 2026
8edfb59
chore: sync finalized module preparation
imbajin Oct 5, 2026
cf0bd54
chore: sync tools preparation
imbajin Oct 5, 2026
2b73a4d
chore: sync loader preparation
imbajin Oct 5, 2026
d25e8d2
chore: sync finalized Java 17 prerequisites
imbajin Oct 5, 2026
cf4407b
fix(loader): diagnose missing Java executable
imbajin Oct 5, 2026
ef55b2a
docs(hubble): retain current upgrade guidance
imbajin Oct 5, 2026
56c08ea
docs(spark): join connector guide paragraphs
imbajin Oct 5, 2026
4d33bc5
docs(tools): clarify test guidance layout
imbajin Oct 5, 2026
ddab150
docs: clarify Java 17 compatibility scope
imbajin Oct 5, 2026
9b1a430
fix(hubble): preserve query and launcher ownership
imbajin Oct 5, 2026
50fab58
docs(hubble): inherit connector guidance
imbajin Oct 5, 2026
315acae
docs(hubble): name distribution resource directory
imbajin Oct 5, 2026
c97c360
fix: inherit finalized Hubble review repairs
imbajin Oct 5, 2026
dc0d525
docs: inherit tools testing guidance
imbajin Oct 5, 2026
1fc5a35
fix: inherit loader launcher diagnostics
imbajin Oct 5, 2026
802c1e1
fix: propagate preparation review repairs
imbajin Oct 5, 2026
c2de30b
chore: align merged client ancestry
imbajin Oct 5, 2026
c3e2afb
chore: align merged client ancestry
imbajin Oct 5, 2026
7c1ca96
chore: align merged client ancestry
imbajin Oct 5, 2026
d13dfeb
chore: reconcile merged client history
imbajin Oct 5, 2026
439456d
fix(ci): enforce the Java 17 build contract
imbajin Oct 5, 2026
a1ed273
fix(ci): validate the declared JDK without coercion
imbajin Oct 5, 2026
b57ce7d
chore: reconcile merged prerequisite history
imbajin Oct 5, 2026
7ab4f1d
chore: sync merged ASF prerequisites
imbajin Oct 5, 2026
5622850
chore: sync merged ASF prerequisites
imbajin Oct 5, 2026
62c1446
chore: sync merged ASF prerequisites
imbajin Oct 5, 2026
a45a808
chore: sync merged ASF prerequisites
imbajin Oct 5, 2026
45af767
docs(hubble): focus runtime and upgrade guidance
imbajin Oct 5, 2026
20ba1eb
docs: inherit focused Hubble guidance
imbajin Oct 5, 2026
fc94039
docs: inherit focused Hubble guidance
imbajin Oct 5, 2026
9662629
docs: inherit focused Hubble guidance
imbajin Oct 5, 2026
b3d4442
fix(hubble): fail closed on jar inspection errors
imbajin Oct 5, 2026
c4ad15f
fix(hubble): retry unavailable discovered servers
imbajin Oct 5, 2026
c8c446b
chore: sync merged Hubble prerequisite
imbajin Oct 6, 2026
c1ae39d
chore: reconcile merged Hubble history
imbajin Oct 6, 2026
9c0ee33
chore: sync merged Hubble prerequisite
imbajin Oct 6, 2026
ba361d2
chore: sync merged Hubble baseline
imbajin Oct 6, 2026
3620432
docs: mark temporary Server SDK sources
imbajin Oct 6, 2026
5577b0b
docs: inherit temporary SDK source markers
imbajin Oct 6, 2026
78b634f
chore: inherit consolidated upstream CI
imbajin Oct 6, 2026
7f68de1
chore: sync shared CI baseline
imbajin Oct 6, 2026
d1ae135
chore: sync upstream CI review ancestry
imbajin Oct 6, 2026
06af79b
chore: sync upstream CI review ancestry
imbajin Oct 6, 2026
9f805e2
chore: sync upstream CI review ancestry
imbajin Oct 6, 2026
d17c217
docs(ci): clarify candidate input selection
imbajin Oct 6, 2026
130cecb
docs(ci): inherit accurate input selection
imbajin Oct 6, 2026
31b51cc
fix(ci): align image builds with Java 17 SDK
imbajin Oct 6, 2026
a6a4c79
fix(ci): inherit Java 17 image foundations
imbajin Oct 6, 2026
e0fe694
fix(ci): validate native stack merge inputs
imbajin Oct 6, 2026
e441eab
fix(ci): inherit native stack input validation
imbajin Oct 6, 2026
dd9cd4b
chore: reconcile merged Java 17 core history
imbajin Oct 6, 2026
79cffff
chore: sync merged Java 17 core
imbajin Oct 6, 2026
227380f
fix(ci): start HDFS from the pinned image
imbajin Oct 6, 2026
0596e70
fix(ci): flatten candidate SDK root model
imbajin Oct 6, 2026
a745a42
fix(ci): authenticate coverage with OIDC
imbajin Oct 6, 2026
7b2b896
fix(ci): align SDK bootstrap regression test
imbajin Oct 6, 2026
7f587e2
fix(ci): prepare Spark from the official image
imbajin Oct 6, 2026
cd29f0a
refactor(ci): remove single-use Spark action
imbajin Oct 6, 2026
b0ecd25
fix(ci): scope candidate build to SDK modules
imbajin Oct 6, 2026
fa7ef87
fix(ci): align SDK with ASF master
imbajin Oct 6, 2026
3adcff3
fix(images): build SDK from ASF master
imbajin Oct 6, 2026
800c59c
chore: remove obsolete Server source references
imbajin Oct 6, 2026
0c19810
fix(ci): bind SDK archive to its source directory
imbajin Oct 6, 2026
6e43606
fix(ci): reuse verified Java 17 server build
imbajin Oct 6, 2026
97dcf24
fix(ci): align current fixture identity test
imbajin Oct 6, 2026
a896090
docs: clarify the SDK dependency build scope
imbajin Oct 7, 2026
59ef0cf
fix(ci): fetch immutable ASF SDK baseline
imbajin Oct 7, 2026
b301161
fix(ci): resolve abbreviated source identities
imbajin Oct 7, 2026
99d12e0
fix(ci): shorten the release source selector
imbajin Oct 7, 2026
b3df4dd
feat(ci): check upstream master compatibility
imbajin Oct 7, 2026
07c78f5
docs(ci): describe upstream compatibility checks
imbajin Oct 7, 2026
e0cfe88
fix(images): shorten the locked source selector
imbajin Oct 7, 2026
8bdace5
fix(ci): make coverage upload advisory
imbajin Oct 7, 2026
7786b05
chore: make coverage thresholds advisory
imbajin Oct 7, 2026
d1c4682
chore: sync the latest ASF master
imbajin Oct 7, 2026
7e63104
docs(ci): keep paragraphs on single lines
imbajin Oct 7, 2026
7286290
fix: restore full source commit locks
imbajin Oct 7, 2026
645d254
fix(hubble): filter smoke archive extraction
imbajin Oct 7, 2026
bb67264
fix(ci): advance the UTF-8 SDK baseline
imbajin Oct 7, 2026
cecdb33
fix(ci): use the official server 1.7 release
imbajin Oct 7, 2026
ed75a79
fix(ci): bind release fixtures to source identity
imbajin Oct 7, 2026
0c70206
fix(ci): isolate cached SDK inputs
imbajin Oct 7, 2026
926c455
fix(hubble): exclude unused Word runtime
imbajin Oct 7, 2026
926add0
fix(ci): use the ASF release distribution
imbajin Oct 7, 2026
5d81f6a
fix(ci): locate the Hubble release server
imbajin Oct 7, 2026
2c8b37e
fix(ci): preserve archived release access
imbajin Oct 8, 2026
3c5891b
fix(hubble): require safe tar extraction support
imbajin Oct 8, 2026
f917937
fix(ci): discard cached download failures
imbajin Oct 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/get-hugegraph-commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ runs:
core.exportVariable('COMMIT_REF', result.fetchRef);
core.setOutput('commit_id', result.sha);
core.setOutput('fetch_ref', result.fetchRef);
core.info(`Server baseline: ${process.env.SERVER_REPOSITORY} ${result.fetchRef} (${result.sha})`);
core.info(`Server baseline: ${process.env.SERVER_REPOSITORY} ${/^[0-9a-f]{40}$/i.test(result.fetchRef) ? result.fetchRef.slice(0, 6) : result.fetchRef} (${result.sha.slice(0, 6)})`);
} catch (error) {
core.setFailed(`Failed to get HugeGraph commit: ${error.message}`);
}
Expand Down
12 changes: 10 additions & 2 deletions .github/actions/get-hugegraph-commit/resolve.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,16 @@ module.exports = async function resolve(github, { repository, ref = '', pr = '',
sha = commit.sha;
}
if (!/^[0-9a-f]{40}$/i.test(sha)) throw new Error('Server API returned an invalid commit SHA');
if (expectedCommit && sha.toLowerCase() !== expectedCommit.toLowerCase()) {
throw new Error(`Server ref moved: expected ${expectedCommit}, resolved ${sha}`);
if (expectedCommit) {
if (sha.toLowerCase() !== expectedCommit.toLowerCase()) {
throw new Error(`Server ref moved: expected ${expectedCommit.slice(0, 6)}, resolved ${sha.slice(0, 6)}`);
}
}
if (/^[0-9a-f]{40}$/i.test(ref)) {
if (sha.toLowerCase() !== ref.toLowerCase()) {
throw new Error('Server API returned a commit different from the selected SHA');
}
fetchRef = sha;
}
return { sha, fetchRef };
};
11 changes: 10 additions & 1 deletion .github/actions/get-hugegraph-commit/resolve.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ test('resolves PR head from the selected repository', async () => {

test('rejects invalid or ambiguous selectors before calling GitHub', async () => {
for (const input of [{ repository: '../repo' }, { ref: 'master', pr: '42' },
{ pr: '1.5' }, { pr: '0' }, { expectedCommit: 'short' }]) {
{ pr: '1.5' }, { pr: '0' }, { expectedCommit: 'short' }, { expectedCommit: sha.slice(0, 6) }]) {
const { github, calls } = client();
await assert.rejects(resolve(github, { repository: 'apache/hugegraph', ...input }));
assert.equal(calls.length, 0);
Expand All @@ -71,3 +71,12 @@ test('fails closed for a moved branch or API error', async () => {
github.rest.repos.getCommit = async () => { throw new Error('Not Found'); };
await assert.rejects(resolve(github, { repository: 'example/server', ref: 'missing' }), /Not Found/);
});

test('verifies a full commit selector and fetch identity', async () => {
const { github, calls } = client();
assert.deepEqual(await resolve(github, { repository: 'apache/hugegraph',
ref: sha, expectedCommit: sha }), { sha, fetchRef: sha });
assert.deepEqual(calls, [['commit', { owner: 'apache', repo: 'hugegraph', ref: sha }]]);
await assert.rejects(resolve(github, { repository: 'apache/hugegraph',
ref: 'b'.repeat(40) }), /different from the selected SHA/);
});
21 changes: 15 additions & 6 deletions .github/actions/setup-candidate-sdk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ inputs:
description: 'GitHub owner/repository for the candidate SDK'
default: 'apache/hugegraph'
ref:
description: 'Fetchable candidate source ref'
default: 'd9abcd4317fb36128e7e4d209139ec7f3a28cdfc'
description: 'Immutable candidate source commit'
default: 'e62c961e00221569d4f955abbadf60faee45b283'
expected-commit:
description: 'Locked full candidate source commit'
default: 'd9abcd4317fb36128e7e4d209139ec7f3a28cdfc'
description: 'Locked candidate source commit'
default: 'e62c961e00221569d4f955abbadf60faee45b283'

outputs:
repository:
Expand Down Expand Up @@ -55,9 +55,18 @@ runs:
run: |
candidate_repo=$(mktemp -d "$RUNNER_TEMP/hugegraph-candidate-m2.XXXXXX")
server_build=$(mktemp -d "$RUNNER_TEMP/hugegraph-candidate-build.XXXXXX")
source_dir="$server_build/source"
if [[ -d "$HOME/.m2/repository" ]]; then
rsync -a --exclude='/org/apache/hugegraph/' --exclude='/candidate-sdk-manifest.json' \
"$HOME/.m2/repository/" "$candidate_repo/"
fi
bash "$GITHUB_WORKSPACE/hugegraph-client/assembly/travis/install-candidate-sdk.sh" \
"$SERVER_COMMIT" "$server_build/hugegraph" "$candidate_repo"
archives=("$server_build"/hugegraph/hugegraph-server/apache-hugegraph-*.tar.gz)
"$SERVER_COMMIT" "$source_dir" "$candidate_repo"
# Retain downloaded third-party inputs for the existing Maven cache.
mkdir -p "$HOME/.m2/repository"
rsync -a --exclude='/org/apache/hugegraph/' --exclude='/candidate-sdk-manifest.json' \
"$candidate_repo/" "$HOME/.m2/repository/"
archives=("$source_dir"/hugegraph-server/apache-hugegraph-*.tar.gz)
if [[ ${#archives[@]} -ne 1 || ! -f "${archives[0]}" ]]; then
printf 'Expected one candidate server archive, found: %s\n' "${archives[*]}" >&2
exit 1
Expand Down
20 changes: 14 additions & 6 deletions .github/actions/setup-hugegraph-server/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup HugeGraph Server
description: Build an immutable fixture once, or start an independent test service
description: Prepare an immutable release or candidate fixture, or start an independent test service
inputs:
mode:
description: 'standalone (legacy), build (upload), or start (download)'
Expand All @@ -8,17 +8,20 @@ inputs:
description: Workflow-local immutable fixture artifact name
default: ''
repository:
description: GitHub owner/repository containing the Server source
description: Server source repository (Java 11 release requires apache/hugegraph)
default: apache/hugegraph
fetch-ref:
description: Fetchable source ref (must resolve to commit-id)
default: ''
commit-id:
description: Exact Server commit SHA
description: Exact Server commit SHA (Java 11 release requires the locked 1.7.0 commit)
required: true
java-version:
description: JDK major used for the build and runtime
default: '11'
release-version:
description: Fixed official Server release used by Java 11 compatibility fixtures
default: '1.7.0'
java-home:
description: Optional fixture JDK scoped to this subprocess; keeps Toolchain JDK unchanged
default: ''
Expand All @@ -37,22 +40,23 @@ runs:
with:
name: ${{ inputs.artifact-name }}
path: ${{ runner.temp }}/hugegraph-fixture
- name: Restore exact Server build cache
- name: Restore exact Server fixture cache
if: inputs.mode == 'build'
uses: actions/cache@v4
with:
path: ~/hugegraph-fixture-cache
key: server-fixture-v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.repository }}-${{ inputs.commit-id }}-jdk${{ inputs.java-version }}-${{ hashFiles('.github/actions/setup-hugegraph-server/action.yml', '.github/actions/setup-hugegraph-server/fixture.sh', '.github/actions/setup-hugegraph-server/manifest.py', '.github/actions/setup-java-env/action.yml', '.github/configs/settings.xml', 'hugegraph-client/assembly/travis/checkout-server.sh', 'hugegraph-client/assembly/travis/start-hugegraph-servers.sh', 'hugegraph-*/assembly/travis/install-hugegraph-from-source.sh', 'hugegraph-hubble/hubble-dist/assembly/travis/download-hugegraph.sh') }}
key: server-fixture-v2-${{ runner.os }}-${{ runner.arch }}-${{ inputs.repository }}-${{ inputs.commit-id }}-release${{ inputs.release-version }}-jdk${{ inputs.java-version }}-${{ hashFiles('.github/actions/setup-hugegraph-server/action.yml', '.github/actions/setup-hugegraph-server/fixture.sh', '.github/actions/setup-hugegraph-server/manifest.py', '.github/actions/setup-hugegraph-server/release.py', '.github/actions/setup-java-env/action.yml', '.github/configs/settings.xml', 'hugegraph-client/assembly/travis/checkout-server.sh', 'hugegraph-client/assembly/travis/install-candidate-sdk.sh', 'hugegraph-client/assembly/travis/start-hugegraph-servers.sh', 'hugegraph-*/assembly/travis/install-hugegraph-from-source.sh', 'hugegraph-hubble/hubble-dist/assembly/travis/download-hugegraph.sh') }}
- name: Prepare fixture or start service
shell: bash
env:
FIXTURE_MODE: ${{ inputs.mode }}
FIXTURE_REPOSITORY: ${{ inputs.repository }}
FIXTURE_COMMIT: ${{ inputs.commit-id }}
FIXTURE_REF: ${{ inputs.fetch-ref }}
FIXTURE_BUILD_INPUTS: ${{ hashFiles('.github/actions/setup-hugegraph-server/action.yml', '.github/actions/setup-hugegraph-server/fixture.sh', '.github/actions/setup-hugegraph-server/manifest.py', '.github/actions/setup-java-env/action.yml', '.github/configs/settings.xml', 'hugegraph-client/assembly/travis/checkout-server.sh', 'hugegraph-client/assembly/travis/start-hugegraph-servers.sh', 'hugegraph-*/assembly/travis/install-hugegraph-from-source.sh', 'hugegraph-hubble/hubble-dist/assembly/travis/download-hugegraph.sh') }}
FIXTURE_BUILD_INPUTS: ${{ hashFiles('.github/actions/setup-hugegraph-server/action.yml', '.github/actions/setup-hugegraph-server/fixture.sh', '.github/actions/setup-hugegraph-server/manifest.py', '.github/actions/setup-hugegraph-server/release.py', '.github/actions/setup-java-env/action.yml', '.github/configs/settings.xml', 'hugegraph-client/assembly/travis/checkout-server.sh', 'hugegraph-client/assembly/travis/install-candidate-sdk.sh', 'hugegraph-client/assembly/travis/start-hugegraph-servers.sh', 'hugegraph-*/assembly/travis/install-hugegraph-from-source.sh', 'hugegraph-hubble/hubble-dist/assembly/travis/download-hugegraph.sh') }}
FIXTURE_PLATFORM: ${{ runner.os }}-${{ runner.arch }}
FIXTURE_JAVA: ${{ inputs.java-version }}
FIXTURE_RELEASE_VERSION: ${{ inputs.release-version }}
FIXTURE_JAVA_HOME: ${{ inputs.java-home }}
ISOLATE_FIXTURE_REPO: ${{ inputs.isolate-maven-repo }}
FIXTURE_DIR: ${{ runner.temp }}/hugegraph-fixture
Expand Down Expand Up @@ -85,6 +89,10 @@ runs:
export TRAVIS_DIR
server_build=$(mktemp -d "${RUNNER_TEMP:-${TMPDIR:-/tmp}}/hugegraph-build.XXXXXX")
cd "$server_build"
if [[ "$FIXTURE_MODE" == standalone ]]; then
FIXTURE_MODE=build bash "$FIXTURE_ACTION/fixture.sh"
export FIXTURE_MODE=start
fi
if [[ -f "$TRAVIS_DIR/install-hugegraph-from-source.sh" ]]; then
bash "$TRAVIS_DIR/install-hugegraph-from-source.sh" "$FIXTURE_COMMIT"
else
Expand Down
48 changes: 35 additions & 13 deletions .github/actions/setup-hugegraph-server/fixture.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,29 @@ FIXTURE_REPOSITORY=${FIXTURE_REPOSITORY:-${SERVER_REPOSITORY:-apache/hugegraph}}
FIXTURE_COMMIT=${FIXTURE_COMMIT:-${1:-}}
FIXTURE_REF=${FIXTURE_REF:-$FIXTURE_COMMIT}
FIXTURE_JAVA=${FIXTURE_JAVA:-11}
FIXTURE_RELEASE_VERSION=${FIXTURE_RELEASE_VERSION:-1.7.0}
FIXTURE_DIR=${FIXTURE_DIR:-${RUNNER_TEMP:-${TMPDIR:-/tmp}}/hugegraph-fixture}
FIXTURE_HELPER=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/manifest.py
FIXTURE_BUILD_INPUTS=${FIXTURE_BUILD_INPUTS:-$(python3 "$FIXTURE_HELPER" inputs)}
FIXTURE_PLATFORM=${FIXTURE_PLATFORM:-$(uname -sm)}
FIXTURE_CONFIG="package -DskipTests -Dmaven.javadoc.skip=true -ntp;schema=1;inputs=$FIXTURE_BUILD_INPUTS;platform=$FIXTURE_PLATFORM"
export FIXTURE_REPOSITORY FIXTURE_COMMIT FIXTURE_JAVA FIXTURE_CONFIG FIXTURE_DIR
if [[ "$FIXTURE_JAVA" == 17 ]]; then
FIXTURE_BUILD_COMMAND=candidate-sdk-install
else
FIXTURE_BUILD_COMMAND="asf-release-$FIXTURE_RELEASE_VERSION"
fi
FIXTURE_CONFIG="$FIXTURE_BUILD_COMMAND;schema=2;inputs=$FIXTURE_BUILD_INPUTS;platform=$FIXTURE_PLATFORM"
export FIXTURE_REPOSITORY FIXTURE_COMMIT FIXTURE_JAVA FIXTURE_CONFIG FIXTURE_DIR FIXTURE_RELEASE_VERSION
[[ "$FIXTURE_REPOSITORY" =~ ^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$ ]]
[[ "$FIXTURE_COMMIT" =~ ^[0-9a-f]{40}$ ]]
[[ "$FIXTURE_JAVA" =~ ^[0-9]+$ ]]
[[ "$FIXTURE_JAVA" == 11 || "$FIXTURE_JAVA" == 17 ]] || {
echo 'Fixture requires JDK 11 for the official release or JDK 17 for the candidate SDK' >&2
exit 1
}

if [[ "$FIXTURE_JAVA" == 11 ]]; then
# Reject caller/source mismatch before restoring a cache or downloading bytes.
python3 "${FIXTURE_HELPER%/*}/release.py" validate
fi

fixture_validate_java() {
actual_java=$(java -version 2>&1 | sed -n 's/.*version "\([0-9][0-9]*\).*".*/\1/p' | head -1)
Expand All @@ -39,7 +53,7 @@ fixture_validate_java() {

fixture_verify() { python3 "$FIXTURE_HELPER" verify; }
fixture_build() {
local cache_key cache_dir source_dir archive
local cache_key cache_dir source_dir archive candidate_repo=''
cache_key=$(printf '%s\n' "$FIXTURE_REPOSITORY" "$FIXTURE_COMMIT" "$FIXTURE_JAVA" "$FIXTURE_CONFIG" | shasum -a 256 | cut -d ' ' -f 1)
cache_dir="${HOME}/hugegraph-fixture-cache/$cache_key"
mkdir -p "$FIXTURE_DIR"
Expand All @@ -50,19 +64,27 @@ fixture_build() {
fi
rm -f "$FIXTURE_DIR/server.tar.gz" "$FIXTURE_DIR/manifest.json"
fixture_validate_java
source_dir="$(mktemp -d "${TMPDIR:-/tmp}/hg-fixture-source.XXXXXX")/source"
SERVER_REPOSITORY=$FIXTURE_REPOSITORY SERVER_FETCH_REF=$FIXTURE_REF \
bash "${FIXTURE_HELPER%/*}/../../../hugegraph-client/assembly/travis/checkout-server.sh" "$FIXTURE_COMMIT" "$source_dir"
(cd "$source_dir" && mvn package -DskipTests -Dmaven.javadoc.skip=true -ntp)
archive=$(find "$source_dir/hugegraph-server" -maxdepth 1 -name 'apache-hugegraph-*.tar.gz' -print)
[[ -n "$archive" && -f "$archive" ]]
cp "$archive" "$FIXTURE_DIR/server.tar.gz"
export FIXTURE_ARCHIVE_NAME=${archive##*/}
if [[ "$FIXTURE_JAVA" == 17 ]]; then
source_dir="$(mktemp -d "${TMPDIR:-/tmp}/hg-fixture-source.XXXXXX")/source"
# Reuse the verified SDK build's same-source distribution and isolated repository.
candidate_repo=$(mktemp -d "${TMPDIR:-/tmp}/hg-fixture-sdk-m2.XXXXXX")
SERVER_REPOSITORY=$FIXTURE_REPOSITORY SERVER_FETCH_REF=$FIXTURE_REF \
bash "${FIXTURE_HELPER%/*}/../../../hugegraph-client/assembly/travis/install-candidate-sdk.sh" \
"$FIXTURE_COMMIT" "$source_dir" "$candidate_repo"
archive=$(find "$source_dir/hugegraph-server" -maxdepth 1 -name 'apache-hugegraph-*.tar.gz' -print)
[[ -n "$archive" && -f "$archive" ]]
cp "$archive" "$FIXTURE_DIR/server.tar.gz"
export FIXTURE_ARCHIVE_NAME=${archive##*/}
else
python3 "${FIXTURE_HELPER%/*}/release.py" download
export FIXTURE_ARCHIVE_NAME=$(python3 "${FIXTURE_HELPER%/*}/release.py" name)
fi
python3 "$FIXTURE_HELPER" create
fixture_verify
mkdir -p "$cache_dir"
cp "$FIXTURE_DIR/server.tar.gz" "$FIXTURE_DIR/manifest.json" "$cache_dir/"
rm -rf "$source_dir"
if [[ -n "${source_dir:-}" ]]; then rm -rf "$source_dir"; fi
if [[ -n "$candidate_repo" ]]; then rm -rf "$candidate_repo"; fi
}
fixture_copy_archive() {
fixture_validate_java
Expand Down
18 changes: 18 additions & 0 deletions .github/actions/setup-hugegraph-server/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@
import re
import sys

import release

if sys.argv[1] == "inputs":
repo = pathlib.Path(__file__).resolve().parents[3]
patterns = (
'.github/actions/setup-hugegraph-server/action.yml',
'.github/actions/setup-hugegraph-server/fixture.sh',
'.github/actions/setup-hugegraph-server/manifest.py',
'.github/actions/setup-hugegraph-server/release.py',
'.github/actions/setup-java-env/action.yml', '.github/configs/settings.xml',
'hugegraph-client/assembly/travis/checkout-server.sh',
'hugegraph-client/assembly/travis/install-candidate-sdk.sh',
'hugegraph-client/assembly/travis/start-hugegraph-servers.sh',
'hugegraph-*/assembly/travis/install-hugegraph-from-source.sh',
'hugegraph-hubble/hubble-dist/assembly/travis/download-hugegraph.sh',
Expand All @@ -45,13 +49,25 @@
root = pathlib.Path(os.environ["FIXTURE_DIR"])
identity = {key.lower(): os.environ["FIXTURE_" + key] for key in
("REPOSITORY", "COMMIT", "JAVA", "CONFIG")}
try:
if identity["java"] == "11":
identity.update(release.identity(os.environ.get("FIXTURE_RELEASE_VERSION", release.VERSION),
identity["repository"], identity["commit"]))
else:
identity.update(source_kind="candidate-sdk")
except ValueError as error:
sys.exit(str(error))


def digest():
h = hashlib.sha256()
with (root / "server.tar.gz").open("rb") as stream:
for chunk in iter(lambda: stream.read(1024 * 1024), b""):
h.update(chunk)
return h.hexdigest()
try:
if identity["java"] == "11":
release.verify(root / "server.tar.gz")
if sys.argv[1] == "create":
data = dict(identity, archive_name=os.environ["FIXTURE_ARCHIVE_NAME"], sha256=digest())
(root / "manifest.json").write_text(json.dumps(data, sort_keys=True) + "\n")
Expand All @@ -63,6 +79,8 @@ def digest():
raise ValueError("fixture origin, commit, JDK or build configuration mismatch")
if not re.fullmatch(r"apache-hugegraph-[A-Za-z0-9_.-]+\.tar\.gz", data.get("archive_name", "")):
raise ValueError("invalid archive name")
if identity["java"] == "11" and data.get("archive_name") != release.ARCHIVE_NAME:
raise ValueError("official Server release archive name mismatch")
if data.get("sha256") != digest():
raise ValueError("fixture checksum mismatch")
if sys.argv[1] == "name":
Expand Down
Loading
Loading