Skip to content

Commit 45cc322

Browse files
Merge pull request #98 from fingerprintjs/inter-2069-recurrent-care
INTER-2069 Recurrent care
2 parents 8abbc4b + 0d08997 commit 45cc322

25 files changed

Lines changed: 1079 additions & 1602 deletions

.eslintrc.json

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

.github/workflows/akamai_property_cleanup.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212
name: Clear Redundant Akamai Properties
1313
steps:
14-
- uses: actions/checkout@v4
14+
- uses: actions/checkout@v7
1515
- name: 'Install pnpm'
16-
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
17-
with:
18-
version: 8
16+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
1917
- name: Install node
20-
uses: actions/setup-node@v4
18+
uses: actions/setup-node@v6
2119
with:
2220
node-version-file: '.node-version'
2321
- name: Install dependencies
2422
run: pnpm install
2523
- name: Clear Redundant Properties from Akamai
26-
run: pnpm ts-node scripts/clearProperties.ts
24+
run: pnpm clear-properties
2725
env:
2826
AK_HOST: '${{secrets.AK_HOST}}'
2927
AK_CLIENT_TOKEN: '${{secrets.AK_CLIENT_TOKEN}}'

.github/workflows/ci-cleanup.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ jobs:
1515
echo SUBDOMAIN=mock-$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | perl -pe 's/[^a-zA-Z0-9]+/-/g and s/-+$//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
1616
- name: Check If DNS Record Exists
1717
id: cloudflare-dns-check
18-
uses: fjogeleit/http-request-action@v1
18+
uses: fjogeleit/http-request-action@f98bb26551cd1af7d3eb2674578a80754ece88db #v2.0.1
1919
with:
2020
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records?name=${{steps.extract-branch.outputs.SUBDOMAIN}}.${{secrets.FPJS_CI_DOMAIN}}&tags=owner:akamai-integration-ci'
2121
method: 'GET'
2222
customHeaders: '{"Authorization": "Bearer ${{ secrets.CF_AUTH_TOKEN }}"}'
2323
- name: Delete Cloudflare DNS Record
2424
if: ${{ fromJson(steps.cloudflare-dns-check.outputs.response).result_info.total_count > 0 }}
25-
uses: fjogeleit/http-request-action@v1
25+
uses: fjogeleit/http-request-action@f98bb26551cd1af7d3eb2674578a80754ece88db #v2.0.1
2626
with:
2727
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records/${{ fromJson(steps.cloudflare-dns-check.outputs.response).result[0].id }}'
2828
method: 'DELETE'
@@ -38,14 +38,14 @@ jobs:
3838
echo SUBDOMAIN=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | perl -pe 's/[^a-zA-Z0-9]+/-/g and s/-+$//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
3939
- name: Check If DNS Record Exists
4040
id: cloudflare-dns-check
41-
uses: fjogeleit/http-request-action@v1
41+
uses: fjogeleit/http-request-action@f98bb26551cd1af7d3eb2674578a80754ece88db #v2.0.1
4242
with:
4343
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records?name=${{steps.extract-branch.outputs.SUBDOMAIN}}.${{secrets.FPJS_CI_DOMAIN}}&tags=owner:akamai-integration-ci'
4444
method: 'GET'
4545
customHeaders: '{"Authorization": "Bearer ${{ secrets.CF_AUTH_TOKEN }}"}'
4646
- name: Delete Cloudflare DNS Record
4747
if: ${{ fromJson(steps.cloudflare-dns-check.outputs.response).result_info.total_count > 0 }}
48-
uses: fjogeleit/http-request-action@v1
48+
uses: fjogeleit/http-request-action@f98bb26551cd1af7d3eb2674578a80754ece88db #v2.0.1
4949
with:
5050
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records/${{ fromJson(steps.cloudflare-dns-check.outputs.response).result[0].id }}'
5151
method: 'DELETE'

