Watch paths not working, all services deploying
dendianugerah
FREEOP

17 days ago

Hi, using Railway with a Bun monorepo. Watch paths configured per service but services keep deploying even when changed files don't match.

Setup:

- Root Directory set per service

- Watch paths in Service Settings

- Focused PR Environments enabled

What happened:

Changed only files in apps/frontend/ and packages/shared/. Expected only frontend service to deploy (matches watch path /apps/frontend/**). Instead, all services deployed.

Watch paths:

# backend service

/apps/backend/**

/packages/common/**

/packages/core/**

# frontend service

/apps/frontend/**

/packages/**

# admin service

/apps/admin/**

/packages/common/**

Changed: apps/frontend/src/components/Button.tsx and packages/shared/utils/format.ts

Expected: Only frontend service (matches /apps/frontend/** and /packages/**).

Actual: All services deploying.

The /packages/** pattern doesn't seem to be working as expected for other services that don't have it in their watch paths. Is there a known issue with watch paths in monorepos?

$10 Bounty

2 Replies

Status changed to Open Railway 17 days ago


i-smuglov
FREETop 5% Contributor

17 days ago

Railway does not strictly isolate changes per service based only on watch paths. A few important details:

  1. Global repo diff first, then service evaluation
    • Railway detects any change in the repo.
    • Then it evaluates services, but this step is not perfectly scoped.
  2. Avoid broad globs like /packages/** Instead of:
/packages/**  

Use explicit paths:

/packages/frontend/**  

i-smuglov

Railway does **not strictly isolate changes per service based only on watch paths**. A few important details: 1. Global repo diff first, then service evaluation * Railway detects _any_ change in the repo. * Then it evaluates services, but this step is not perfectly scoped. 2. Avoid broad globs like `/packages/**` Instead of: ``` /packages/** ``` Use explicit paths: ``` /packages/frontend/** ```

dendianugerah
FREEOP

17 days ago

Thanks for the suggestion, but I already try use explicit paths like /packages/common/**, /packages/core/**, /packages/db/**, not the broad /packages/**. The issue persists. Changed only apps/frontend/... and packages/shared/... but all services still deploy, do yyou have any idea?


Welcome!

Sign in to your Railway account to join the conversation.

Loading...