Skip to content

Commit a4abb52

Browse files
committed
Add upstream PR branch helper
1 parent 7446624 commit a4abb52

3 files changed

Lines changed: 19 additions & 3 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
11
## Updating data
22

33
If your changes present a non-bugfix change to one or more datasets which are cloud-hosted (CPS, ECPS and PUF), then please change both the filename and URL (in both the class definition file and in `storage/upload_completed_datasets.py`. This enables us to store historical versions of datasets separately and reproducibly.
4+
5+
## Opening PRs
6+
7+
Push PR branches to the upstream `PolicyEngine/policyengine-us-data` repository, not to a personal fork. From the repo root, run:
8+
9+
`make push-pr-branch`
10+
11+
This avoids the fork-only CI failure path and sets the upstream tracking branch correctly before opening the PR.

CLAUDE.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@
2828
- **CRITICAL**: NEVER create PRs from personal forks - ALL PRs MUST be created from branches pushed to the upstream PolicyEngine repository
2929
- CI requires access to secrets that are not available to fork PRs for security reasons
3030
- Fork PRs will fail on data download steps and cannot be merged
31+
- Before opening a PR, always run `make push-pr-branch` from the repo root. This pushes the current branch to the `upstream` remote and sets the upstream tracking branch correctly for PR creation.
3132
- Always create branches directly on the upstream repository:
3233
```bash
3334
git checkout main
3435
git pull upstream main
3536
git checkout -b your-branch-name
36-
git push -u upstream your-branch-name
37+
make push-pr-branch
3738
```
3839
- Use descriptive branch names like `fix-issue-123` or `add-feature-name`
3940
- Always run `make format` before committing
@@ -62,4 +63,4 @@
6263
- Blacklisting from future publications
6364
- Damage to institutional reputation
6465
- Legal consequences in funded research
65-
- Career-ending academic misconduct charges
66+
- Career-ending academic misconduct charges

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: all format test install download upload docker documentation data validate-data calibrate calibrate-build publish-local-area upload-calibration upload-dataset upload-database push-to-modal build-data-modal build-matrices calibrate-modal calibrate-modal-national calibrate-both stage-h5s stage-national-h5 stage-all-h5s pipeline validate-staging validate-staging-full upload-validation check-staging check-sanity clean build paper clean-paper presentations database database-refresh promote-database promote-dataset promote build-h5s validate-local refresh-soi-targets
1+
.PHONY: all format test install download upload docker documentation data validate-data calibrate calibrate-build publish-local-area upload-calibration upload-dataset upload-database push-to-modal build-data-modal build-matrices calibrate-modal calibrate-modal-national calibrate-both stage-h5s stage-national-h5 stage-all-h5s pipeline validate-staging validate-staging-full upload-validation check-staging check-sanity clean build paper clean-paper presentations database database-refresh promote-database promote-dataset promote build-h5s validate-local refresh-soi-targets push-pr-branch
22

33
GPU ?= T4
44
EPOCHS ?= 1000
@@ -147,6 +147,13 @@ refresh-soi-targets:
147147
--target-year $(SOI_TARGET_YEAR) \
148148
--validate-source-year
149149

150+
push-pr-branch:
151+
@if [ "$(BRANCH)" = "main" ]; then \
152+
echo "Refusing to push main as a PR branch."; \
153+
exit 1; \
154+
fi
155+
@git push -u upstream $(BRANCH)
156+
150157
upload-calibration:
151158
python -c "from policyengine_us_data.utils.huggingface import upload_calibration_artifacts; \
152159
upload_calibration_artifacts()"

0 commit comments

Comments
 (0)