From cc31af9e773778ea59e5a174f36944d922a2c067 Mon Sep 17 00:00:00 2001 From: Lasse Benninga Date: Mon, 6 Jul 2026 17:32:19 +0200 Subject: [PATCH 1/2] fix(ci): grant contents:read so the grade workflow stops failing at startup Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/grade-assignment.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/grade-assignment.yml b/.github/workflows/grade-assignment.yml index d06dc2d..3fd4b9c 100644 --- a/.github/workflows/grade-assignment.yml +++ b/.github/workflows/grade-assignment.yml @@ -8,6 +8,7 @@ on: jobs: grade: permissions: + contents: read issues: write pull-requests: write uses: HackYourFuture/github-actions/.github/workflows/auto-grade.yml@main From 901f0675b645e7db6ef42906aa7e3a139fc3a47a Mon Sep 17 00:00:00 2001 From: Lasse Benninga Date: Mon, 6 Jul 2026 17:32:19 +0200 Subject: [PATCH 2/2] fix(autograder): stop penalizing left-in guide comments and schema-qualified views Same fix merged into the c55-data-week-9 cohort fork (PR #8): file_is_filled no longer fails on any TODO (strips SQL comments, only flags start-of-line placeholders), and vw_dim_zones/vw_fact_trips detection allows a schema prefix. Co-Authored-By: Claude Opus 4.8 (1M context) --- .hyf/test.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.hyf/test.sh b/.hyf/test.sh index 72d151d..f3fe07a 100755 --- a/.hyf/test.sh +++ b/.hyf/test.sh @@ -47,14 +47,21 @@ fi ((score += l1)) pass "Level 1: required files ($l1/10 pts)" -# Helper: returns true when a file is non-empty and all TODO placeholders have -# been removed. The assignment instruction is "replace every TODO" — any -# remaining occurrence of the word TODO (case-insensitive) means the file is -# still a scaffold stub. +# Helper: returns true when a file has real content and no *unreplaced* TODO +# placeholder remains. A completed query left below the scaffold's "-- TODO:" +# guide comment still counts as filled: SQL line-comments are stripped before +# the check, and only a line whose content *begins* with TODO (an unreplaced +# markdown placeholder) marks the file a stub. The instruction line +# "...Replace every TODO." (TODO not at line start) is fine. file_is_filled() { local f="$1" [[ -s "$f" ]] || return 1 - grep -qiE "\bTODO\b" "$f" && return 1 + local body + body="$(sed -E 's/--.*$//' "$f" | grep -vE '^[[:space:]]*$')" + [[ -n "$body" ]] || return 1 + if printf '%s\n' "$body" | grep -qiE '^[[:space:]]*([#>*-]+[[:space:]]*)?TODO\b'; then + return 1 + fi return 0 } @@ -105,14 +112,14 @@ if file_is_filled "$ss"; then ((l3 += 4)); pass "schema_setup.sql: file filled (no stub TODOs)" # 3a: creates vw_dim_zones - if grep -qiE "VIEW[[:space:]]+vw_dim_zones" "$ss"; then + if grep -qiE "VIEW[[:space:]]+([a-zA-Z_][a-zA-Z0-9_]*\.)?vw_dim_zones\b" "$ss"; then ((l3 += 5)); pass "schema_setup.sql: vw_dim_zones view defined" else fail "schema_setup.sql: vw_dim_zones view not found — check spelling (Task 2)" fi # 3b: creates vw_fact_trips - if grep -qiE "VIEW[[:space:]]+vw_fact_trips" "$ss"; then + if grep -qiE "VIEW[[:space:]]+([a-zA-Z_][a-zA-Z0-9_]*\.)?vw_fact_trips\b" "$ss"; then ((l3 += 5)); pass "schema_setup.sql: vw_fact_trips view defined" else fail "schema_setup.sql: vw_fact_trips view not found — check spelling (Task 2)"