bitflicker64 commented on code in PR #787: URL: https://github.com/apache/hugegraph-toolchain/pull/787#discussion_r4210638011
########## .github/actions/setup-hugegraph-server/release.py: ########## @@ -0,0 +1,88 @@ +#!/usr/bin/env python3 +# +# 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. +# +"""Pinned ASF binary release identity and bounded download, without source fallback.""" +import hashlib +import os +import pathlib +import subprocess +import sys +import tempfile + +VERSION = "1.7.0" +REPOSITORY = "apache/hugegraph" +COMMIT = "b12425c2032bf0d21a97b8221f42a18055c2982f" +ARCHIVE_NAME = "apache-hugegraph-incubating-1.7.0.tar.gz" +SOURCE_URL = "https://downloads.apache.org/hugegraph/1.7.0/" + ARCHIVE_NAME Review Comment: Minor: `downloads.apache.org` is the ASF area for current releases. Under ASF release policy, superseded releases may be removed from it at any time and stay available only at `archive.apache.org/dist/hugegraph/1.7.0/`, which already serves this archive (HTTP 200). With one URL and no fallback, removing 1.7.0 from downloads would fail every Java 11 fixture build on a cache miss until this file is edited. The SHA-512 pin already authenticates the bytes, so a second source would not weaken it. Please try `https://archive.apache.org/dist/hugegraph/1.7.0/` + `ARCHIVE_NAME` after the downloads URL fails. Keep the canonical `source_url` in the manifest identity rather than the mirror that served the bytes, so cache keys stay stable. ########## hugegraph-client/assembly/travis/install-candidate-sdk.sh: ########## @@ -41,16 +41,22 @@ SERVER_FETCH_REF=${SERVER_FETCH_REF:-$1} export SERVER_REPOSITORY SERVER_FETCH_REF CANDIDATE_REPO=$3 bash "$SCRIPT_DIR/checkout-server.sh" "$1" "$SOURCE_DIR" -# Install the Server distribution's dependency reactor so all SDK modules share one source. +# Install the SDK and Server distribution dependency closure from one source. +# Server cluster tests pull an unrelated released Toolchain/SDK back into this build. # The fixture installers retain package-only semantics and use another repository. -# Flatten the root too: license metadata rebuilds installed parent models, whose -# raw ${revision} otherwise becomes an invalid artifact request outside the reactor. +SDK_MODULES=hugegraph-server/hugegraph-dist,hugegraph-pd/hg-pd-client +SDK_MODULES+=,hugegraph-store/hg-store-client,hugegraph-struct +# Flatten the root too: its installed ${revision} otherwise breaks dependency +# model reconstruction while remote-resources generates license metadata. (cd "$SOURCE_DIR" && mvn "-Dmaven.repo.local=$CANDIDATE_REPO" \ - org.codehaus.mojo:flatten-maven-plugin:1.2.7:flatten install \ - -pl hugegraph-server/hugegraph-dist -am \ + -pl "$SDK_MODULES" -am \ + org.codehaus.mojo:flatten-maven-plugin:1.3.0:flatten install \ -Dflatten.mode=resolveCiFriendliesOnly -DupdatePomFile=true \ -DskipTests -Dmaven.javadoc.skip=true -ntp) ACTUAL_COMMIT=$(git -C "$SOURCE_DIR" rev-parse HEAD) +if [[ "$SERVER_FETCH_REF" =~ ^([0-9a-fA-F]{6}|[0-9a-fA-F]{40})$ ]]; then Review Comment: Minor: The `{6}` branch is left over from the short-SHA iteration and can no longer be reached. `checkout-server.sh` runs `git fetch --depth 1 origin "$SERVER_FETCH_REF"` before this point, and git cannot fetch an abbreviated SHA, so a six-character `SERVER_FETCH_REF` fails there first. Keeping the branch suggests that short refs are supported. Please drop the `[0-9a-fA-F]{6}|` alternative, or remove the rewrite entirely if `fetch_ref` should keep the value the caller passed. -- 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]
