From 6c286d1ff5aa4bdc870b787754d66c7691cd13f6 Mon Sep 17 00:00:00 2001 From: Crimson Date: Mon, 7 Sep 2026 20:21:37 +0500 Subject: [PATCH] fix(build): align runtime env acceptance gate --- tools/build/lib/acceptance.sh | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tools/build/lib/acceptance.sh b/tools/build/lib/acceptance.sh index 134bf3c..01155d8 100644 --- a/tools/build/lib/acceptance.sh +++ b/tools/build/lib/acceptance.sh @@ -183,11 +183,23 @@ run_fix20_acceptance_subset() { || fail "acceptance: the default obfs type must not be re-declared in: $default_declarations" log_step "Acceptance: runtime env is derived from config, not literals" - ! grep -Eq 'HY2XS_HYSTERIA_OBFS_TYPE=(gecko|salamander)' orchestrator/src/config/env.ts \ - || fail "acceptance: renderRuntimeEnv must not print a hardcoded obfs type" - grep -q 'HY2XS_HYSTERIA_OBFS_TYPE=\${config.hysteriaObfsType}' orchestrator/src/config/env.ts \ - || fail "acceptance: renderRuntimeEnv must derive the obfs type from the parsed config" - ! grep -Eq '\|\|\s*"(gecko|salamander)"' orchestrator/src/config/env.ts \ + # runtime env mappings live in runtimeEnvEntries(); renderRuntimeEnv only + # serializes that shared list. Do not require the old inline interpolation. + ! grep -Eq \ + 'HY2XS_HYSTERIA_OBFS_TYPE=(gecko|salamander)' \ + orchestrator/src/config/env.ts \ + || fail "acceptance: runtime env must not contain a hardcoded obfs type" + grep -Eq \ + '\["HY2XS_HYSTERIA_OBFS_TYPE",[[:space:]]*config\.hysteriaObfsType\]' \ + orchestrator/src/config/env.ts \ + || fail "acceptance: runtimeEnvEntries must derive the obfs type from the parsed config" + grep -Eq \ + 'renderEnvFile\(runtimeEnvEntries\(config\)\)' \ + orchestrator/src/config/env.ts \ + || fail "acceptance: renderRuntimeEnv must render the shared runtimeEnvEntries list" + ! grep -Eq \ + '\|\|[[:space:]]*"(gecko|salamander)"' \ + orchestrator/src/config/env.ts \ || fail "acceptance: env.ts must not carry its own obfs fallback default" log_step "Acceptance: package metadata records how the Hysteria version was chosen"