Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ensure shell scripts always use LF line endings regardless of OS
*.sh text eol=lf
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,9 @@ backend/__pycache__/
Thumbs.db

backend/data/reports/*
!backend/data/reports/.gitkeep
!backend/data/reports/.gitkeep

# Frontend generated test artifacts (see CONTRIBUTING.md)
frontend/playwright-report/
frontend/test-results/
frontend/.vite/
85 changes: 0 additions & 85 deletions frontend/playwright-report/index.html

This file was deleted.

4 changes: 0 additions & 4 deletions frontend/test-results/.last-run.json

This file was deleted.

35 changes: 32 additions & 3 deletions scripts/check-artifacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,51 @@ BLOCKED_PATTERNS=(
"frontend/node_modules/"
".vite/deps/"
)
echo "Checking for generated frontend artifacts..."

# ── Check 1: files already tracked in git history ─────────────────────────────
# The diff-only check below cannot catch artifacts already committed to the base
# branch. This check catches those.
echo "Checking for tracked generated artifacts in git history..."
TRACKED_FOUND=()
for pattern in "${BLOCKED_PATTERNS[@]}"; do
while IFS= read -r match; do
TRACKED_FOUND+=("$match")
done < <(git ls-files "${pattern}" 2>/dev/null || true)
done

if [[ ${#TRACKED_FOUND[@]} -gt 0 ]]; then
echo "ERROR: Generated artifact is tracked by git and must be removed:"
for f in "${TRACKED_FOUND[@]}"; do echo " - $f"; done
echo ""
echo "Fix:"
echo " git rm --cached <file>"
echo " Add the path to .gitignore"
echo " See CONTRIBUTING.md for details."
exit 1
fi

# ── Check 2: files newly added in this PR/branch ──────────────────────────────
echo "Checking for generated artifacts in PR diff..."
if git rev-parse --verify "${BASE_BRANCH}" >/dev/null 2>&1; then
CHANGED_FILES=$(git diff --name-only "${BASE_BRANCH}"...HEAD 2>/dev/null || git diff --name-only HEAD)
else
CHANGED_FILES=$(git diff --name-only --cached)
fi

FOUND=()
for pattern in "${BLOCKED_PATTERNS[@]}"; do
while IFS= read -r match; do FOUND+=("$match")
while IFS= read -r match; do
FOUND+=("$match")
done < <(echo "$CHANGED_FILES" | grep -E "^${pattern}" 2>/dev/null || true)
done

if [[ ${#FOUND[@]} -gt 0 ]]; then
echo "ERROR: Artifact files found:"
echo "ERROR: Artifact files found in this branch:"
for f in "${FOUND[@]}"; do echo " - $f"; done
echo ""
echo "Fix: git rm --cached <file>"
exit 1
fi

echo "All clear!"
exit 0
Loading