Skip to content

Conversation

@myftija
Copy link
Contributor

@myftija myftija commented Dec 1, 2025

Added a new env var (EVENT_REPOSITORY_DEBUG_LOGS_DISABLED) that allows disabling writing run debug logs in the event repository.

Added a new env var (`EVENT_REPOSITORY_DEBUG_LOGS_DISABLED`) that allows disabling writing run debug logs in the event repository.
@changeset-bot
Copy link

changeset-bot bot commented Dec 1, 2025

⚠️ No Changeset found

Latest commit: c48c648

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 Dec 1, 2025

Walkthrough

A feature flag is introduced to disable event repository debug logs recording. A new environment variable EVENT_REPOSITORY_DEBUG_LOGS_DISABLED is added to the public schema with a default value of false. The recordRunDebugLog function is updated with an early return guard that bypasses debug event recording when this flag is enabled, returning a success response without invoking recordRunEvent.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Environment variable addition: Verify naming convention, type consistency, and default value alignment with existing patterns
  • Guard clause in recordRunDebugLog: Confirm the early return placement doesn't inadvertently bypass critical side effects or logging dependencies beyond debug event recording
  • Feature flag integration: Ensure the flag is properly read from the environment and the short-circuit logic is the intended behavior when disabled

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
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.
Description check ❓ Inconclusive The description is minimal and lacks required template sections (Closes issue, Checklist, Testing, Changelog, Screenshots), but clearly conveys the change. Complete the PR description template by adding the issue reference, checking the contribution checklist, describing testing steps, and any relevant screenshots.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding functionality to disable/drop run debug events via an environment variable.
✨ 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 enable-skipping-clickhouse-run-debug-events

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e1c4f6 and c48c648.

📒 Files selected for processing (2)
  • apps/webapp/app/env.server.ts (1 hunks)
  • apps/webapp/app/v3/eventRepository/index.server.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
**/*.{ts,tsx}

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

**/*.{ts,tsx}: Use types over interfaces for TypeScript
Avoid using enums; prefer string unions or const objects instead

Files:

  • apps/webapp/app/v3/eventRepository/index.server.ts
  • apps/webapp/app/env.server.ts
{packages/core,apps/webapp}/**/*.{ts,tsx}

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

Use zod for validation in packages/core and apps/webapp

Files:

  • apps/webapp/app/v3/eventRepository/index.server.ts
  • apps/webapp/app/env.server.ts
**/*.{ts,tsx,js,jsx}

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

Use function declarations instead of default exports

Files:

  • apps/webapp/app/v3/eventRepository/index.server.ts
  • apps/webapp/app/env.server.ts
apps/webapp/app/**/*.{ts,tsx}

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

Access all environment variables through the env export of env.server.ts instead of directly accessing process.env in the Trigger.dev webapp

Files:

  • apps/webapp/app/v3/eventRepository/index.server.ts
  • apps/webapp/app/env.server.ts
apps/webapp/**/*.{ts,tsx}

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

apps/webapp/**/*.{ts,tsx}: When importing from @trigger.dev/core in the webapp, use subpath exports from the package.json instead of importing from the root path
Follow the Remix 2.1.0 and Express server conventions when updating the main trigger.dev webapp

Files:

  • apps/webapp/app/v3/eventRepository/index.server.ts
  • apps/webapp/app/env.server.ts
**/*.{js,ts,jsx,tsx,json,md,css,scss}

📄 CodeRabbit inference engine (AGENTS.md)

Format code using Prettier

Files:

  • apps/webapp/app/v3/eventRepository/index.server.ts
  • apps/webapp/app/env.server.ts
🧠 Learnings (2)
📚 Learning: 2025-07-12T18:06:04.133Z
Learnt from: matt-aitken
Repo: triggerdotdev/trigger.dev PR: 2264
File: apps/webapp/app/services/runsRepository.server.ts:172-174
Timestamp: 2025-07-12T18:06:04.133Z
Learning: In apps/webapp/app/services/runsRepository.server.ts, the in-memory status filtering after fetching runs from Prisma is intentionally used as a workaround for ClickHouse data delays. This approach is acceptable because the result set is limited to a maximum of 100 runs due to pagination, making the performance impact negligible.

Applied to files:

  • apps/webapp/app/v3/eventRepository/index.server.ts
📚 Learning: 2025-11-27T16:26:58.652Z
Learnt from: CR
Repo: triggerdotdev/trigger.dev PR: 0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-11-27T16:26:58.652Z
Learning: Applies to apps/webapp/app/**/*.{ts,tsx} : Access all environment variables through the `env` export of `env.server.ts` instead of directly accessing `process.env` in the Trigger.dev webapp

Applied to files:

  • apps/webapp/app/env.server.ts
🧬 Code graph analysis (1)
apps/webapp/app/env.server.ts (2)
apps/supervisor/src/envUtil.ts (1)
  • BoolEnv (15-17)
apps/webapp/app/utils/boolEnv.ts (1)
  • BoolEnv (12-14)
⏰ 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). (19)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (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 (windows-latest - npm)
  • GitHub Check: typecheck / typecheck
🔇 Additional comments (2)
apps/webapp/app/env.server.ts (1)

1154-1154: LGTM! Environment variable properly configured.

The new EVENT_REPOSITORY_DEBUG_LOGS_DISABLED variable is correctly defined using BoolEnv.default(false), which ensures proper type safety and parsing. The placement among other event repository settings is logical, and the default value of false (debug logs enabled) prevents breaking existing behavior.

Based on coding guidelines, this correctly uses zod for validation and will be accessed through the env export as required.

apps/webapp/app/v3/eventRepository/index.server.ts (1)

130-136: LGTM! Early return guard correctly implements the feature flag.

The implementation efficiently short-circuits debug event recording when EVENT_REPOSITORY_DEBUG_LOGS_DISABLED is enabled, returning success without triggering any database queries or event writes. This follows the coding guidelines by accessing the environment variable through the env export rather than process.env.

The silent drop behavior is appropriate for a performance optimization feature flag.


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.

@myftija myftija merged commit 6ae1317 into main Dec 1, 2025
31 checks passed
@myftija myftija deleted the enable-skipping-clickhouse-run-debug-events branch December 1, 2025 14:42
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