Skip to content

Commit ca4c5c6

Browse files
committed
Merge remote-tracking branch 'origin/main' into mdg-migrations
2 parents dbe9a56 + c92622d commit ca4c5c6

File tree

16 files changed

+916
-361
lines changed

16 files changed

+916
-361
lines changed

.github/workflows/fetch-transform-record.yml renamed to .github/workflows/migrate-prod.yml

Lines changed: 28 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,40 @@
1-
name: Migrate one record from v1 to v2
2-
description: |
3-
This workflow fetches a record from the v1 API, transforms it, and imports the result to v2.
4-
It is designed for test & development purposes.
1+
name: Migrate all records of an event from v1 to v2 (Production)
52

63
on:
74
workflow_dispatch:
85
inputs:
9-
record_id:
10-
description: 'The record ID to process'
6+
environment:
7+
description: 'Environment to run migration in'
8+
required: true
9+
type: choice
10+
default: 'staging'
11+
options:
12+
- staging
13+
- production
14+
event:
15+
description: 'The event to process (birth or death)'
1116
required: true
1217
type: string
1318
domain:
1419
description: 'The environment domain (without protocol or subdomains)'
1520
required: true
1621
type: string
17-
default: 'farajaland-qa.opencrvs.org'
22+
default: 'farajaland.opencrvs.org'
1823

1924
jobs:
20-
fetch-and-transform:
21-
name: Migrate ${{ github.event.inputs.record_id }} in ${{ github.event.inputs.domain }}
25+
migrate:
26+
name: Migrate ${{ github.event.inputs.event }} in ${{ github.event.inputs.environment }} (${{ github.event.inputs.domain }})
2227
runs-on: ubuntu-latest
28+
environment: ${{ github.event.inputs.environment }}
2329
outputs:
2430
script_output: ${{ steps.deno-script.outputs.script_output }}
2531
steps:
2632
- name: Checkout repository
27-
uses: actions/checkout@v4
33+
uses: actions/checkout@v6
34+
with:
35+
ref: ${{ github.ref }}
36+
37+
# ADD VPN SETUP STEPS HERE
2838

2939
- name: Install dependencies
3040
run: |
@@ -36,13 +46,19 @@ jobs:
3646
- name: Convert notebook to TypeScript
3747
run: |
3848
mkdir -p tmp
39-
bash ./scripts/deno-notebook-to-deno.sh ./v1-to-v2-data-migration/fetch-and-transform.ipynb ./tmp/fetch-and-transform.ts
49+
bash ./scripts/deno-notebook-to-deno.sh ./v1-to-v2-data-migration/migrate.ipynb ./tmp/migrate.ts
4050
4151
- name: Run the script with Deno
4252
id: deno-script
53+
env:
54+
OPENCRVS_EVENT: ${{ github.event.inputs.event }}
55+
OPENCRVS_DOMAIN: ${{ github.event.inputs.domain }}
56+
OPENCRVS_CLIENT_ID: ${{ secrets.OPENCRVS_CLIENT_ID }}
57+
OPENCRVS_CLIENT_SECRET: ${{ secrets.OPENCRVS_CLIENT_SECRET }}
4358
run: |
59+
set -o pipefail
4460
echo "script_output<<EOF" >> $GITHUB_OUTPUT
45-
deno run --allow-net ./tmp/fetch-and-transform.ts ${{ github.event.inputs.record_id }} ${{ github.event.inputs.domain }} | tee /dev/stderr >> $GITHUB_OUTPUT
61+
deno run --allow-net --allow-env ./tmp/migrate.ts | tee /dev/stderr >> $GITHUB_OUTPUT
4662
echo "EOF" >> $GITHUB_OUTPUT
4763
4864
- name: Generate summary
@@ -51,5 +67,3 @@ jobs:
5167
echo "" >> $GITHUB_STEP_SUMMARY
5268
echo "" >> $GITHUB_STEP_SUMMARY
5369
echo "${{ steps.deno-script.outputs.script_output }}" >> $GITHUB_STEP_SUMMARY
54-
55-

.github/workflows/migrate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
event:
7-
description: 'The event ID to process'
7+
description: 'The event to process (birth or death)'
88
required: true
99
type: string
1010
domain:
@@ -29,7 +29,7 @@ jobs:
2929
script_output: ${{ steps.deno-script.outputs.script_output }}
3030
steps:
3131
- name: Checkout repository
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@v6
3333
with:
3434
ref: ${{ github.ref }}
3535

ui-tests/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
},
99
"dependencies": {
1010
"lodash": "^4.17.21",
11-
"node-fetch": "^2.6.1"
11+
"node-fetch": "^3.0.0"
1212
},
1313
"devDependencies": {
1414
"@playwright/test": "^1.53.2",
15-
"@types/node": "^18.19.1",
15+
"@types/node": "^24.0.0",
1616
"@types/lodash": "^4.14.117",
1717
"@types/node-fetch": "^2.6.2",
18-
"@types/jest": "^24.0.13"
18+
"@types/jest": "^30.0.0"
1919
}
2020
}

0 commit comments

Comments
 (0)