From cbf7cff7281d6071164ca25eb6454b7788de4cd3 Mon Sep 17 00:00:00 2001 From: "baogorek@gmail.com" Date: Tue, 14 Oct 2025 16:44:02 -0400 Subject: [PATCH 1/6] Add downstream CI to test policyengine-us-data compatibility This workflow will run policyengine-us-data's PUF tests to catch breaking changes in microimpute before they affect downstream packages. The test runs on PRs and pushes to main, helping developers know immediately if their changes break dependent packages. --- .../workflows/downstream-compatibility.yml | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/downstream-compatibility.yml diff --git a/.github/workflows/downstream-compatibility.yml b/.github/workflows/downstream-compatibility.yml new file mode 100644 index 0000000..612525b --- /dev/null +++ b/.github/workflows/downstream-compatibility.yml @@ -0,0 +1,58 @@ +name: Downstream Compatibility + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + test-policyengine-us-data: + name: Test policyengine-us-data compatibility + runs-on: ubuntu-latest + + steps: + - name: Checkout microimpute + uses: actions/checkout@v4 + with: + path: microimpute + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.10' + + - name: Install microimpute from current branch + run: | + cd microimpute + pip install -e . + + - name: Checkout policyengine-us-data + uses: actions/checkout@v4 + with: + repository: PolicyEngine/policyengine-us-data + path: policyengine-us-data + + - name: Install policyengine-us-data dependencies + run: | + cd policyengine-us-data + pip install -e . + + - name: Run Build Datasets test + run: | + cd policyengine-us-data + # Run just the dataset build tests that use microimpute + pytest tests/ -k "test_puf" -v --tb=short + continue-on-error: true # Optional: don't block PRs, just warn + + - name: Post comment on failure + if: failure() + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '⚠️ This change may break policyengine-us-data. Please check the [Build Datasets test results](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).' + }) \ No newline at end of file From fb94de9768db714fae47d7ec2d73d8b7eb251747 Mon Sep 17 00:00:00 2001 From: "baogorek@gmail.com" Date: Tue, 14 Oct 2025 16:46:02 -0400 Subject: [PATCH 2/6] Add changelog entry for downstream CI --- changelog_entry.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29..75ca57f 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: minor + changes: + added: + - Downstream compatibility CI workflow to test policyengine-us-data integration \ No newline at end of file From 01db3ce9cb23ca2a2c1524f6ff97a9d391cdc5df Mon Sep 17 00:00:00 2001 From: "baogorek@gmail.com" Date: Tue, 14 Oct 2025 16:49:15 -0400 Subject: [PATCH 3/6] Fix Python version in downstream CI workflow Use Python 3.12 to match microimpute's minimum required version --- .github/workflows/downstream-compatibility.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/downstream-compatibility.yml b/.github/workflows/downstream-compatibility.yml index 612525b..9a1efc2 100644 --- a/.github/workflows/downstream-compatibility.yml +++ b/.github/workflows/downstream-compatibility.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.10' + python-version: '3.12' - name: Install microimpute from current branch run: | From bca0aa4a85f66545789b6a9c3274971f6022a28b Mon Sep 17 00:00:00 2001 From: "baogorek@gmail.com" Date: Tue, 14 Oct 2025 17:06:56 -0400 Subject: [PATCH 4/6] Fix downstream CI to run actual data generation pipeline Run 'make download' and 'make data' with TEST_LITE=True to properly test microimpute integration in policyengine-us-data's data generation pipeline --- .github/workflows/downstream-compatibility.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/downstream-compatibility.yml b/.github/workflows/downstream-compatibility.yml index 9a1efc2..2e3959b 100644 --- a/.github/workflows/downstream-compatibility.yml +++ b/.github/workflows/downstream-compatibility.yml @@ -41,8 +41,10 @@ jobs: - name: Run Build Datasets test run: | cd policyengine-us-data - # Run just the dataset build tests that use microimpute - pytest tests/ -k "test_puf" -v --tb=short + # Download required data files + TEST_LITE=True make download + # Build datasets - this will test microimpute integration + TEST_LITE=True make data continue-on-error: true # Optional: don't block PRs, just warn - name: Post comment on failure From 772912c7221c304fc45a00dc695a1e8c8dafe90f Mon Sep 17 00:00:00 2001 From: "baogorek@gmail.com" Date: Tue, 14 Oct 2025 17:10:06 -0400 Subject: [PATCH 5/6] Fix formatting - add trailing newline to changelog_entry.yaml --- changelog_entry.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog_entry.yaml b/changelog_entry.yaml index 75ca57f..aebe819 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -1,4 +1,4 @@ - bump: minor changes: added: - - Downstream compatibility CI workflow to test policyengine-us-data integration \ No newline at end of file + - Downstream compatibility CI workflow to test policyengine-us-data integration From 81382b2ecb059b8d14a45ac280f901d43f2326c4 Mon Sep 17 00:00:00 2001 From: "baogorek@gmail.com" Date: Tue, 14 Oct 2025 17:17:25 -0400 Subject: [PATCH 6/6] Remove continue-on-error and add HUGGING_FACE_TOKEN to downstream CI - Remove continue-on-error so the check accurately reflects pass/fail status - Add HUGGING_FACE_TOKEN environment variable for downloading required data - This ensures the CI properly blocks PRs that would break policyengine-us-data --- .github/workflows/downstream-compatibility.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/downstream-compatibility.yml b/.github/workflows/downstream-compatibility.yml index 2e3959b..d5f9d1a 100644 --- a/.github/workflows/downstream-compatibility.yml +++ b/.github/workflows/downstream-compatibility.yml @@ -39,13 +39,14 @@ jobs: pip install -e . - name: Run Build Datasets test + env: + HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} run: | cd policyengine-us-data # Download required data files TEST_LITE=True make download # Build datasets - this will test microimpute integration TEST_LITE=True make data - continue-on-error: true # Optional: don't block PRs, just warn - name: Post comment on failure if: failure()