Skip to content

Commit 6a80f0a

Browse files
authored
Merge pull request #697 from PolicyEngine/fix/pipeline-fingerprint-collisions
Fix pipeline fingerprint collisions and consolidate workflows
2 parents ac4db66 + e7fefbb commit 6a80f0a

9 files changed

Lines changed: 232 additions & 165 deletions

File tree

.github/workflows/local_area_promote.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Promote Local Area H5 Files
33
on:
44
workflow_dispatch:
55
inputs:
6-
version:
7-
description: 'Version to promote (e.g. 1.23.0)'
6+
run_id:
7+
description: 'Run ID to promote (e.g. 1.23.0_a1b2c3d4_20260407_120000)'
88
required: true
99
type: string
1010
branch:
@@ -37,7 +37,7 @@ jobs:
3737

3838
- name: Promote staged files to production
3939
run: |
40-
VERSION="${{ github.event.inputs.version }}"
40+
RUN_ID="${{ github.event.inputs.run_id }}"
4141
BRANCH="${{ github.event.inputs.branch }}"
42-
echo "Promoting version ${VERSION} from branch ${BRANCH}"
43-
modal run modal_app/local_area.py::main_promote --version="${VERSION}" --branch="${BRANCH}"
42+
echo "Promoting run ${RUN_ID} from branch ${BRANCH}"
43+
modal run modal_app/local_area.py::main_promote --run-id="${RUN_ID}" --branch="${BRANCH}"

.github/workflows/pipeline.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,25 @@ on:
2525
description: "Skip national calibration/H5"
2626
default: false
2727
type: boolean
28+
resume_run_id:
29+
description: "Resume a failed run by ID (allows mixed provenance)"
30+
default: ""
31+
type: string
32+
version_override:
33+
description: "Override version (default: read from pyproject.toml)"
34+
default: ""
35+
type: string
36+
37+
concurrency:
38+
group: pipeline-main
39+
cancel-in-progress: false
2840

2941
jobs:
3042
pipeline:
3143
runs-on: ubuntu-latest
44+
if: >-
45+
github.event_name == 'workflow_dispatch' ||
46+
github.event.head_commit.message == 'Update package version'
3247
steps:
3348
- uses: actions/checkout@v4
3449

@@ -51,6 +66,8 @@ jobs:
5166
NATIONAL_EPOCHS="${{ inputs.national_epochs || '4000' }}"
5267
NUM_WORKERS="${{ inputs.num_workers || '50' }}"
5368
SKIP_NATIONAL="${{ inputs.skip_national || 'false' }}"
69+
RESUME_RUN_ID="${{ inputs.resume_run_id || '' }}"
70+
VERSION_OVERRIDE="${{ inputs.version_override || '' }}"
5471
5572
python -c "
5673
import modal
@@ -62,6 +79,8 @@ jobs:
6279
national_epochs=int('${NATIONAL_EPOCHS}'),
6380
num_workers=int('${NUM_WORKERS}'),
6481
skip_national='${SKIP_NATIONAL}' == 'true',
82+
resume_run_id='${RESUME_RUN_ID}' or None,
83+
version_override='${VERSION_OVERRIDE}' or '',
6584
)
6685
print(f'Pipeline spawned.')
6786
print(f'Function call ID: {fc.object_id}')

.github/workflows/push.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,38 @@ jobs:
6060
folder: docs/_build/html
6161
clean: true
6262

63+
# ── Versioning (bump + changelog on non-version-bump pushes) ──
64+
versioning:
65+
runs-on: ubuntu-latest
66+
if: github.event.head_commit.message != 'Update package version'
67+
steps:
68+
- name: Generate GitHub App token
69+
id: app-token
70+
uses: actions/create-github-app-token@v1
71+
with:
72+
app-id: ${{ secrets.APP_ID }}
73+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
74+
- uses: actions/checkout@v4
75+
with:
76+
token: ${{ steps.app-token.outputs.token }}
77+
fetch-depth: 0
78+
- uses: actions/setup-python@v5
79+
with:
80+
python-version: "3.14"
81+
- uses: astral-sh/setup-uv@v5
82+
- run: pip install towncrier
83+
- name: Bump version and build changelog
84+
run: |
85+
python .github/bump_version.py
86+
towncrier build --yes --version $(python -c "import re; print(re.search(r'version = \"(.+?)\"', open('pyproject.toml').read()).group(1))")
87+
- name: Update lockfile
88+
run: uv lock
89+
- name: Update changelog
90+
uses: EndBug/add-and-commit@v9
91+
with:
92+
add: "."
93+
message: Update package version
94+
6395
# ── PyPI publish (version bump commits only) ────────────────
6496
publish:
6597
runs-on: ubuntu-latest

.github/workflows/versioning.yaml

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)