.github/workflows/ci.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v7
1818
- name: 'Install pnpm'
19-
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
20-
with:
21-
version: 8
19+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
2220
- name: Install node
23-
uses: actions/setup-node@v4
21+
uses: actions/setup-node@v6
2422
with:
2523
node-version-file: '.node-version'
2624
- name: 'Install dependencies'
@@ -31,14 +29,14 @@ jobs:
3129
echo SUBDOMAIN=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | perl -pe 's/[^a-zA-Z0-9]+/-/g and s/-+$//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
3230
- name: Check If DNS Record Exists
3331
id: cloudflare-dns-check
34-
uses: fjogeleit/http-request-action@v1
32+
uses: fjogeleit/http-request-action@f98bb26551cd1af7d3eb2674578a80754ece88db #v2.0.1
3533
with:
3634
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records?name=${{steps.extract-branch.outputs.SUBDOMAIN}}.${{secrets.FPJS_CI_DOMAIN}}'
3735
method: 'GET'
3836
customHeaders: '{"Authorization": "Bearer ${{ secrets.CF_AUTH_TOKEN }}"}'
3937
- name: Create Cloudflare DNS Record
4038
if: ${{ fromJson(steps.cloudflare-dns-check.outputs.response).result_info.total_count < 1 }}
41-
uses: fjogeleit/http-request-action@v1
39+
uses: fjogeleit/http-request-action@f98bb26551cd1af7d3eb2674578a80754ece88db #v2.0.1
4240
with:
4341
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records'
4442
method: 'POST'
@@ -56,7 +54,7 @@ jobs:
5654
AK_GROUP_ID: '${{secrets.AK_GROUP_ID}}'
5755
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}'
5856
FPJS_CI_DOMAIN: '${{secrets.FPJS_CI_DOMAIN}}'
59-
run: pnpm ts-node scripts/checkPropertyCanBeCreated.ts
57+
run: pnpm check-property
6058
- name: Create Akamai Property
6159
if: steps.check-akamai-property.outcome == 'success'
6260
id: create-akamai-property
@@ -69,7 +67,7 @@ jobs:
6967
AK_GROUP_ID: '${{secrets.AK_GROUP_ID}}'
7068
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}'
7169
FPJS_CI_DOMAIN: '${{secrets.FPJS_CI_DOMAIN}}'
72-
run: pnpm ts-node scripts/createProperty.ts
70+
run: pnpm create-property
7371
- name: Build Patch Body
7472
run: pnpm build --type patchBody --proxy-secret '${{secrets.FPJS_PROXY_SECRET}}' --integration-path ${{secrets.INTEGRATION_PATH}} --agent-path ${{secrets.AGENT_PATH}} --result-path ${{secrets.RESULT_PATH}}
7573
- name: Deploy Akamai Rules
@@ -84,18 +82,16 @@ jobs:
8482
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}'
8583
FPJS_CI_DOMAIN: '${{secrets.FPJS_CI_DOMAIN}}'
8684
NOTIFY_EMAIL_ADDRESS: ${{secrets.NOTIFY_EMAIL_ADDRESS}}
87-
run: pnpm ts-node scripts/deployRules.ts
85+
run: pnpm deploy-rules
8886
ci-mock: # This is the Deployer for mock-warden e2e tests, it's not a duplicate
8987
runs-on: ubuntu-latest
9088
steps:
9189
- name: Checkout
92-
uses: actions/checkout@v4
90+
uses: actions/checkout@v7
9391
- name: 'Install pnpm'
94-
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
95-
with:
96-
version: 8
92+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
9793
- name: Install node
98-
uses: actions/setup-node@v4
94+
uses: actions/setup-node@v6
9995
with:
10096
node-version-file: '.node-version'
10197
- name: Install dependencies
@@ -106,14 +102,14 @@ jobs:
106102
echo SUBDOMAIN=mock-$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | perl -pe 's/[^a-zA-Z0-9]+/-/g and s/-+$//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
107103
- name: Check If DNS Record Exists
108104
id: cloudflare-dns-check
109-
uses: fjogeleit/http-request-action@v1
105+
uses: fjogeleit/http-request-action@f98bb26551cd1af7d3eb2674578a80754ece88db #v2.0.1
110106
with:
111107
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records?name=${{steps.extract-branch.outputs.SUBDOMAIN}}.${{secrets.FPJS_CI_DOMAIN}}'
112108
method: 'GET'
113109
customHeaders: '{"Authorization": "Bearer ${{ secrets.CF_AUTH_TOKEN }}"}'
114110
- name: Create Cloudflare DNS Record
115111
if: ${{ fromJson(steps.cloudflare-dns-check.outputs.response).result_info.total_count < 1 }}
116-
uses: fjogeleit/http-request-action@v1
112+
uses: fjogeleit/http-request-action@f98bb26551cd1af7d3eb2674578a80754ece88db #v2.0.1
117113
with:
118114
url: 'https://api.cloudflare.com/client/v4/zones/${{ secrets.CF_ZONE_ID }}/dns_records'
119115
method: 'POST'
@@ -131,7 +127,7 @@ jobs:
131127
AK_GROUP_ID: '${{secrets.AK_GROUP_ID}}'
132128
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}'
133129
FPJS_CI_DOMAIN: '${{secrets.FPJS_CI_DOMAIN}}'
134-
run: pnpm ts-node scripts/checkPropertyCanBeCreated.ts
130+
run: pnpm check-property
135131
- name: Create Akamai Property
136132
if: steps.check-akamai-property.outcome == 'success'
137133
id: create-akamai-property
@@ -144,7 +140,7 @@ jobs:
144140
AK_GROUP_ID: '${{secrets.AK_GROUP_ID}}'
145141
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}'
146142
FPJS_CI_DOMAIN: '${{secrets.FPJS_CI_DOMAIN}}'
147-
run: pnpm ts-node scripts/createProperty.ts
143+
run: pnpm create-property
148144
- name: Build Patch Body
149145
run: pnpm build --type patchBody --proxy-secret secret --integration-path ${{secrets.INTEGRATION_PATH}} --agent-path ${{secrets.AGENT_PATH}} --result-path ${{secrets.RESULT_PATH}} --ingress-url ${{secrets.MOCK_FPCDN}}
150146
- name: Deploy Akamai Rules
@@ -159,4 +155,4 @@ jobs:
159155
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}'
160156
FPJS_CI_DOMAIN: '${{secrets.FPJS_CI_DOMAIN}}'
161157
NOTIFY_EMAIL_ADDRESS: ${{secrets.NOTIFY_EMAIL_ADDRESS}}
162-
run: pnpm ts-node scripts/deployRules.ts
158+
run: pnpm deploy-rules

