Skip to content

Commit ba8196d

Browse files
author
Lasse Benninga
committed
fix(ci): grant contents:read so grader runs + align autograder with rubric
1. .github/workflows/grade-assignment.yml: add 'contents: read' to the job permissions. The reusable auto-grade.yml requests contents:read (its actions/checkout needs it); a reusable workflow cannot request a permission the caller did not grant, so every run was startup_failure and no grader comment ever posted. Week 10's working workflow already has it. 2. .hyf/test.sh Level 3: accept psycopg2/psycopg imports, not just sqlalchemy. The rubric allows 'sqlalchemy or psycopg2'; the grader only credited sqlalchemy, under-scoring a valid psycopg2 submission by 5 pts. 3. .hyf/test.sh Level 4: count any H3 heading as a documented panel instead of only '### Panel'. A student who titles entries by metric name rather than 'Panel N' was scored 0 panels despite documenting them. Verified: no regression on a passing submission (95 -> 95); a psycopg2 app now gets the import point; panels titled by metric name are counted.
1 parent 0a5b1b1 commit ba8196d

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/grade-assignment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
jobs:
99
grade:
1010
permissions:
11+
contents: read
1112
issues: write
1213
pull-requests: write
1314
uses: HackYourFuture/github-actions/.github/workflows/auto-grade.yml@main

.hyf/test.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ pass "Level 2: secrets hygiene ($l2/15 pts)"
8888
# ── Level 3 (25 pts): Streamlit app content ─────────────────────────────────
8989
l3=0
9090
if [[ -f "$app" ]]; then
91-
if pygrep "^import sqlalchemy|^from sqlalchemy" "$app"; then
92-
l3=$((l3 + 5)); pass "app.py: imports sqlalchemy"
91+
if pygrep "^import sqlalchemy|^from sqlalchemy|^import psycopg|^from psycopg" "$app"; then
92+
l3=$((l3 + 5)); pass "app.py: imports a Postgres driver (sqlalchemy or psycopg2)"
9393
else
94-
fail "app.py: no sqlalchemy import found"
94+
fail "app.py: no sqlalchemy or psycopg2 import found"
9595
fi
9696

9797
if pygrep "os\.environ|os\.getenv" "$app"; then
@@ -146,7 +146,9 @@ if file_has_content "$defs"; then
146146
l4=$((l4 + 5)); warn "metric_definitions.md: only $fields_ok/5 fields found"
147147
fi
148148

149-
panel_count=$(grep -cE "^### Panel" "$defs" 2>/dev/null || true)
149+
# Count any H3 heading as a documented panel, so students who title
150+
# entries by metric name rather than "Panel N" still get credit.
151+
panel_count=$(grep -cE "^### " "$defs" 2>/dev/null || true)
150152
if [[ "$panel_count" -ge 4 ]]; then
151153
l4=$((l4 + 10)); pass "metric_definitions.md: $panel_count panels documented (>=4 expected: 3 Metabase + 1 Streamlit)"
152154
elif [[ "$panel_count" -ge 2 ]]; then

0 commit comments

Comments
 (0)