From 5bf28d2b35b269a42166ac13eb4d6f61fc89274c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20Ayd=C4=B1n?= Date: Thu, 24 Sep 2026 20:31:46 +0300 Subject: [PATCH 1/3] chore: update schema URL in sync script Update OpenAPI schema URL in the sync script. Extract the base URL into `defaultBaseUrl` with positional overrides. Related-Task: INTER-2472 --- sync.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sync.sh b/sync.sh index 290d8db4..ff30f9fd 100755 --- a/sync.sh +++ b/sync.sh @@ -1,14 +1,17 @@ #!/bin/bash set -euo pipefail +defaultBaseUrl="https://fingerprintjs.github.io/openapi" +schemaUrl="${1:-$defaultBaseUrl/schemas/fingerprint-server-api-v4.yaml}" +examplesBaseUrl="${2:-$defaultBaseUrl/examples}" + CURL_OPTS=(-fSL) if [[ "${TRACE:-}" != "true" && "${ACTIONS_STEP_DEBUG:-}" != "true" ]]; then CURL_OPTS+=(-s) fi mkdir -p ./resources -curl "${CURL_OPTS[@]}" -o ./resources/fingerprint-server-api.yaml \ - https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/schemas/fingerprint-server-api-v4.yaml +curl "${CURL_OPTS[@]}" -o ./resources/fingerprint-server-api.yaml "$schemaUrl" examplesList=( 'webhook/webhook_event.json' @@ -33,7 +36,7 @@ for example in "${examplesList[@]}"; do mkdir -p "$destinationDir" echo "Downloading $example to $destinationPath" - curl "${CURL_OPTS[@]}" -o "$destinationPath" "https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/$example" + curl "${CURL_OPTS[@]}" -o "$destinationPath" "$examplesBaseUrl/$example" done echo "All OpenAPI documentation downloads complete." From 21508f24e56b2425a9cbe6174455999a53a5f53d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20Ayd=C4=B1n?= Date: Thu, 24 Sep 2026 20:58:49 +0300 Subject: [PATCH 2/3] chore: harden and tidy the sync script Use `env bash` shebang, so the script picks up bash from the correct environment. Resolve paths relative to the repository root. Harden `curl` with retry transient failures, refuse redirects that leave https and bound connect and transfer time so a stalled download cannot hand CI or local. Rename `examplesList` to `examples`, log the full URL being fetched rather than just the example path, so it is clear which base URL a run actually used. Related-Task: INTER-2472 --- sync.sh | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/sync.sh b/sync.sh index ff30f9fd..56ed811b 100755 --- a/sync.sh +++ b/sync.sh @@ -1,19 +1,28 @@ -#!/bin/bash +#!/usr/bin/env bash set -euo pipefail +# Resolve paths relative to the repository root, so the script can be run from +# any working directory. +cd "$(dirname "${BASH_SOURCE[0]}")" + defaultBaseUrl="https://fingerprintjs.github.io/openapi" schemaUrl="${1:-$defaultBaseUrl/schemas/fingerprint-server-api-v4.yaml}" examplesBaseUrl="${2:-$defaultBaseUrl/examples}" -CURL_OPTS=(-fSL) +CURL_OPTS=(-fSL --retry 3 --proto-redir '=https' --connect-timeout 10 --max-time 300) if [[ "${TRACE:-}" != "true" && "${ACTIONS_STEP_DEBUG:-}" != "true" ]]; then CURL_OPTS+=(-s) fi -mkdir -p ./resources -curl "${CURL_OPTS[@]}" -o ./resources/fingerprint-server-api.yaml "$schemaUrl" +schemaDestination="./resources/fingerprint-server-api.yaml" +baseDestination="./tests/mocked-responses-tests/mocked-responses-data" + +mkdir -p "$(dirname "$schemaDestination")" + +echo "Downloading $schemaUrl to $schemaDestination" +curl "${CURL_OPTS[@]}" -o "$schemaDestination" "$schemaUrl" -examplesList=( +examples=( 'webhook/webhook_event.json' 'events/get_event_200.json' 'events/get_event_ruleset_200.json' @@ -27,16 +36,13 @@ examplesList=( 'errors/409_state_not_ready.json' ) -baseDestination="./tests/mocked-responses-tests/mocked-responses-data" - -for example in "${examplesList[@]}"; do +for example in "${examples[@]}"; do destinationPath="$baseDestination/$example" - destinationDir="$(dirname "$destinationPath")" - - mkdir -p "$destinationDir" + mkdir -p "$(dirname "$destinationPath")" - echo "Downloading $example to $destinationPath" - curl "${CURL_OPTS[@]}" -o "$destinationPath" "$examplesBaseUrl/$example" + exampleUrl="$examplesBaseUrl/$example" + echo "Downloading $exampleUrl to $destinationPath" + curl "${CURL_OPTS[@]}" -o "$destinationPath" "$exampleUrl" done -echo "All OpenAPI documentation downloads complete." +echo "All OpenAPI schema downloads complete." From 58bbbaa92ddaff3311ee4ec48eef3d32b4a73c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20Ayd=C4=B1n?= Date: Thu, 24 Sep 2026 22:04:24 +0300 Subject: [PATCH 3/3] chore: rename baseDestination to exampleBaseDestination --- sync.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sync.sh b/sync.sh index 56ed811b..2e06d950 100755 --- a/sync.sh +++ b/sync.sh @@ -15,7 +15,7 @@ if [[ "${TRACE:-}" != "true" && "${ACTIONS_STEP_DEBUG:-}" != "true" ]]; then fi schemaDestination="./resources/fingerprint-server-api.yaml" -baseDestination="./tests/mocked-responses-tests/mocked-responses-data" +exampleBaseDestination="./tests/mocked-responses-tests/mocked-responses-data" mkdir -p "$(dirname "$schemaDestination")" @@ -37,7 +37,7 @@ examples=( ) for example in "${examples[@]}"; do - destinationPath="$baseDestination/$example" + destinationPath="$exampleBaseDestination/$example" mkdir -p "$(dirname "$destinationPath")" exampleUrl="$examplesBaseUrl/$example"