.github/workflows/e2eForPR.yml

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,35 @@ on:
44
pull_request:
55

66
jobs:
7-
check-changed-files:
7+
check_changed_files:
88
runs-on: ubuntu-latest
99
name: Check changed files
1010
outputs:
11-
CANT_PASS_WITHOUT_TESTS: ${{ steps.decision.outputs.CANT_PASS_WITHOUT_TESTS }}
11+
any_changed: ${{ steps.files.outputs.test_any_changed }}
1212
steps:
13+
- uses: actions/checkout@v7
14+
with:
15+
fetch-depth: 0
1316
- id: files
14-
uses: jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42
15-
- name: Make decision based on changed files
16-
id: decision
17-
run: |
18-
cantPassWithoutTests=false
19-
for changed_file in ${{ steps.files.outputs.all }}; do
20-
if [[ ${changed_file} =~ ^(assets|generators)\/.+$ ]]; then
21-
cantPassWithoutTests=true
22-
fi
23-
if [[ ${changed_file} =~ ^build\.ts$ ]]; then
24-
cantPassWithoutTests=true
25-
fi
26-
if [[ ${changed_file} =~ .*ci\.yml$ ]]; then
27-
cantPassWithoutTests=true
28-
fi
29-
done
30-
echo $cantPassWithoutTests
31-
echo CANT_PASS_WITHOUT_TESTS=${cantPassWithoutTests} >> $GITHUB_OUTPUT
17+
uses: step-security/changed-files@2e07db73e5ccdb319b9a6c7766bd46d39d304bad # v47
18+
with:
19+
files_yaml: |
20+
test:
21+
- assets/**
22+
- generators/**
23+
- build.ts
24+
- "**/*ci.yml"
3225
build-and-test-e2e:
3326
runs-on: ubuntu-latest
3427
name: Test e2e for PR
35-
needs: check-changed-files
36-
if: needs['check-changed-files'].outputs.CANT_PASS_WITHOUT_TESTS == 'true'
28+
needs: check_changed_files
29+
if: needs.check_changed_files.outputs.any_changed == 'true'
3730
steps:
38-
- uses: actions/checkout@v4
31+
- uses: actions/checkout@v7
3932
- name: 'Install pnpm'
40-
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
41-
with:
42-
version: 8
33+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
4334
- name: Install node
44-
uses: actions/setup-node@v4
35+
uses: actions/setup-node@v6
4536
with:
4637
node-version-file: '.node-version'
4738
- name: Install dependencies

