fix: Update baseline references to use 'origin/development' for consistency across scripts and tests

This commit is contained in:
GitHub Actions
2026-02-18 17:36:52 +00:00
parent 983ec7a42e
commit b4b076039f
4 changed files with 21 additions and 11 deletions

View File

@@ -2,7 +2,7 @@
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
BASELINE="${CHARON_PATCH_BASELINE:-origin/main...HEAD}"
BASELINE="${CHARON_PATCH_BASELINE:-}"
BACKEND_COVERAGE_FILE="$ROOT_DIR/backend/coverage.txt"
FRONTEND_COVERAGE_FILE="$ROOT_DIR/frontend/coverage/lcov.info"
JSON_OUT="$ROOT_DIR/test-results/local-patch-report.json"
@@ -62,6 +62,16 @@ if ! command -v go >/dev/null 2>&1; then
exit 1
fi
if [[ -z "$BASELINE" ]]; then
if git -C "$ROOT_DIR" rev-parse --verify --quiet "origin/development^{commit}" >/dev/null; then
BASELINE="origin/development...HEAD"
elif git -C "$ROOT_DIR" rev-parse --verify --quiet "development^{commit}" >/dev/null; then
BASELINE="development...HEAD"
else
BASELINE="origin/development...HEAD"
fi
fi
if [[ ! -f "$BACKEND_COVERAGE_FILE" ]]; then
write_preflight_artifacts "backend coverage input missing at $BACKEND_COVERAGE_FILE"
echo "Error: backend coverage input missing at $BACKEND_COVERAGE_FILE" >&2
@@ -80,7 +90,7 @@ if [[ "$BASELINE" == *"..."* ]]; then
fi
if [[ -n "$BASE_REF" ]] && ! git -C "$ROOT_DIR" rev-parse --verify --quiet "${BASE_REF}^{commit}" >/dev/null; then
echo "Error: baseline base ref '$BASE_REF' is not available locally. Set CHARON_PATCH_BASELINE to a valid range and retry." >&2
echo "Error: baseline base ref '$BASE_REF' is not available locally. Set CHARON_PATCH_BASELINE to a valid range and retry (default attempts origin/development, then development)." >&2
exit 1
fi