Skip to content

[DO NOT MERGE] [api-v3] INTER-2472: Update schema URL and harden sync script - #293

Draft
erayaydin wants to merge 1 commit into
api-v3from
chore/openapi-repo-rename-api-v3-inter-2472
Draft

erayaydin wants to merge 1 commit into
api-v3from
chore/openapi-repo-rename-api-v3-inter-2472

Conversation

@erayaydin

Copy link
Copy Markdown
Member

Warning

Do not merge this PR until fingerprintjs/fingerprint-pro-server-api-openapi#480 merged and the repository renamed.

GitHub redirects repository URLs after a rename but explicitly not project GitHub Pages URLs, so sync.sh will start failing after the rename. This PR changes the default OpenAPI schema URL.

curl ran without -f, which made that failure silent. With -f the same request exits 56 and leaves the existing file untouched.

Alongside the URL change, use env bash shebang and set -euo pipefail. Resolve paths relative to the repository root, so the script no longer writes into whatever directory it is invoked from. Collect the curl flags into CURL_OPTS, gated on TRACE and ACTIONS_STEP_DEBUG so runs can be made verbose, and harden them to fail on HTTP errors, retry transient failures, refuse redirects that leave https and bound connect and transfer time so a stalled download cannot hang CI or local. Log the download.

Update the OpenAPI schema URL.

`curl` ran without `-f`, so an HTTP error was written to the output file and
the script still exited 0. This change fix it.

Use an `env bash` shebang and `set -euo pipefail`. Resolve paths relative to
the repository root, so the script no longer writes into whatever directory it
is invoked from. Collect the curl flags into `CURL_OPTS`, gated on `TRACE` and
`ACTIONS_STEP_DEBUG` so runs can be made verbose, and harden them: fail on
HTTP errors, retry transient failures, refuse redirects that leave https, and
bound connect and transfer time so a stalled download cannot hang CI or a
local run. Log the download.

Related-Task: INTER-2472
@erayaydin
erayaydin requested a balanced review from Copilot September 24, 2026 19:48
@erayaydin erayaydin self-assigned this Sep 24, 2026
@changeset-bot

changeset-bot Bot commented Sep 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 2e70c32

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR doesn't contain any changesets. If there are user-facing changes, don't forget to run:

pnpm exec changeset

to create a changeset.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

St.❔
Category Percentage Covered / Total
🟢 Statements 97.53% 237/243
🟢 Branches 95.24% 80/84
🟢 Functions 97.78% 44/45
🟢 Lines 97.52% 236/242

Test suite run success

137 tests passing in 12 suites.

Report generated by 🧪jest coverage report action from 2e70c32

Show full coverage report
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟢 All files 97.53 95.23 97.77 97.52
🟢  src 96.89 93.75 96.55 96.89
🟢   index.ts 100 100 100 100
🟢   responseUtils.ts 100 100 100 100
🟢   sealedResults.ts 100 100 100 100
🟢   serverApiClient.ts 95.52 90.9 90 95.52 37,140,234
🟢   types.ts 100 100 100 100
🟢   urlUtils.ts 96.07 90.9 100 96.07 37,47
🟡   utils.ts 75 100 100 75 6
🟢   webhook.ts 100 100 100 100
🟢  src/errors 100 100 100 100
🟢   apiErrors.ts 100 100 100 100
🟢   getRetryAfter.ts 100 100 100 100
🟢   handleErrorResponse.ts 100 100 100 100
🟢   unsealError.ts 100 100 100 100

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Failed partial transfers can overwrite the existing schema, and the upstream rename remains incomplete.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates schema synchronization for the planned OpenAPI repository rename and improves download reliability.

Changes:

  • Uses the renamed GitHub Pages schema URL.
  • Adds retries, timeouts, HTTPS-only redirects, and optional diagnostics.
  • Resolves output paths relative to the repository root.
File Description
sync.sh Hardens and relocates the OpenAPI schema download.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread sync.sh

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants