Skip to content

fix: unrug Railway CI - copy patches dir and add .railwayignore#12099

Merged
0xApotheosis merged 2 commits intodevelopfrom
fix/public-api-railway-deploy
Mar 5, 2026
Merged

fix: unrug Railway CI - copy patches dir and add .railwayignore#12099
0xApotheosis merged 2 commits intodevelopfrom
fix/public-api-railway-deploy

Conversation

@0xApotheosis
Copy link
Member

@0xApotheosis 0xApotheosis commented Mar 5, 2026

Description

Fix Railway CI deployments for public-api and swap-widget services.

Two issues were causing failures:

  1. pnpm install ENOENT — pnpm reads patch files from patches/ during install (even with --ignore-scripts), but the patches directory wasn't copied into the Docker build context before pnpm install
  2. "Failed to snapshot repository" — Railway's snapshot phase was pulling ~74MB of tracked files. A .railwayignore reduces this by excluding files no Dockerfile build needs

Changes

  • packages/public-api/Dockerfile — Added COPY patches/ ./patches/ before pnpm install (done in prior commit)
  • packages/swap-widget/Dockerfile — Same fix (same bug existed here too)
  • .railwayignore (new) — Excludes src/, test dirs, images, dev tooling, docs, and test files. Verified safe for all 3 Railway services (public-api, swap-widget, unchained). Critical paths like patches/, packages/, pnpm-lock.yaml, tsconfig*.json, and public/generated/generatedAssetData.json are NOT excluded.

Issue (if applicable)

N/A — Railway deploy failures since March 3rd caused by pnpm migration

Risk

Low. Changes only affect Docker build context and Railway snapshot phase. No runtime behavior changes. The public-api Dockerfile fix was already verified working in production (deployment 120427a6).

No protocols, transaction types, wallets or contract interactions are affected.

Testing

Engineering

  1. Merge to develop and verify Railway deployments succeed for public-api, swap-widget, and unchained
  2. Verify pnpm install step no longer fails with ENOENT for patch files
  3. Verify Railway snapshot completes without "Failed to snapshot repository" errors

Operations

  • 🏁 Infrastructure-only change, no user-facing impact. No operations testing needed.

Screenshots (if applicable)

N/A

Summary by CodeRabbit

Release Notes

  • Chores
    • Optimized build configuration to reduce repository snapshot size for faster deployments
    • Improved Docker build process to properly support patched dependencies during package installation

…gnore

Two fixes for Railway deployment failures:

1. Copy patches/ directory in Dockerfile before pnpm install - pnpm
   requires patch files during install even with --ignore-scripts because
   patched dependencies are referenced in the lockfile.

2. Add .railwayignore to reduce repo snapshot size - Railway's "Failed to
   snapshot repository" error was caused by the repo being ~74MB of tracked
   files. Excludes frontend source, images, tests, and other files not
   needed for the public-api Docker build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@0xApotheosis 0xApotheosis requested a review from a team as a code owner March 5, 2026 00:16
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 49508c30-16d9-442f-a8ac-b3d7d3e42df9

📥 Commits

Reviewing files that changed from the base of the PR and between 443799e and 81db455.

📒 Files selected for processing (2)
  • .railwayignore
  • packages/swap-widget/Dockerfile
🚧 Files skipped from review as they are similar to previous changes (1)
  • .railwayignore

📝 Walkthrough

Walkthrough

Adds a Railway snapshot ignore file to exclude non-essential files from snapshots and updates two Dockerfiles to copy a patches/ directory into the builder stage so pnpm patched dependencies are available during container builds.

Changes

Cohort / File(s) Summary
Railway Configuration
.railwayignore
New Railway snapshot ignore listing patterns to exclude frontend sources, Cypress/e2e tests, generated assets, images/static files, IDE/dev files, Yarn state, general docs and tests; preserves Markdown under packages/public-api and packages/swap-widget.
Docker Build Updates
packages/public-api/Dockerfile, packages/swap-widget/Dockerfile
Added COPY patches/ ./patches/ in the builder stage with a comment: ensures patches/ is available for pnpm to apply patched dependencies referenced in the lockfile. No other build logic changed.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I nibble at patches, neat and small,
I hide the crumbs the snapshots stall,
Docker hums with all in place,
Lightweight builds, a hopping pace,
Cheers from a rabbit — tidy space!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main changes: fixing Railway CI by copying patches directory and adding .railwayignore configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/public-api-railway-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.

@0xApotheosis 0xApotheosis marked this pull request as draft March 5, 2026 00:26
The swap-widget Dockerfile had the same missing patches/ dir bug as
public-api — pnpm install fails with ENOENT for patched dependencies.
Also add swap-widget *.md exception to .railwayignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@0xApotheosis 0xApotheosis changed the title fix: unrug public-api Railway CI - copy patches dir and add .railwayignore fix: unrug Railway CI - copy patches dir and add .railwayignore Mar 5, 2026
Copy link
Member Author

@0xApotheosis 0xApotheosis left a comment

Choose a reason for hiding this comment

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

Merging, can't fully test until in develop, but a commit and revert showed this as working on develop:

Image

@0xApotheosis 0xApotheosis marked this pull request as ready for review March 5, 2026 00:43
@0xApotheosis 0xApotheosis merged commit b95adf5 into develop Mar 5, 2026
4 checks passed
@0xApotheosis 0xApotheosis deleted the fix/public-api-railway-deploy branch March 5, 2026 01:21
0xApotheosis added a commit that referenced this pull request Mar 5, 2026
* fix: unrug public-api Railway CI - copy patches dir and add .railwayignore

Two fixes for Railway deployment failures:

1. Copy patches/ directory in Dockerfile before pnpm install - pnpm
   requires patch files during install even with --ignore-scripts because
   patched dependencies are referenced in the lockfile.

2. Add .railwayignore to reduce repo snapshot size - Railway's "Failed to
   snapshot repository" error was caused by the repo being ~74MB of tracked
   files. Excludes frontend source, images, tests, and other files not
   needed for the public-api Docker build.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: add patches dir to swap-widget Dockerfile and update .railwayignore

The swap-widget Dockerfile had the same missing patches/ dir bug as
public-api — pnpm install fails with ENOENT for patched dependencies.
Also add swap-widget *.md exception to .railwayignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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