Skip to content

INTER-2470: Follow redirects and fail on errors in sync script - #52

Merged
erayaydin merged 2 commits into
mainfrom
chore/hardened-sync-script-inter-2470
Sep 24, 2026
Merged

erayaydin merged 2 commits into
mainfrom
chore/hardened-sync-script-inter-2470

Conversation

@erayaydin

@erayaydin erayaydin commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Why

scripts/sync.sh used curl -s, which neither follows redirects (-L) nor fails on HTTP errors (-f). Both failure modes exit 0, so set -e never fires and codegen silently runs against a corrupt schema.

-s also suppresses the reason for a failure. -S shows the error message.

`curl -s` neither follows redirects nor fails on HTTP errors, so both
cases silently succeed:

- On a 301, curl writes a 0-byte file and exits 0.
- On a 4xx/5xx, curl writes the error page body into the output file and
  exits 0

Add -f and -L to curl calls so redirects are followed and HTTP errors
abort the script.

Related-Task: INTER-2470

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The changes correctly prevent silent failures while preserving existing behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Updates the sync script to reliably download valid schemas and examples.

Changes:

  • Follow HTTP redirects with -L.
  • Fail on HTTP errors with -f.
File Description
scripts/​sync.sh Strengthens curl failure handling for synchronized resources.

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

@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.

@erayaydin
erayaydin marked this pull request as ready for review September 24, 2026 11:08
@erayaydin
erayaydin merged commit ca7a2f7 into main Sep 24, 2026
19 checks passed
@erayaydin
erayaydin deleted the chore/hardened-sync-script-inter-2470 branch September 24, 2026 11:40
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.

3 participants