Skip to content

Commit 0a5b1b1

Browse files
authored
Merge pull request #7 from HackYourFuture/docs/pr-packaging-template
docs+ci: strengthen PR template (expected results) + enforce in CI
2 parents c917d56 + 1c0658e commit 0a5b1b1

2 files changed

Lines changed: 65 additions & 0 deletions

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,19 @@ uv run streamlit run app.py
2121

2222
Prerequisite: your own `fct_trips` mart populated in your `dev_<name>` schema (from Week 10).
2323

24+
> Data dependency: these run steps need **your own** Week 10 mart. A reviewer who does not have that data cannot rebuild your numbers, so the committed **screenshots / PDF export are the canonical evidence** of a working submission.
25+
26+
## What reviewers should see (expected results)
27+
Fill in the numbers your dashboard and app actually show, so a reviewer can tell at a glance whether the result looks correct:
28+
- Total trips (`fct_trips` row count): <e.g. ~57k>
29+
- Busiest hour of day: <e.g. 18:00>
30+
- Top payment type by share: <e.g. credit card, ~70%>
31+
- Data freshness (latest trip date shown): <e.g. 2023-01-31>
32+
33+
## Known limitations / out of scope
34+
- <e.g. auto-refresh not implemented; dashboard covers January 2023 only; one Metabase filter still hardcoded>
35+
- Write "none" if everything in the assignment is done and working.
36+
2437
## Extra completed
2538
- [ ] Metabase date filter on >=2 Questions
2639
- [ ] Streamlit auto-refresh
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: PR body check
2+
3+
# Fails the check when a pull request description is missing the sections from
4+
# .github/PULL_REQUEST_TEMPLATE.md. GitHub only auto-fills that template in the
5+
# web "compose" form and in `gh pr create` with no --body; a PR opened through
6+
# the REST API or `gh pr create --body "..."` (the path most AI tools take)
7+
# silently skips it. This check is the only thing that actually enforces it.
8+
#
9+
# Recovery is automatic: editing the PR description fires the `edited` event and
10+
# re-runs this check with the new body. No new commit or manual re-run needed.
11+
12+
on:
13+
pull_request:
14+
types: [opened, edited, reopened, synchronize]
15+
branches: [main]
16+
17+
permissions:
18+
contents: read
19+
20+
jobs:
21+
check:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check required sections are present
25+
env:
26+
PR_BODY: ${{ github.event.pull_request.body }}
27+
run: |
28+
set -euo pipefail
29+
required=(
30+
"## What I built"
31+
"## How to review"
32+
"## How to run"
33+
"## What reviewers should see"
34+
"## Self-check"
35+
)
36+
missing=()
37+
for section in "${required[@]}"; do
38+
if ! printf '%s' "$PR_BODY" | grep -qiF "$section"; then
39+
missing+=("$section")
40+
fi
41+
done
42+
if [ ${#missing[@]} -ne 0 ]; then
43+
echo "::error::Your PR description is missing required sections. Start from the template (.github/PULL_REQUEST_TEMPLATE.md) and keep these headings:"
44+
for m in "${missing[@]}"; do echo " - $m"; done
45+
echo ""
46+
echo "If you (or an AI tool) opened this PR without the template, click 'Edit' on the"
47+
echo "PR description, paste the template, and fill it in. Editing the description"
48+
echo "re-runs this check automatically. A complete PR is easy to review and"
49+
echo "reproducible: that is part of the assignment."
50+
exit 1
51+
fi
52+
echo "All required PR sections present."

0 commit comments

Comments
 (0)