Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
## What I built
- Staging models: `stg_trips.sql`, `stg_zones.sql` (+ their `_*.yml` tests/descriptions)
- Mart: `fct_daily_borough_stats.sql` at grain one row per (pickup_borough, pickup_date)
- Macro: `safe_divide.sql`
- Singular test: `assert_avg_tip_pct_within_bounds.sql`
- `dbt_utils` declared in `packages.yml`
- Lineage screenshot: `docs/lineage.png`
- Business answers: `reports/answers.md`
- AI usage: `AI_ASSIST.md`

## How to review
- Models: read `models/marts/fct_daily_borough_stats.sql` (grain + measures) and the staging models.
- Lineage: `docs/lineage.png`.
- Answers: `reports/answers.md`.
- AI usage: `AI_ASSIST.md`.

## How to run
From a clean clone, with your own Postgres access:

```bash
cp profiles.yml.example profiles.yml # set schema to dev_<your_name>
cp .env.example .env # fill PG_HOST, PG_USER, PG_PASSWORD
source .env
dbt deps
dbt build # runs models + tests
```

`dbt debug` must end with `All checks passed!` first.

> Data dependency: this builds into **your own** `dev_<name>` schema on the shared Postgres. A reviewer without that access relies on `docs/lineage.png` and `reports/answers.md` as the canonical evidence.

## What reviewers should see (expected results)
Fill in what your build actually produces:
- `dbt build` result: <e.g. PASS=NN WARN=1 ERROR=0>
- `fct_daily_borough_stats` row count: <e.g. ~180>
- Grain: one row per (pickup_borough, pickup_date)
- One business answer sample: <e.g. Manhattan has the most trips>

## Known limitations / out of scope
- <e.g. the singular test WARNs rather than errors by design; incremental not implemented>
- Write "none" if everything in the assignment is done and working.

## Self-check
- [ ] `bash .hyf/test.sh` passes
- [ ] `dbt build` completes with no ERROR
- [ ] `fct_daily_borough_stats` exists as a **table** at the stated grain
- [ ] No credentials committed (`profiles.yml` / `.env` are gitignored)
- [ ] `docs/lineage.png` is committed
52 changes: 52 additions & 0 deletions .github/workflows/pr-body-check.yml
Original file line number Diff line number Diff line change
@@ -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."
Loading