Skip to content

Commit 8028fdd

Browse files
committed
Apply phase 2 behavior migration on push
1 parent 68f242b commit 8028fdd

1 file changed

Lines changed: 16 additions & 19 deletions

File tree

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,47 @@
11
name: Settings refactor phase 2 migration
22

33
on:
4-
pull_request:
5-
branches:
6-
- master
7-
paths:
8-
- 'scripts/phase2_catalog_migration.py'
9-
- '.github/workflows/settings-refactor-phase2.yml'
104
push:
115
branches:
126
- agent/settings-refactor-phase1-safety
137
paths:
148
- 'scripts/phase2_catalog_migration.py'
9+
- 'scripts/phase2_behavior_migration.py'
10+
- 'tests/test_settings_behavior_migration.py'
1511
- '.github/workflows/settings-refactor-phase2.yml'
1612
workflow_dispatch:
1713

1814
permissions:
1915
contents: write
2016

2117
jobs:
22-
migrate-catalog:
23-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
18+
migrate:
2419
runs-on: ubuntu-latest
2520
steps:
2621
- uses: actions/checkout@v4
2722
with:
28-
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
23+
ref: agent/settings-refactor-phase1-safety
2924
fetch-depth: 1
3025
- uses: actions/setup-python@v5
3126
with:
3227
python-version: '3.11'
33-
- name: Complete catalog coverage
34-
run: python3 scripts/phase2_catalog_migration.py
35-
- name: Validate migrated catalog
28+
- name: Apply Phase 2 migrations
29+
run: |
30+
python3 scripts/phase2_catalog_migration.py
31+
python3 scripts/phase2_behavior_migration.py
32+
- name: Validate Phase 2 result
3633
run: |
37-
python3 -m unittest tests/test_settings_audit.py
34+
python3 -m unittest tests/test_settings_audit.py tests/test_settings_behavior_migration.py
3835
python3 scripts/settings_audit.py --report settings-audit.json
39-
- name: Commit catalog migration
36+
- name: Commit Phase 2 migrations
4037
shell: bash
4138
run: |
42-
if git diff --quiet -- src/settings-catalog.json; then
43-
echo 'Catalog is already migrated.'
39+
if git diff --quiet -- src/settings-catalog.json src/settings.qml; then
40+
echo 'Phase 2 migrations are already applied.'
4441
exit 0
4542
fi
4643
git config user.name 'github-actions[bot]'
4744
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
48-
git add src/settings-catalog.json
49-
git commit -m 'Complete settings catalog coverage for phase 2'
50-
git push origin HEAD:${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }}
45+
git add src/settings-catalog.json src/settings.qml
46+
git commit -m 'Apply settings refactor phase 2 migrations'
47+
git push origin HEAD:agent/settings-refactor-phase1-safety

0 commit comments

Comments
 (0)