Fix Iroh relay policy Vercel deployment

Merged
AZ
2d ago
+42-21

Summary

  • keep relay-catalog validation inside the Vercel web project
  • make the generator portable across Bun and Next.js type checking
  • reconcile the Swift line budget after the Iroh merge

Testing

  • regression commit fails before the fix
  • bun test tests/vercel-build-inputs.test.ts tests/relay-policy.test.ts tests/relay-token-route.test.ts tests/relay-preferences-route.test.ts
  • SKIP_ENV_VALIDATION=1 bun run vercel-build
  • python3 scripts/swift_file_length_budget.py --base-ref origin/main

View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Fixes Vercel deploys for the Iroh relay policy by validating the relay catalog inside the web app and making the generator Node-compatible so Bun/Next.js type checks and builds pass. Also updates CI/Presence workflows and adds a regression test to keep validation inside the Vercel project.

  • Bug Fixes
    • Moved the generator to web/tools/generate-managed-iroh-relay-catalog.ts; run --check from web in root, web, and workers/presence scripts and CI.
    • Made the generator Node-compatible (replaced Bun-only APIs, switched to process.argv, fixed repo root resolution, preserved --check).
    • Added web/tests/vercel-build-inputs.test.ts to ensure vercel-build calls the in-web script.
    • Updated CI and Presence workflow triggers to the new generator path.
    • Made the relay retry test deterministic and fixed Iroh test import in MobileHostAuthorizationTests.swift.

Summary by CodeRabbit

  • Build & Tooling
    • Updated managed relay catalog generation/check commands to use the new in-repo generator path across root, web, and presence scripts.
    • Switched the generator to run on Node.js for consistent handling during builds.
    • Updated CI/deployment validation to call the new generator path and adjusted workflow triggers to watch the new file location.
  • Tests
    • Added a Bun test ensuring the deployment build includes an embedded relay catalog validation step.
    • Improved a Swift test’s sleep timing assertion and updated its imports.