This is an automated email from the ASF dual-hosted git repository. imbajin pushed a commit to branch feat/oink-core-platform in repository https://gitbox.apache.org/repos/asf/hugegraph-doc.git
commit 72989ad3ed58d6acfea86621de4a1af6654fe045 Author: dark <[email protected]> AuthorDate: Fri Sep 4 21:56:05 2026 +0800 fix(ci): preserve staged archive origins - pass the production historical origin through aggregation - revalidate downloaded artifacts with identical URL scope - cover the aggregate CLI and workflow contract --- .github/workflows/hugo.yml | 4 +++- scripts/test_versioning.py | 10 +++++++++- scripts/versioning.py | 2 ++ tests/e2e/workflow-contract.test.cjs | 4 ++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 670404fdc..cd9db3154 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -269,6 +269,7 @@ jobs: env: PREFIX: ${{ needs.prepare.outputs.artifact_prefix }} SITE_ORIGIN: ${{ needs.prepare.outputs.site_origin }} + HISTORICAL_ORIGIN: ${{ needs.prepare.outputs.historical_origin }} SELECTION: ${{ needs.prepare.outputs.selection }} run: | extra=() @@ -279,7 +280,8 @@ jobs: --artifacts version-artifacts --artifact-prefix "$PREFIX-" \ --artifact-suffix "-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" \ --resolved-manifest resolved/resolved-versions.json \ - --site-origin "$SITE_ORIGIN" --select "$SELECTION" \ + --site-origin "$SITE_ORIGIN" --historical-origin "$HISTORICAL_ORIGIN" \ + --select "$SELECTION" \ --output "${RUNNER_TEMP}/public-site" "${extra[@]}" - name: Upload publishable aggregate uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 diff --git a/scripts/test_versioning.py b/scripts/test_versioning.py index 2ae034f9e..61e5a187d 100644 --- a/scripts/test_versioning.py +++ b/scripts/test_versioning.py @@ -1155,6 +1155,7 @@ class VersionUrlTest(unittest.TestCase): artifacts=temp / "artifacts", artifact_prefix="", site_origin=ORIGIN, + historical_origin="https://hugegraph.apache.org", output=output, asf_profile="oink", asf_whoami="asf-staging-oink", @@ -1178,7 +1179,9 @@ class VersionUrlTest(unittest.TestCase): return_value={"versions": [entry]}, ), mock.patch.object(versioning, "require_metadata_matches"), - mock.patch.object(versioning, "validate_artifact"), + mock.patch.object( + versioning, "validate_artifact" + ) as validate_artifact, mock.patch.object(versioning, "write_error_documents", return_value=1), mock.patch.object(versioning, "sitemap_locations", return_value=[]), mock.patch.object( @@ -1190,6 +1193,11 @@ class VersionUrlTest(unittest.TestCase): versioning.aggregate(args) security_scan.assert_called_once_with(output.resolve(), ORIGIN) + validate_args = validate_artifact.call_args.args[0] + self.assertEqual( + validate_args.historical_origin, + "https://hugegraph.apache.org", + ) def test_output_cleanup_is_limited_to_temporary_descendants(self) -> None: with tempfile.TemporaryDirectory() as temp_name: diff --git a/scripts/versioning.py b/scripts/versioning.py index a545cd889..b20c7a79c 100644 --- a/scripts/versioning.py +++ b/scripts/versioning.py @@ -3224,6 +3224,7 @@ def aggregate(args: argparse.Namespace) -> None: version=entry["id"], sha=entry["sha"], site_origin=args.site_origin, + historical_origin=getattr(args, "historical_origin", None), artifact=source, ) ) @@ -3315,6 +3316,7 @@ def parser() -> argparse.ArgumentParser: "--resolved-manifest", type=pathlib.Path, required=True ) aggregate_parser.add_argument("--site-origin", required=True) + aggregate_parser.add_argument("--historical-origin") aggregate_parser.add_argument("--select") aggregate_parser.add_argument("--output", type=pathlib.Path, required=True) aggregate_parser.add_argument("--asf-profile") diff --git a/tests/e2e/workflow-contract.test.cjs b/tests/e2e/workflow-contract.test.cjs index dcccf8731..179e6f74a 100644 --- a/tests/e2e/workflow-contract.test.cjs +++ b/tests/e2e/workflow-contract.test.cjs @@ -40,4 +40,8 @@ test("prepare pins Hugo and WebP tools before source validators", () => { assert.ok(setupWebp >= 0 && setupWebp < validators); assert.match(workflow, /apt-get install --yes --no-install-recommends webp/); assert.match(workflow, /command -v cwebp[\s\S]*command -v dwebp/); + assert.match( + workflow, + /aggregate[\s\S]*--historical-origin "\$HISTORICAL_ORIGIN"/, + ); });