.github/workflows/mockE2E.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@ jobs:
1616
runs-on: ubuntu-latest
1717
name: Test e2e for PR using mock app
1818
steps:
19-
- uses: actions/checkout@v4
19+
- uses: actions/checkout@v7
2020
- name: 'Install pnpm'
21-
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
22-
with:
23-
version: 8
21+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
2422
- name: Install node
25-
uses: actions/setup-node@v3
23+
uses: actions/setup-node@v6
2624
with:
2725
node-version-file: '.node-version'
2826
- name: Install dependencies

.github/workflows/mockE2EForPR.yml

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,36 @@ on:
44
pull_request:
55

66
jobs:
7-
check-changed-files:
7+
check_changed_files:
88
runs-on: ubuntu-latest
99
name: Check changed files
1010
outputs:
11-
CANT_PASS_WITHOUT_TESTS: ${{ steps.decision.outputs.CANT_PASS_WITHOUT_TESTS }}
11+
any_changed: ${{ steps.files.outputs.test_any_changed }}
1212
steps:
13+
- uses: actions/checkout@v7
14+
with:
15+
fetch-depth: 0
1316
- id: files
14-
uses: jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42
15-
- name: Make decision based on changed files
16-
id: decision
17-
run: |
18-
cantPassWithoutTests=false
19-
for changed_file in ${{ steps.files.outputs.all }}; do
20-
if [[ ${changed_file} =~ ^(assets|generators)\/.+$ ]]; then
21-
cantPassWithoutTests=true
22-
fi
23-
if [[ ${changed_file} =~ ^build\.ts$ ]]; then
24-
cantPassWithoutTests=true
25-
fi
26-
if [[ ${changed_file} =~ scripts\/mockTests\.ts$ ]]; then
27-
cantPassWithoutTests=true
28-
fi
29-
if [[ ${changed_file} =~ .*ci\.yml$ ]]; then
30-
cantPassWithoutTests=true
31-
fi
32-
done
33-
echo $cantPassWithoutTests
34-
echo CANT_PASS_WITHOUT_TESTS=${cantPassWithoutTests} >> $GITHUB_OUTPUT
17+
uses: step-security/changed-files@2e07db73e5ccdb319b9a6c7766bd46d39d304bad # v47
18+
with:
19+
files_yaml: |
20+
test:
21+
- assets/**
22+
- generators/**
23+
- build.ts
24+
- scripts/mockTests.ts
25+
- "**/*ci.yml"
3526
build-and-test-e2e-mock:
3627
runs-on: ubuntu-latest
3728
name: Test e2e for PR using mock app
38-
needs: check-changed-files
39-
if: needs['check-changed-files'].outputs.CANT_PASS_WITHOUT_TESTS == 'true'
29+
needs: check_changed_files
30+
if: needs.check_changed_files.outputs.any_changed == 'true'
4031
steps:
41-
- uses: actions/checkout@v3
42-
- uses: actions/checkout@v4
32+
- uses: actions/checkout@v7
4333
- name: 'Install pnpm'
44-
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
45-
with:
46-
version: 8
34+
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
4735
- name: Install node
48-
uses: actions/setup-node@v3
36+
uses: actions/setup-node@v6
4937
with:
5038
node-version-file: '.node-version'
5139
- name: Install dependencies

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ You are required to follow [conventional commits](https://www.conventionalcommit
2222

2323
### How to test
2424

25-
End-to-end tests are written in [playwright](https://github.com/microsoft/playwright) and located in the `e2e` folder.
26-
These tests are run automatically by the `e2e.yml` workflow on every PR automatically, you don't need to run them locally.
25+
End-to-end tests are written in [playwright](https://github.com/microsoft/playwright) and located in the `test/e2e` folder.
26+
These tests are run automatically by the `e2eForPR.yml` workflow on every PR automatically, you don't need to run them locally.
2727

2828
### Changing API URLs
2929

build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import arg from 'arg'
2-
import generatePatchBody from './generators/generatePatchBody'
2+
import generatePatchBody from './generators/generatePatchBody.ts'
33
import fs from 'fs'
44
import path from 'path'
5-
import generateTerraformPropertyRules from './generators/generateTerraformPropertyRules'
5+
import generateTerraformPropertyRules from './generators/generateTerraformPropertyRules.ts'
66

77
const args = arg({
88
'--type': String,

0 commit comments

Comments
 (0)