Skip to content

fix(railway): root-anchor watch patterns#177

Open
aspiers wants to merge 4 commits into
mainfrom
fix/railway-root-watch-patterns
Open

fix(railway): root-anchor watch patterns#177
aspiers wants to merge 4 commits into
mainfrom
fix/railway-root-watch-patterns

Conversation

@aspiers
Copy link
Copy Markdown
Contributor

@aspiers aspiers commented May 19, 2026

Summary

This PR tests whether Railway watch patterns in package-local railway.toml files behave correctly when the paths are explicitly anchored to the repository root.

Changes:

  • Prefix all Railway watchPatterns entries with / in:
    • packages/auth-service/railway.toml
    • packages/pds-core/railway.toml
    • packages/demo/railway.toml
  • Prefix each dockerfilePath with / for the same root-relative interpretation.
  • Document that these Railway patterns are root-anchored.
  • Add a harmless description field to packages/shared/package.json as the actual probe for matching a sibling package path outside each service package.

Why

The current unanchored patterns appear to be interpreted relative to the package directory containing each railway.toml, rather than relative to the monorepo root. If Railway honors leading / as repo-root anchoring, then sibling/root paths such as /packages/shared/**, /package.json, and /e2e/** should once again trigger the intended service rebuilds.

How to validate

The useful signal from this PR is Railway's deployment behavior on the latest commit:

  1. The latest commit touches packages/shared/package.json.
  2. All three Railway services should rebuild because:
    • auth-service watches /packages/shared/**
    • pds-core watches /packages/shared/**
    • demo watches /packages/shared/package.json
  3. If Railway skips any of those services on the latest commit, then leading-slash root anchoring is not sufficient and we need a different approach or a Railway-side fix.

A later optional probe can touch only e2e/**/*.md or features/**/*.md to confirm the negated root-anchored patterns still skip rebuilds.

Local validation

  • Parsed all three railway.toml files with Python tomllib.
  • Asserted all watchPatterns entries are root-anchored (/ or !/).
  • Checked packages/shared/package.json with python3 -m json.tool.
  • Checked formatting for packages/shared/package.json, docs/deployment.md, and the changeset using the repo's installed Prettier.
  • Ran git diff --check.

Full test suite not run: the functional signal we need from this PR is Railway's rebuild/skip behavior for the shared-package probe commit.

Summary by CodeRabbit

  • New Features

    • E2E tests now support configurable retry behavior for failed scenarios via the CUCUMBER_RETRY environment variable.
  • Bug Fixes

    • Improved test wait timeouts and conditions for more reliable scenario execution.
  • Documentation

    • Clarified deployment documentation regarding file-change triggers.
    • Updated E2E test configuration documentation with new retry setting.
  • Chores

    • Updated deployment configurations for consistency with root-anchored file patterns.
    • Updated package metadata.

Review Change Stack

Co-Authored-By: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 19, 2026 15:26
Copy link
Copy Markdown

@claude claude Bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
epds-demo Ready Ready Preview, Comment May 21, 2026 11:42am

Request Review

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 19, 2026

⚠️ No Changeset found

Latest commit: 24ba0b3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b3fe63d1-e85d-4cea-9f86-9ea7ead8416f

📥 Commits

Reviewing files that changed from the base of the PR and between 15505ce and 24ba0b3.

📒 Files selected for processing (10)
  • .github/workflows/e2e-tests.yml
  • docs/deployment.md
  • e2e/.env.example
  • e2e/README.md
  • e2e/cucumber.mjs
  • e2e/support/flows.ts
  • packages/auth-service/railway.toml
  • packages/demo/railway.toml
  • packages/pds-core/railway.toml
  • packages/shared/package.json

📝 Walkthrough

Walkthrough

This PR introduces E2E test resilience through Cucumber retries, improves handle picker flow synchronization, standardizes Railway deployment configuration with root-anchored paths, and updates package documentation. Changes span CI workflows, E2E test infrastructure, deployment configs, and package metadata.

Changes

E2E Testing and Deployment Infrastructure

Layer / File(s) Summary
Cucumber Retry Feature (E2E Resilience)
e2e/cucumber.mjs, .github/workflows/e2e-tests.yml, e2e/.env.example, e2e/README.md
Environment variable CUCUMBER_RETRY is parsed in Cucumber config, clamped to non-negative integer, applied to all retry profiles, documented in examples and README, and enabled in CI workflow with value '1' for one additional attempt.
E2E Flow Synchronization (Test Stability)
e2e/support/flows.ts
pickHandle increases waitForURL timeout to 60 seconds with waitUntil: 'domcontentloaded' and adds explicit 15-second visibility wait for #handle-input before interaction.
Railway Deployment Watch Patterns (Deployment Triggers)
packages/auth-service/railway.toml, packages/demo/railway.toml, packages/pds-core/railway.toml, docs/deployment.md
dockerfilePath and all watchPatterns entries are converted to repository-root-anchored paths (leading /), including negated exclusions; deployment documentation clarifies this root-anchoring approach.
Package Metadata Update
packages/shared/package.json
description field updated to reflect current package contents.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • hypercerts-org/ePDS#42: Main PR extends E2E Cucumber retry feature originally introduced in this prior foundational setup.
  • hypercerts-org/ePDS#55: Related Railway watchPatterns updates in the same three railway.toml files affecting deployment trigger paths for E2E and features directories.

