From 6d3f09ef79c25acd38b20adca624522fdf23081e Mon Sep 17 00:00:00 2001 From: Lasse Benninga Date: Tue, 14 Jul 2026 10:55:25 +0200 Subject: [PATCH 1/2] docs(week-5): add PR packaging template for reviewers Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/PULL_REQUEST_TEMPLATE.md | 44 ++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..ea0f9e9 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,44 @@ +## What I built +- Implemented pipeline functions in `src/pipeline.py` (the three `NotImplementedError` stubs) +- Pinned dependencies in `requirements.txt` +- Cache-friendly `Dockerfile` +- CI workflow in `.github/workflows/ci.yml` +- ACR push (Task 7): image pushed to the class registry, screenshot committed +- AI usage: `AI_ASSIST.md` + +## How to review +- Code: read `src/pipeline.py` and `tests/test_pipeline.py`. +- CI: see the green run on this PR, or the committed screenshot of the ACR push. +- AI usage: `AI_ASSIST.md`. + +## How to run +From a clean clone: + +```bash +python -m venv .venv && source .venv/bin/activate +pip install -r requirements.txt +API_KEY=test pytest -q +docker build -t my-pipeline:1.0 . +docker run --rm -e API_KEY=test my-pipeline:1.0 +``` + +Prerequisite: Docker installed. The `AZURE_CREDENTIALS` for Task 7 come from your teacher over Slack. + +## What reviewers should see (expected results) +Fill in what your run actually produces, so a reviewer can eyeball correctness: +- `pytest` result: +- Docker run output: +- ACR image tag pushed: + +## Known limitations / out of scope +- +- Write "none" if everything in the assignment is done and working. + +## Extra completed +- [ ] Any bonus / stretch items from the chapter + +## Self-check +- [ ] `bash .hyf/test.sh` passes +- [ ] `API_KEY=test pytest -q` passes locally +- [ ] No credentials committed (no secrets in code, `.env`/creds are gitignored) +- [ ] Screenshot of the ACR push is committed From c5f6417f591b695fae2b3b65817366d21db77eb8 Mon Sep 17 00:00:00 2001 From: Lasse Benninga Date: Tue, 14 Jul 2026 10:55:25 +0200 Subject: [PATCH 2/2] ci(week-5): enforce PR template sections via pr-body-check workflow Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/pr-body-check.yml | 52 +++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/pr-body-check.yml diff --git a/.github/workflows/pr-body-check.yml b/.github/workflows/pr-body-check.yml new file mode 100644 index 0000000..8d066d9 --- /dev/null +++ b/.github/workflows/pr-body-check.yml @@ -0,0 +1,52 @@ +name: PR body check + +# Fails the check when a pull request description is missing the sections from +# .github/PULL_REQUEST_TEMPLATE.md. GitHub only auto-fills that template in the +# web "compose" form and in `gh pr create` with no --body; a PR opened through +# the REST API or `gh pr create --body "..."` (the path most AI tools take) +# silently skips it. This check is the only thing that actually enforces it. +# +# Recovery is automatic: editing the PR description fires the `edited` event and +# re-runs this check with the new body. No new commit or manual re-run needed. + +on: + pull_request: + types: [opened, edited, reopened, synchronize] + branches: [main] + +permissions: + contents: read + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Check required sections are present + env: + PR_BODY: ${{ github.event.pull_request.body }} + run: | + set -euo pipefail + required=( + "## What I built" + "## How to review" + "## How to run" + "## What reviewers should see" + "## Self-check" + ) + missing=() + for section in "${required[@]}"; do + if ! printf '%s' "$PR_BODY" | grep -qiF "$section"; then + missing+=("$section") + fi + done + if [ ${#missing[@]} -ne 0 ]; then + echo "::error::Your PR description is missing required sections. Start from the template (.github/PULL_REQUEST_TEMPLATE.md) and keep these headings:" + for m in "${missing[@]}"; do echo " - $m"; done + echo "" + echo "If you (or an AI tool) opened this PR without the template, click 'Edit' on the" + echo "PR description, paste the template, and fill it in. Editing the description" + echo "re-runs this check automatically. A complete PR is easy to review and" + echo "reproducible: that is part of the assignment." + exit 1 + fi + echo "All required PR sections present."