|
1 | 1 | name: Settings refactor phase 2 migration |
2 | 2 |
|
3 | 3 | on: |
4 | | - pull_request: |
5 | | - branches: |
6 | | - - master |
7 | | - paths: |
8 | | - - 'scripts/phase2_catalog_migration.py' |
9 | | - - '.github/workflows/settings-refactor-phase2.yml' |
10 | 4 | push: |
11 | 5 | branches: |
12 | 6 | - agent/settings-refactor-phase1-safety |
13 | 7 | paths: |
14 | 8 | - 'scripts/phase2_catalog_migration.py' |
| 9 | + - 'scripts/phase2_behavior_migration.py' |
| 10 | + - 'tests/test_settings_behavior_migration.py' |
15 | 11 | - '.github/workflows/settings-refactor-phase2.yml' |
16 | 12 | workflow_dispatch: |
17 | 13 |
|
18 | 14 | permissions: |
19 | 15 | contents: write |
20 | 16 |
|
21 | 17 | jobs: |
22 | | - migrate-catalog: |
23 | | - if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository |
| 18 | + migrate: |
24 | 19 | runs-on: ubuntu-latest |
25 | 20 | steps: |
26 | 21 | - uses: actions/checkout@v4 |
27 | 22 | with: |
28 | | - ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.ref || github.ref_name }} |
| 23 | + ref: agent/settings-refactor-phase1-safety |
29 | 24 | fetch-depth: 1 |
30 | 25 | - uses: actions/setup-python@v5 |
31 | 26 | with: |
32 | 27 | 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 |
36 | 33 | 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 |
38 | 35 | python3 scripts/settings_audit.py --report settings-audit.json |
39 | | - - name: Commit catalog migration |
| 36 | + - name: Commit Phase 2 migrations |
40 | 37 | shell: bash |
41 | 38 | 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.' |
44 | 41 | exit 0 |
45 | 42 | fi |
46 | 43 | git config user.name 'github-actions[bot]' |
47 | 44 | 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