Suggested reviewers

  • Kzoeps
  • s-adamantine

Poem

🐰 A retry here, a path anchored there,
Tests grow resilient with patient care.
Railway watches from the root with pride,
As synchronization strengthens the ride! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(railway): root-anchor watch patterns' accurately reflects the primary change in the PR—adding root-anchored (/-prefixed) paths to Railway configuration files across multiple service packages.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/railway-root-watch-patterns

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.

@railway-app
Copy link
Copy Markdown

railway-app Bot commented May 19, 2026

🚅 Deployed to the ePDS-pr-177 environment in ePDS

Service Status Web Updated (UTC)
@certified-app/demo ✅ Success (View Logs) Web May 21, 2026 at 11:43 am
@certified-app/demo untrusted ✅ Success (View Logs) Web May 21, 2026 at 11:43 am
@certified-app/auth-service ✅ Success (View Logs) Web May 21, 2026 at 11:43 am
@certified-app/pds-core ✅ Success (View Logs) Web May 21, 2026 at 11:42 am

Probe Railway root-anchored watch patterns with a harmless change under packages/shared.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates Railway service configs in the monorepo to use leading-slash (“repo-root anchored”) paths for watchPatterns and dockerfilePath, and documents that behavior for operators so rebuild filtering can include repo-root and sibling-package changes even though railway.toml lives under packages/*/.

Changes:

  • Anchor all Railway watchPatterns to the repository root by prefixing patterns (and negations) with /.
  • Prefix dockerfilePath with / to match the intended repo-root interpretation.
  • Update deployment docs and add a Changesets entry describing the operational change.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/pds-core/railway.toml Root-anchors watch patterns and dockerfile path for pds-core rebuild filtering.
packages/demo/railway.toml Root-anchors watch patterns and dockerfile path for demo rebuild filtering.
packages/auth-service/railway.toml Root-anchors watch patterns and dockerfile path for auth-service rebuild filtering.
docs/deployment.md Documents that Railway watch patterns are root-anchored (leading /).
.changeset/root-anchored-railway-watch-patterns.md Adds release note describing the Railway rebuild-filtering change.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -5,32 +5,35 @@ builder = "DOCKERFILE"
# Path is relative to the repository root, not this package directory.
@@ -5,32 +5,35 @@ builder = "DOCKERFILE"
# Path is relative to the repository root, not this package directory.
@@ -3,32 +3,35 @@
[build]
builder = "DOCKERFILE"
# Path is relative to the repository root, not this package directory.
Comment on lines +5 to +9
Railway monorepo deployments now use repository-root paths for rebuild filtering.

**Affects:** Operators

**Operators:** the Railway service config files under `packages/*/railway.toml` now use leading-slash `watchPatterns` and `dockerfilePath` values, such as `/packages/shared/**` and `/Dockerfile.auth`, so rebuild filtering is evaluated against repository-root paths even though each config file lives inside a package directory. No environment variable changes are required.
@coveralls-official
Copy link
Copy Markdown

coveralls-official Bot commented May 19, 2026

Coverage Report for CI Build 26223749503

Warning

Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes.
Quick fix: rebase this PR. Learn more →

Coverage increased (+0.2%) to 56.07%

Details

  • Coverage increased (+0.2%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 15 coverage regressions across 1 file.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

15 previously-covered lines in 1 file lost coverage.

File Lines Losing Coverage Coverage
packages/shared/src/client-metadata.ts 15 78.79%

Coverage Stats

Coverage Status
Relevant Lines: 2951
Covered Lines: 1648
Line Coverage: 55.85%
Relevant Branches: 1818
Covered Branches: 1026
Branch Coverage: 56.44%
Branches in Coverage %: Yes
Coverage Strength: 5.88 hits per line

💛 - Coveralls

Co-Authored-By: Claude <noreply@anthropic.com>
@blacksmith-sh

This comment has been minimized.

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

@@ -5,32 +5,35 @@ builder = "DOCKERFILE"
# Path is relative to the repository root, not this package directory.
# Railway does not support --target for multi-stage builds, so we use a
# dedicated Dockerfile that produces only the pds-core image.
dockerfilePath = "Dockerfile.pds"
dockerfilePath = "/Dockerfile.pds"
@@ -3,32 +3,35 @@
[build]
builder = "DOCKERFILE"
# Path is relative to the repository root, not this package directory.
Comment thread docs/deployment.md
Comment on lines 161 to +164
Railway deploys automatically on push to the linked branch. Each service's
`railway.toml` defines `watchPatterns` so only relevant changes trigger a
rebuild.
`railway.toml` defines root-anchored `watchPatterns` (leading `/`) so only
relevant changes trigger a rebuild, even though the config files live under
`packages/*/`.
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.

2 participants