Skip to content

fix(ci): grant contents:read so grader runs + align autograder with rubric#9

Merged
lassebenni merged 1 commit into
mainfrom
fix/ci-contents-read-and-grader-robustness
Jul 17, 2026
Merged

fix(ci): grant contents:read so grader runs + align autograder with rubric#9
lassebenni merged 1 commit into
mainfrom
fix/ci-contents-read-and-grader-robustness

Conversation

@lassebenni

Copy link
Copy Markdown
Collaborator

What this fixes

Three defects found while verifying the Week 11 autograder against the open student PRs.

1. Grader never runs → no PR comments (the big one)

grade-assignment.yml was missing contents: read in its permissions block. The reusable HackYourFuture/github-actions/.../auto-grade.yml declares permissions: contents: read (for actions/checkout). A reusable workflow cannot request a permission the caller did not grant, so every run was startup_failure and no grader comment was ever posted on any PR. Week 10's working workflow already grants contents: read; this brings Week 11 in line.

2. Autograder rejected psycopg2 (rubric allows it)

Level 3 only credited import sqlalchemy. The rubric explicitly allows "sqlalchemy or psycopg2", so a valid psycopg2 submission lost 5 pts. Now accepts sqlalchemy, psycopg2, or psycopg.

3. Panel count was heading-text-dependent

Level 4 counted panels via ^### Panel, so a student who titled entries by metric name (e.g. ### Trip count by payment type) scored 0 panels and lost up to 10 pts. Now counts any ### heading.

Verification

  • No regression: a real passing submission still scores 95.
  • A psycopg2 app now gets the Level 3 import point (was losing 5).
  • metric_definitions.md with non-"Panel" H3 headings now counts 6 panels (old check: 0).

🤖 Generated with Claude Code

…ubric

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.
@lassebenni
lassebenni merged commit 61d6d70 into main Jul 17, 2026
1 check failed
@lassebenni
lassebenni deleted the fix/ci-contents-read-and-grader-robustness branch July 17, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant