Skip to content

Conversation

@ericallam
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Oct 22, 2025

⚠️ No Changeset found

Latest commit: ce7f257

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
Contributor

coderabbitai bot commented Oct 22, 2025

Walkthrough

This pull request introduces a new environment-based configuration flag to optionally disable payload insertion in the runs replication service. The change adds the RUN_REPLICATION_DISABLE_PAYLOAD_INSERT environment variable to the environment schema, passes it through the replication instance initialization, and implements conditional logic in the replication service to skip payload inserts for update and delete events when the flag is enabled. The implementation preserves existing behavior when the flag is not set.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

The changes follow a consistent, additive pattern across three files: environment configuration → instance initialization → service logic. The modifications are non-breaking, introduce a straightforward boolean flag mechanism, and add a simple conditional check in the insertion logic. The homogeneous nature of these changes (environment variable propagation through layers) and low logic density reduce review complexity.

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is completely empty—no description was provided by the author. The repository's description template requires several key sections including an issue reference, a checklist, testing steps, and a changelog entry. Without these sections, the pull request lacks important context about why the changes were made, how they were tested, and what the user-facing impact is. The author should fill out the pull request description template with at minimum the issue reference (Closes #), a testing section describing how the payload insert disabling was verified, and a changelog entry summarizing the new functionality. The checklist items should also be reviewed to ensure compliance with the contributing guide.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "fix(replication): allow disabling of task run payload inserts via env var" clearly and specifically describes the main changes in the pull request. The changes add a new environment variable RUN_REPLICATION_DISABLE_PAYLOAD_INSERT and modify the RunsReplicationService to respect this flag when disabling payload inserts. The title uses the conventional format (fix with scope) and is concise and readable, making it easy for teammates scanning commit history to understand the primary change.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/disable-task-run-payload-inserts

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.

Copy link
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.

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/webapp/app/env.server.ts (1)

1105-1105: Consider using BoolEnv for type-safety (optional).

While the z.string().default("0") pattern is consistent with other RUN_REPLICATION_* flags in this section, using BoolEnv.default(false) would provide better type safety and accept more boolean-like values ("true", "false", "1", "0", etc.). However, maintaining local consistency with nearby flags is also reasonable.

If you prefer to use BoolEnv for consistency with other boolean flags in the codebase:

-    RUN_REPLICATION_DISABLE_PAYLOAD_INSERT: z.string().default("0"),
+    RUN_REPLICATION_DISABLE_PAYLOAD_INSERT: BoolEnv.default(false),

If this change is made, also update line 69 in apps/webapp/app/services/runsReplicationInstance.server.ts:

disablePayloadInsert: env.RUN_REPLICATION_DISABLE_PAYLOAD_INSERT,
apps/webapp/app/services/runsReplicationService.server.ts (1)

756-769: Logic is correct; consider restructuring for clarity (optional).

The implementation correctly disables payload inserts for all events when the flag is true. The condition works but groups the feature flag with event-type checks, which slightly obscures intent.

Consider restructuring for improved readability:

-    if (event === "update" || event === "delete" || this._disablePayloadInsert) {
+    // Skip payload inserts for updates/deletes, or if disabled via config
+    if (this._disablePayloadInsert || event === "update" || event === "delete") {

Placing this._disablePayloadInsert first makes it clear that it's a global override that affects all events, while update/delete are event-specific conditions.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2affe54 and ce7f257.

📒 Files selected for processing (3)
  • apps/webapp/app/env.server.ts (1 hunks)
  • apps/webapp/app/services/runsReplicationInstance.server.ts (1 hunks)
  • apps/webapp/app/services/runsReplicationService.server.ts (4 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

**/*.{ts,tsx}: Always prefer using isomorphic code like fetch, ReadableStream, etc. instead of Node.js specific code
For TypeScript, we usually use types over interfaces
Avoid enums
No default exports, use function declarations

Files:

  • apps/webapp/app/services/runsReplicationInstance.server.ts
  • apps/webapp/app/services/runsReplicationService.server.ts
  • apps/webapp/app/env.server.ts
{packages/core,apps/webapp}/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

We use zod a lot in packages/core and in the webapp

Files:

  • apps/webapp/app/services/runsReplicationInstance.server.ts
  • apps/webapp/app/services/runsReplicationService.server.ts
  • apps/webapp/app/env.server.ts
apps/webapp/**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

When importing from @trigger.dev/core in the webapp, never import the root package path; always use one of the documented subpath exports from @trigger.dev/core’s package.json

Files:

  • apps/webapp/app/services/runsReplicationInstance.server.ts
  • apps/webapp/app/services/runsReplicationService.server.ts
  • apps/webapp/app/env.server.ts
{apps/webapp/app/**/*.server.{ts,tsx},apps/webapp/app/routes/**/*.ts}

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

Access environment variables only via the env export from app/env.server.ts; do not reference process.env directly

Files:

  • apps/webapp/app/services/runsReplicationInstance.server.ts
  • apps/webapp/app/services/runsReplicationService.server.ts
  • apps/webapp/app/env.server.ts
apps/webapp/app/**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/webapp.mdc)

Modules intended for test consumption under apps/webapp/app/**/*.ts must not read environment variables; accept configuration via options instead

Files:

  • apps/webapp/app/services/runsReplicationInstance.server.ts
  • apps/webapp/app/services/runsReplicationService.server.ts
  • apps/webapp/app/env.server.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
apps/webapp/app/services/runsReplicationInstance.server.ts (1)

69-69: LGTM!

The boolean conversion and option wiring are correct and consistent with the codebase patterns.

apps/webapp/app/services/runsReplicationService.server.ts (2)

60-60: LGTM!

The optional field addition to the public options interface is correct and appropriately typed.


104-104: LGTM!

The private field initialization with a default of false correctly preserves existing behavior when the option is not provided.

Also applies to: 117-117

@ericallam ericallam merged commit d90da7a into main Oct 22, 2025
29 checks passed
@ericallam ericallam deleted the fix/disable-task-run-payload-inserts branch October 22, 2025 10:22
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.

3 participants