From 6a73f7a8c736849790a711ffacb31fa15b73a332 Mon Sep 17 00:00:00 2001 From: Lasse Benninga Date: Tue, 14 Jul 2026 10:55:28 +0200 Subject: [PATCH 1/2] docs(week-9): add PR packaging template for reviewers Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/PULL_REQUEST_TEMPLATE.md | 42 ++++++++++++++++++++++++++++++++ 1 file changed, 42 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..d1f4d7e --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,42 @@ +## What I built +- Data-quality audit: `validation_queries.sql` +- Star-schema views: `schema_setup.sql` (`vw_dim_zones`, `vw_fact_trips`) +- Data dictionary: `data_dictionary.md` +- Verification queries: `verification_results.sql` +- Per-borough count screenshot: `assets/borough_count.png` +- `## Findings` section added to this README with my actual audit numbers +- AI usage: `AI_ASSIST.md` + +## How to review +- SQL: read `schema_setup.sql` (grain + negative-fare filter + join keys) and `validation_queries.sql`. +- Results: see the `## Findings` section in the README and `assets/borough_count.png`. +- AI usage: `AI_ASSIST.md`. + +## How to run +Run every query against **your own assigned schema** on the shared Azure Postgres (not `public`): + +```bash +psql "" -f validation_queries.sql +psql "" -f schema_setup.sql +psql "" -f verification_results.sql +``` + +Prerequisite: your assigned schema on the shared instance; source tables `nyc_taxi.raw_trips` and `nyc_taxi.raw_zones` already loaded. + +## What reviewers should see (expected results) +Fill in your actual audit numbers (from your `## Findings`): +- Duplicate trips: +- NULL pickup/dropoff location IDs: +- Negative `fare_amount` rows: +- Orphaned `pickup_location_id` (not in raw_zones): +- Busiest borough by trip count: + +## Known limitations / out of scope +- +- Write "none" if everything in the assignment is done and working. + +## Self-check +- [ ] `bash .hyf/test.sh` passes (completeness) +- [ ] `vw_fact_trips` excludes `fare_amount < 0` and joins cleanly to `vw_dim_zones` +- [ ] `## Findings` in the README contains real counts, not "I checked" +- [ ] `assets/borough_count.png` is committed From f3f6d9c342e39b5c35ca0abf2a9f07c2da23829b Mon Sep 17 00:00:00 2001 From: Lasse Benninga Date: Tue, 14 Jul 2026 10:55:28 +0200 Subject: [PATCH 2/2] ci(week-9): 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."