Skip to content

fix(relay): unbreak fly deploy#3791

Merged
saddlepaddle merged 1 commit intomainfrom
fix-relay-deploy
Apr 27, 2026
Merged

fix(relay): unbreak fly deploy#3791
saddlepaddle merged 1 commit intomainfrom
fix-relay-deploy

Conversation

@saddlepaddle
Copy link
Copy Markdown
Collaborator

@saddlepaddle saddlepaddle commented Apr 27, 2026

Summary

Three independent breakages that all surfaced when redeploying the relay tonight to ship the org-scoped routing-key fix from #3784. Already validated end-to-end — the relay is live at v4 in sjc running off this exact image+config (built with these fixes applied locally).

  • Pin bunx turbo@2.8.7 in the prune stage. Previously unpinned, so the Docker build fetched whatever was latest on npm (2.9.6). That version generates a pruned bun.lock that's inconsistent with its own pruned package.jsons, so the next stage's bun install --frozen-lockfile fails with "lockfile had changes". Reproduced both with bun 1.3.11 and 1.3.12 inside the image — it's a turbo-prune bug, not a bun version issue. Pinning to the project's installed turbo version eliminates the drift.
  • Drop dead COPY patches patches. The directory hasn't existed since chore(deps): upgrade tanstack/db + electric, drop durable-streams patch #3509 dropped the durable-streams patch. Any redeploy from a clean Docker cache failed at this COPY.
  • Bump VM memory 2GB → 4GB. Fly now requires ≥4096 MiB for cpu_kind = "performance". The existing machine was grandfathered but fly deploy rejects new configs that violate this. Keeping perf CPUs since the relay proxies WS tunnels and shared-CPU noise would hurt latency.

Test plan

  • fly deploy against superset-relay builds and rolls out cleanly with these changes
  • Machine reaches started state, /health returns 200
  • Reviewer can sanity-check the turbo pin matches package.json ("turbo": "2.8.7")

Summary by cubic

Fixes the relay Fly deploy by pinning the prune tool and updating VM settings. Prevents lockfile drift and meets Fly’s performance CPU memory requirement.

  • Bug Fixes
    • Pin turbo to 2.8.7 during Docker prune to stop pruned lockfile drift that broke bun install --frozen-lockfile.
    • Remove stale COPY patches line; the directory no longer exists.
    • Bump Fly VM memory from 2GB to 4GB to satisfy cpu_kind = "performance".

Written for commit c057555. Summary will update on new commits.

Summary by CodeRabbit

  • Chores
    • Updated Docker build configuration with pinned CLI version for improved build consistency.
    • Increased relay service memory allocation from 2GB to 4GB to enhance performance and stability.

- Pin `bunx turbo@2.8.7` in the prune stage. Previously unpinned, so
  Docker fetched whatever was latest on npm (2.9.6) — that version
  produces a pruned bun.lock inconsistent with its own pruned
  package.jsons, causing `bun install --frozen-lockfile` to fail.
  Pinning to the project's turbo version eliminates the drift.
- Drop dead `COPY patches patches` left over from #3509 (durable-streams
  patch removal). The directory hasn't existed since March, so any
  redeploy from a clean cache failed at this line.
- Bump VM memory from 2gb to 4gb. Fly's `cpu_kind = "performance"` now
  requires ≥4096 MiB; the existing machine was grandfathered but new
  deploys are rejected.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 27, 2026

📝 Walkthrough

Walkthrough

These changes modify the relay app's deployment configuration by pinning the Turbo CLI version to 2.8.7 in the Docker build process, removing the patches directory copy step, and increasing the VM memory allocation to 4GB for the Fly.io deployment.

Changes

Cohort / File(s) Summary
Relay Docker Configuration
apps/relay/Dockerfile
Pins Turbo CLI to version 2.8.7 in the prune step and removes the patches directory copy instruction from the builder stage.
Relay Deployment Configuration
apps/relay/fly.toml
Increases VM memory allocation from 2GB to 4GB.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 The Docker dreams now pin their threads,
With Turbo steady at 2.8 instead,
Memory swells from two to four,
The relay hops—let's build some more! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change (fixing relay Fly deploy breakages) and is concise and specific.
Description check ✅ Passed The description comprehensively covers all required template sections with clear explanations of the three breakages, their causes, and solutions, plus validation evidence.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-relay-deploy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 27, 2026

Greptile Summary

This PR fixes three independent breakages that prevented a clean fly deploy for the relay: pins turbo@2.8.7 in the Docker prune stage to match the project's installed version and avoid a lockfile-drift bug in turbo 2.9.x, removes a stale COPY patches patches line that referenced a long-deleted directory, and raises the Fly VM memory from 2 GB to 4 GB to meet the current minimum for cpu_kind = "performance" machines.

Confidence Score: 5/5

Safe to merge — all three fixes are targeted, verified end-to-end, and carry no risk of regression.

No P0 or P1 findings. The turbo pin exactly matches the project's installed version (confirmed in root package.json), the dead COPY removal is clearly correct, and the memory bump satisfies a documented Fly requirement. Author reports successful end-to-end validation in production.

No files require special attention.

Important Files Changed

Filename Overview
apps/relay/Dockerfile Pins turbo to 2.8.7 (matches root package.json) and removes dead COPY patches patches — both correct, targeted fixes for build failures.
apps/relay/fly.toml Bumps VM memory from 2 GB to 4 GB to satisfy Fly's minimum for performance-class CPUs — straightforward infrastructure fix.

Reviews (1): Last reviewed commit: "fix(relay): unbreak fly deploy" | Re-trigger Greptile

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
apps/relay/Dockerfile (1)

7-7: Turbo pin matches root package.json — good fix.

Pinning bunx turbo@2.8.7 here aligns the prune-stage CLI with the "turbo": "2.8.7" devDependency in the root package.json, which is exactly what prevents the lockfile/manifest drift you described (unpinned bunx was resolving to 2.9.6 and producing a bun.lock incompatible with the pruned package.jsons under --frozen-lockfile).

One small maintenance hazard worth flagging: this version is now duplicated across package.json and the Dockerfile, and there's nothing enforcing they stay in sync. If someone bumps turbo in package.json without touching the Dockerfile, builds will silently regress to the same drift class of failure. Consider a brief inline comment as a tripwire for future bumps.

📝 Optional: add a sync-reminder comment
-RUN bunx turbo@2.8.7 prune `@superset/relay` --docker
+# Keep this version in sync with `turbo` in the root package.json — version
+# drift here produces a pruned bun.lock incompatible with --frozen-lockfile.
+RUN bunx turbo@2.8.7 prune `@superset/relay` --docker
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/relay/Dockerfile` at line 7, Add a brief inline comment above the RUN
bunx turbo@2.8.7 prune `@superset/relay` --docker line noting that the pinned
turbo version must match the root package.json devDependency "turbo": "2.8.7";
this serves as a tripwire to update the Dockerfile whenever the root
package.json turbo version is bumped to avoid lockfile/manifest drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@apps/relay/Dockerfile`:
- Line 7: Add a brief inline comment above the RUN bunx turbo@2.8.7 prune
`@superset/relay` --docker line noting that the pinned turbo version must match
the root package.json devDependency "turbo": "2.8.7"; this serves as a tripwire
to update the Dockerfile whenever the root package.json turbo version is bumped
to avoid lockfile/manifest drift.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c466c91d-3eb0-4803-a045-c7bc8e78fc50

📥 Commits

Reviewing files that changed from the base of the PR and between c885eb2 and c057555.

📒 Files selected for processing (2)
  • apps/relay/Dockerfile
  • apps/relay/fly.toml

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ✅ Neon database branch

Thank you for your contribution! 🎉

@saddlepaddle saddlepaddle merged commit 889e9e7 into main Apr 27, 2026
14 checks passed
@Kitenite Kitenite deleted the fix-relay-deploy branch May 6, 2026 04:52
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.

1 participant