Skip to content

Bulk actions 2.0 (and switch all run listing to ClickHouse) #2264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 208 commits into
base: main
Choose a base branch
from

Conversation

matt-aitken
Copy link
Member

You can now cancel/replay runs based on filters that are applied to the runs list in the dashboard. You can also manually select runs for smaller operations.

We have a new "Bulk actions" page where you can view all previous actions, view the progress, abort, view associated runs, and quickly do a "Replay" of associated runs.

bulk-actions-2.mp4

This branch also removes the old Postgres RunListPresenter, in favour of the new ClickHouse NextRunListPresenter.

This switchover impacts:

  • Runs page
  • Waitpoint inspector
  • Schedule inspector
  • The runs.list() SDK call.

Copy link

changeset-bot bot commented Jul 11, 2025

⚠️ No Changeset found

Latest commit: d80af53

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.

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

Copy link
Contributor

coderabbitai bot commented Jul 11, 2025

Walkthrough

This update introduces a comprehensive, system-wide implementation of a new "Bulk Actions" feature for managing large-scale operations (such as canceling or replaying runs) within a project environment. It includes major changes across the database schema, backend services, worker jobs, API presenters, and the web application UI.

On the backend, new and updated database migrations add fields and models to support bulk action groups, notification preferences, progress tracking, and run associations. The Prisma schema and Clickhouse query builders are extended accordingly. New services and presenters handle the creation, processing, aborting, and listing of bulk actions, integrating with the worker queue and supporting batch processing with progress tracking and notification emails.

The frontend adds new routes and components for listing, creating, and inspecting bulk actions, including real-time progress updates via server-sent events. The UI is updated to include bulk action controls, filter summaries, inspector panels, and new icons and styles. Filtering, selection, and pagination logic are refactored for consistency and to support the new bulk action workflows. Supporting utilities, hooks, and path builders are updated or introduced as needed.

Additionally, the email system is extended to send notifications upon bulk action completion, and environment/configuration files are updated to support new settings. The codebase also includes various refactorings, style adjustments, and internal improvements to support the new feature and maintain consistency.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 5

🔭 Outside diff range comments (1)
apps/webapp/app/components/runs/v3/RunFilters.tsx (1)

1104-1108: Fix the schedule ID validation prefix check.

The error message states "Schedule IDs start with 'sched_'" but the validation only checks for "sched" without the underscore. This inconsistency could confuse users.

Apply this fix to align the validation with the error message:

-    if (!scheduleId.startsWith("sched")) {
+    if (!scheduleId.startsWith("sched_")) {
       error = "Schedule IDs start with 'sched_'";
🧹 Nitpick comments (8)
apps/webapp/app/presenters/v3/BulkActionPresenter.server.ts (1)

50-58: Consider improving filter parsing logic.

The current logic for determining mode could be more robust. An empty object {} from successful parsing might not always indicate "selected" mode.

Consider this more explicit approach:

-    let mode: BulkActionMode = "filter";
-    if (filtersParsed.success && Object.keys(filtersParsed.data).length === 0) {
-      mode = "selected";
-    }
+    let mode: BulkActionMode = "filter";
+    if (filtersParsed.success) {
+      const hasFilters = Object.keys(filtersParsed.data).some(key => 
+        filtersParsed.data[key] !== undefined && filtersParsed.data[key] !== null
+      );
+      mode = hasFilters ? "filter" : "selected";
+    }

This approach checks for meaningful filter values rather than just empty objects.

apps/webapp/app/presenters/v3/CreateBulkActionPresenter.server.ts (1)

27-29: Consider more graceful error handling.

The hard throw for missing clickhouseClient could provide a more informative error message or handle the case more gracefully, especially in development environments where ClickHouse might not be available.

-    if (!clickhouseClient) {
-      throw new Error("Clickhouse client not found");
-    }
+    if (!clickhouseClient) {
+      throw new Error("ClickHouse client is required for bulk actions but is not configured. Check your environment configuration.");
+    }
apps/webapp/app/presenters/RunFilters.server.ts (2)

16-32: Simplify the filter processing logic.

The current approach of parsing, destructuring, and reconstructing the filters is unnecessarily complex. Consider streamlining this process.

-  const s = getRunFiltersFromSearchParams(url.searchParams);
-
-  const {
-    tasks,
-    versions,
-    statuses,
-    tags,
-    period,
-    bulkId,
-    from,
-    to,
-    cursor,
-    direction,
-    runId,
-    batchId,
-    scheduleId,
-  } = TaskRunListSearchFilters.parse(s);
+  const filters = TaskRunListSearchFilters.parse(
+    getRunFiltersFromSearchParams(url.searchParams)
+  );

34-49: Consider more explicit runId transformation.

The runId to runIds conversion is logical but could be more explicit about its purpose. Consider adding a comment or making the transformation more obvious.

  return {
-    tasks,
-    versions,
-    statuses,
-    tags,
-    period,
-    bulkId,
-    from,
-    to,
-    batchId,
-    runIds: runId ? [runId] : undefined,
-    scheduleId,
+    ...filters,
+    // Convert single runId to array format expected by repository
+    runIds: filters.runId ? [filters.runId] : undefined,
     rootOnly: rootOnlyValue,
-    direction: direction,
-    cursor: cursor,
+    // Remove the original runId since we've converted it to runIds
+    runId: undefined,
   };
apps/webapp/app/components/BulkActionFilterSummary.tsx (1)

41-41: Fix the awkward spacing in the text template.

The conditional spacing creates awkward text flow. Consider restructuring this.

-          You {!final ? "have " : " "}individually selected {simplur`${selected} run[|s]`} to be{" "}
+          You {!final ? "have " : ""}individually selected {simplur`${selected} run[|s]`} to be{" "}
apps/webapp/app/services/runsRepository.server.ts (1)

222-256: Use optional chaining for cleaner code.

Static analysis correctly identifies opportunities to use optional chaining.

Apply these improvements:

-    if (options.batchId && options.batchId.startsWith("batch_")) {
+    if (options.batchId?.startsWith("batch_")) {
-    if (options.scheduleId && options.scheduleId.startsWith("sched_")) {
+    if (options.scheduleId?.startsWith("sched_")) {
-    if (options.bulkId && options.bulkId.startsWith("bulk_")) {
+    if (options.bulkId?.startsWith("bulk_")) {
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx (2)

84-87: Improve error message for better user experience.

The error message "Clickhouse is not supported yet" might be confusing for users. Consider providing a more informative message or handling this scenario differently.

-  if (!clickhouseClient) {
-    throw new Error("Clickhouse is not supported yet");
-  }
+  if (!clickhouseClient) {
+    throw new Error("Run analytics are temporarily unavailable. Please try again later.");
+  }

226-290: Remove unnecessary Fragment wrapper.

The Fragment is redundant as it only contains a single child element.

-          <>
-            {list.runs.length === 0 && !list.hasAnyRuns ? (
+            {list.runs.length === 0 && !list.hasAnyRuns ? (
               list.possibleTasks.length === 0 ? (
                 <CreateFirstTaskInstructions />
               ) : (
                 <RunTaskInstructions />
               )
             ) : (
               <div className={cn("grid h-full max-h-full grid-rows-[auto_1fr] overflow-hidden")}>
                 <div className="flex items-start justify-between gap-x-2 p-2">
                   <RunsFilters
                     possibleTasks={list.possibleTasks}
                     bulkActions={list.bulkActions}
                     hasFilters={list.hasFilters}
                     rootOnlyDefault={rootOnlyDefault}
                   />
                   <div className="flex items-center justify-end gap-x-2">
                     {!isShowingBulkActionInspector && (
                       <LinkButton
                         variant="secondary/small"
                         to={v3CreateBulkActionPath(
                           organization,
                           project,
                           environment,
                           filters,
                           selectedItems.size > 0 ? "selected" : undefined
                         )}
                         LeadingIcon={ListCheckedIcon}
                         className={selectedItems.size > 0 ? "pr-1" : undefined}
                         tooltip={
                           <div className="-mr-1 flex items-center gap-3 text-xs text-text-dimmed">
                             <div className="flex items-center gap-0.5">
                               <span>Replay</span>
                               <ShortcutKey shortcut={{ key: "r" }} variant={"small"} />
                             </div>
                             <div className="flex items-center gap-0.5">
                               <span>Cancel</span>
                               <ShortcutKey shortcut={{ key: "c" }} variant={"small"} />
                             </div>
                           </div>
                         }
                       >
                         <span className="flex items-center gap-x-1 whitespace-nowrap text-text-bright">
                           <span>Bulk action</span>
                           {selectedItems.size > 0 && (
                             <Badge variant="rounded">{selectedItems.size}</Badge>
                           )}
                         </span>
                       </LinkButton>
                     )}
                     <ListPagination list={list} />
                   </div>
                 </div>

                 <TaskRunsTable
                   total={list.runs.length}
                   hasFilters={list.hasFilters}
                   filters={list.filters}
                   runs={list.runs}
                   isLoading={isLoading}
                   allowSelection
                 />
               </div>
-            )}
-          </>
+            )}
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c635f7 and c8a59bd.

⛔ Files ignored due to path filters (3)
  • apps/webapp/app/assets/images/open-bulk-actions-panel.png is excluded by !**/*.png
  • apps/webapp/app/assets/images/select-runs-individually.png is excluded by !**/*.png
  • apps/webapp/app/assets/images/select-runs-using-filters.png is excluded by !**/*.png
📒 Files selected for processing (80)
  • .env.example (2 hunks)
  • apps/webapp/app/assets/icons/ListCheckedIcon.tsx (1 hunks)
  • apps/webapp/app/components/BlankStatePanels.tsx (2 hunks)
  • apps/webapp/app/components/BulkActionFilterSummary.tsx (1 hunks)
  • apps/webapp/app/components/ListPagination.tsx (1 hunks)
  • apps/webapp/app/components/navigation/SideMenu.tsx (3 hunks)
  • apps/webapp/app/components/primitives/Accordion.tsx (2 hunks)
  • apps/webapp/app/components/primitives/AppliedFilter.tsx (3 hunks)
  • apps/webapp/app/components/primitives/Badge.tsx (1 hunks)
  • apps/webapp/app/components/primitives/Pagination.tsx (1 hunks)
  • apps/webapp/app/components/primitives/RadioButton.tsx (4 hunks)
  • apps/webapp/app/components/primitives/Select.tsx (2 hunks)
  • apps/webapp/app/components/primitives/Switch.tsx (1 hunks)
  • apps/webapp/app/components/primitives/Tooltip.tsx (2 hunks)
  • apps/webapp/app/components/primitives/TruncatedCopyableValue.tsx (1 hunks)
  • apps/webapp/app/components/runs/v3/BatchFilters.tsx (6 hunks)
  • apps/webapp/app/components/runs/v3/BulkAction.tsx (2 hunks)
  • apps/webapp/app/components/runs/v3/RunFilters.tsx (23 hunks)
  • apps/webapp/app/components/runs/v3/SharedFilters.tsx (11 hunks)
  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx (1 hunks)
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx (8 hunks)
  • apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx (7 hunks)
  • apps/webapp/app/env.server.ts (2 hunks)
  • apps/webapp/app/hooks/useSearchParam.ts (2 hunks)
  • apps/webapp/app/presenters/RunFilters.server.ts (1 hunks)
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts (4 hunks)
  • apps/webapp/app/presenters/v3/BulkActionListPresenter.server.ts (1 hunks)
  • apps/webapp/app/presenters/v3/BulkActionPresenter.server.ts (1 hunks)
  • apps/webapp/app/presenters/v3/CreateBulkActionPresenter.server.ts (1 hunks)
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts (4 hunks)
  • apps/webapp/app/presenters/v3/RunListPresenter.server.ts (0 hunks)
  • apps/webapp/app/presenters/v3/ViewSchedulePresenter.server.ts (3 hunks)
  • apps/webapp/app/presenters/v3/WaitpointPresenter.server.ts (3 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions/route.tsx (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.next.runs._index/route.tsx (0 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.next.runs/route.tsx (0 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx (2 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx (5 hunks)
  • apps/webapp/app/routes/account.tokens/route.tsx (0 hunks)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx (1 hunks)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx (1 hunks)
  • apps/webapp/app/routes/resources.taskruns.bulk.cancel.ts (0 hunks)
  • apps/webapp/app/routes/resources.taskruns.bulk.replay.ts (0 hunks)
  • apps/webapp/app/routes/storybook.badges/route.tsx (1 hunks)
  • apps/webapp/app/runEngine/services/triggerTask.server.ts (1 hunks)
  • apps/webapp/app/services/runsReplicationService.server.ts (1 hunks)
  • apps/webapp/app/services/runsRepository.server.ts (6 hunks)
  • apps/webapp/app/services/worker.server.ts (2 hunks)
  • apps/webapp/app/utils/pathBuilder.ts (2 hunks)
  • apps/webapp/app/utils/searchParams.ts (1 hunks)
  • apps/webapp/app/v3/commonWorker.server.ts (3 hunks)
  • apps/webapp/app/v3/services/baseService.server.ts (1 hunks)
  • apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts (1 hunks)
  • apps/webapp/app/v3/services/bulk/createBulkAction.server.ts (1 hunks)
  • apps/webapp/app/v3/services/cancelTaskRun.server.ts (2 hunks)
  • apps/webapp/app/v3/services/cancelTaskRunV1.server.ts (4 hunks)
  • apps/webapp/app/v3/services/finalizeTaskRun.server.ts (3 hunks)
  • apps/webapp/app/v3/services/replayTaskRun.server.ts (2 hunks)
  • apps/webapp/app/v3/services/triggerTaskV1.server.ts (1 hunks)
  • apps/webapp/tailwind.config.js (2 hunks)
  • apps/webapp/test/runsRepository.test.ts (1 hunks)
  • internal-packages/clickhouse/src/index.ts (2 hunks)
  • internal-packages/clickhouse/src/taskRuns.ts (1 hunks)
  • internal-packages/database/prisma/migrations/20250616083614_bulk_action_v2/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250616084546_bulk_action_item_drop_friendly_id_unique_constraint/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250616084735_bulk_action_item_friendly_id_optional/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250623141255_bulk_action_group_counts_completed_at/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250708130212_task_run_add_bulk_action_group_ids/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250709131914_bulk_action_group_environment_id_created_at_index/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250710105648_bulk_action_notification_type/migration.sql (1 hunks)
  • internal-packages/database/prisma/schema.prisma (5 hunks)
  • internal-packages/emails/emails/bulk-action-complete.tsx (1 hunks)
  • internal-packages/emails/emails/components/styles.ts (2 hunks)
  • internal-packages/emails/src/index.tsx (3 hunks)
  • internal-packages/run-engine/src/engine/index.ts (4 hunks)
  • internal-packages/run-engine/src/engine/systems/runAttemptSystem.ts (7 hunks)
  • internal-packages/run-engine/src/engine/types.ts (1 hunks)
  • packages/core/src/v3/isomorphic/friendlyId.ts (1 hunks)
  • packages/core/src/v3/schemas/api.ts (1 hunks)
💤 Files with no reviewable changes (6)
  • apps/webapp/app/routes/account.tokens/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.next.runs/route.tsx
  • apps/webapp/app/routes/resources.taskruns.bulk.cancel.ts
  • apps/webapp/app/routes/resources.taskruns.bulk.replay.ts
  • apps/webapp/app/presenters/v3/RunListPresenter.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.next.runs._index/route.tsx
🧰 Additional context used
📓 Path-based instructions (7)
`**/*.{ts,tsx}`: Always prefer using isomorphic code like fetch, ReadableStream,...

**/*.{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
Use strict mode
No default exports, use function declarations

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • internal-packages/run-engine/src/engine/types.ts
  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx
  • apps/webapp/app/services/worker.server.ts
  • apps/webapp/app/services/runsReplicationService.server.ts
  • apps/webapp/app/components/primitives/Tooltip.tsx
  • apps/webapp/app/runEngine/services/triggerTask.server.ts
  • apps/webapp/app/v3/services/triggerTaskV1.server.ts
  • apps/webapp/test/runsRepository.test.ts
  • apps/webapp/app/components/primitives/Switch.tsx
  • apps/webapp/app/v3/services/bulk/createBulkAction.server.ts
  • apps/webapp/app/routes/storybook.badges/route.tsx
  • packages/core/src/v3/schemas/api.ts
  • apps/webapp/app/components/primitives/Badge.tsx
  • apps/webapp/app/components/navigation/SideMenu.tsx
  • apps/webapp/app/v3/services/replayTaskRun.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
  • apps/webapp/app/components/primitives/Select.tsx
  • apps/webapp/app/assets/icons/ListCheckedIcon.tsx
  • internal-packages/clickhouse/src/index.ts
  • packages/core/src/v3/isomorphic/friendlyId.ts
  • apps/webapp/app/utils/searchParams.ts
  • apps/webapp/app/env.server.ts
  • internal-packages/clickhouse/src/taskRuns.ts
  • apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx
  • apps/webapp/app/components/BlankStatePanels.tsx
  • apps/webapp/app/presenters/v3/ViewSchedulePresenter.server.ts
  • internal-packages/emails/src/index.tsx
  • apps/webapp/app/components/primitives/TruncatedCopyableValue.tsx
  • apps/webapp/app/v3/services/baseService.server.ts
  • apps/webapp/app/presenters/v3/BulkActionPresenter.server.ts
  • apps/webapp/app/presenters/v3/CreateBulkActionPresenter.server.ts
  • internal-packages/emails/emails/components/styles.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/components/primitives/AppliedFilter.tsx
  • apps/webapp/app/components/runs/v3/BatchFilters.tsx
  • apps/webapp/app/presenters/v3/WaitpointPresenter.server.ts
  • apps/webapp/app/components/ListPagination.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx
  • apps/webapp/app/hooks/useSearchParam.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx
  • apps/webapp/app/components/primitives/Accordion.tsx
  • apps/webapp/app/presenters/v3/BulkActionListPresenter.server.ts
  • apps/webapp/app/v3/commonWorker.server.ts
  • apps/webapp/app/components/primitives/RadioButton.tsx
  • apps/webapp/app/v3/services/finalizeTaskRun.server.ts
  • apps/webapp/app/v3/services/cancelTaskRunV1.server.ts
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts
  • internal-packages/run-engine/src/engine/index.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • internal-packages/run-engine/src/engine/systems/runAttemptSystem.ts
  • apps/webapp/app/utils/pathBuilder.ts
  • apps/webapp/app/components/primitives/Pagination.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/components/runs/v3/BulkAction.tsx
  • internal-packages/emails/emails/bulk-action-complete.tsx
  • apps/webapp/app/v3/services/cancelTaskRun.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx
  • apps/webapp/app/components/runs/v3/SharedFilters.tsx
  • apps/webapp/app/services/runsRepository.server.ts
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions/route.tsx
`apps/webapp/**/*.{ts,tsx}`: When importing from `@trigger.dev/core` in the weba...

apps/webapp/**/*.{ts,tsx}: When importing from @trigger.dev/core in the webapp, never import from the root @trigger.dev/core path; always use one of the subpath exports as defined in the package's package.json.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/webapp.mdc)

List of files the instruction was applied to:

  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx
  • apps/webapp/app/services/worker.server.ts
  • apps/webapp/app/services/runsReplicationService.server.ts
  • apps/webapp/app/components/primitives/Tooltip.tsx
  • apps/webapp/app/runEngine/services/triggerTask.server.ts
  • apps/webapp/app/v3/services/triggerTaskV1.server.ts
  • apps/webapp/test/runsRepository.test.ts
  • apps/webapp/app/components/primitives/Switch.tsx
  • apps/webapp/app/v3/services/bulk/createBulkAction.server.ts
  • apps/webapp/app/routes/storybook.badges/route.tsx
  • apps/webapp/app/components/primitives/Badge.tsx
  • apps/webapp/app/components/navigation/SideMenu.tsx
  • apps/webapp/app/v3/services/replayTaskRun.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
  • apps/webapp/app/components/primitives/Select.tsx
  • apps/webapp/app/assets/icons/ListCheckedIcon.tsx
  • apps/webapp/app/utils/searchParams.ts
  • apps/webapp/app/env.server.ts
  • apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx
  • apps/webapp/app/components/BlankStatePanels.tsx
  • apps/webapp/app/presenters/v3/ViewSchedulePresenter.server.ts
  • apps/webapp/app/components/primitives/TruncatedCopyableValue.tsx
  • apps/webapp/app/v3/services/baseService.server.ts
  • apps/webapp/app/presenters/v3/BulkActionPresenter.server.ts
  • apps/webapp/app/presenters/v3/CreateBulkActionPresenter.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/components/primitives/AppliedFilter.tsx
  • apps/webapp/app/components/runs/v3/BatchFilters.tsx
  • apps/webapp/app/presenters/v3/WaitpointPresenter.server.ts
  • apps/webapp/app/components/ListPagination.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx
  • apps/webapp/app/hooks/useSearchParam.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx
  • apps/webapp/app/components/primitives/Accordion.tsx
  • apps/webapp/app/presenters/v3/BulkActionListPresenter.server.ts
  • apps/webapp/app/v3/commonWorker.server.ts
  • apps/webapp/app/components/primitives/RadioButton.tsx
  • apps/webapp/app/v3/services/finalizeTaskRun.server.ts
  • apps/webapp/app/v3/services/cancelTaskRunV1.server.ts
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/utils/pathBuilder.ts
  • apps/webapp/app/components/primitives/Pagination.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/components/runs/v3/BulkAction.tsx
  • apps/webapp/app/v3/services/cancelTaskRun.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx
  • apps/webapp/app/components/runs/v3/SharedFilters.tsx
  • apps/webapp/app/services/runsRepository.server.ts
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions/route.tsx
`**/*.tsx`: When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.

**/*.tsx: When using React hooks for realtime updates, use @trigger.dev/react-hooks and provide a Public Access Token via context or props.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/writing-tasks.mdc)

List of files the instruction was applied to:

  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx
  • apps/webapp/app/components/primitives/Tooltip.tsx
  • apps/webapp/app/components/primitives/Switch.tsx
  • apps/webapp/app/routes/storybook.badges/route.tsx
  • apps/webapp/app/components/primitives/Badge.tsx
  • apps/webapp/app/components/navigation/SideMenu.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
  • apps/webapp/app/components/primitives/Select.tsx
  • apps/webapp/app/assets/icons/ListCheckedIcon.tsx
  • apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx
  • apps/webapp/app/components/BlankStatePanels.tsx
  • internal-packages/emails/src/index.tsx
  • apps/webapp/app/components/primitives/TruncatedCopyableValue.tsx
  • apps/webapp/app/components/primitives/AppliedFilter.tsx
  • apps/webapp/app/components/runs/v3/BatchFilters.tsx
  • apps/webapp/app/components/ListPagination.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx
  • apps/webapp/app/components/primitives/Accordion.tsx
  • apps/webapp/app/components/primitives/RadioButton.tsx
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/components/primitives/Pagination.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/components/runs/v3/BulkAction.tsx
  • internal-packages/emails/emails/bulk-action-complete.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx
  • apps/webapp/app/components/runs/v3/SharedFilters.tsx
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions/route.tsx
`{packages/core,apps/webapp}/**/*.{ts,tsx}`: We use zod a lot in packages/core and in the webapp

{packages/core,apps/webapp}/**/*.{ts,tsx}: We use zod a lot in packages/core and in the webapp

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx
  • apps/webapp/app/services/worker.server.ts
  • apps/webapp/app/services/runsReplicationService.server.ts
  • apps/webapp/app/components/primitives/Tooltip.tsx
  • apps/webapp/app/runEngine/services/triggerTask.server.ts
  • apps/webapp/app/v3/services/triggerTaskV1.server.ts
  • apps/webapp/test/runsRepository.test.ts
  • apps/webapp/app/components/primitives/Switch.tsx
  • apps/webapp/app/v3/services/bulk/createBulkAction.server.ts
  • apps/webapp/app/routes/storybook.badges/route.tsx
  • packages/core/src/v3/schemas/api.ts
  • apps/webapp/app/components/primitives/Badge.tsx
  • apps/webapp/app/components/navigation/SideMenu.tsx
  • apps/webapp/app/v3/services/replayTaskRun.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
  • apps/webapp/app/components/primitives/Select.tsx
  • apps/webapp/app/assets/icons/ListCheckedIcon.tsx
  • packages/core/src/v3/isomorphic/friendlyId.ts
  • apps/webapp/app/utils/searchParams.ts
  • apps/webapp/app/env.server.ts
  • apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx
  • apps/webapp/app/components/BlankStatePanels.tsx
  • apps/webapp/app/presenters/v3/ViewSchedulePresenter.server.ts
  • apps/webapp/app/components/primitives/TruncatedCopyableValue.tsx
  • apps/webapp/app/v3/services/baseService.server.ts
  • apps/webapp/app/presenters/v3/BulkActionPresenter.server.ts
  • apps/webapp/app/presenters/v3/CreateBulkActionPresenter.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/components/primitives/AppliedFilter.tsx
  • apps/webapp/app/components/runs/v3/BatchFilters.tsx
  • apps/webapp/app/presenters/v3/WaitpointPresenter.server.ts
  • apps/webapp/app/components/ListPagination.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx
  • apps/webapp/app/hooks/useSearchParam.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx
  • apps/webapp/app/components/primitives/Accordion.tsx
  • apps/webapp/app/presenters/v3/BulkActionListPresenter.server.ts
  • apps/webapp/app/v3/commonWorker.server.ts
  • apps/webapp/app/components/primitives/RadioButton.tsx
  • apps/webapp/app/v3/services/finalizeTaskRun.server.ts
  • apps/webapp/app/v3/services/cancelTaskRunV1.server.ts
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/utils/pathBuilder.ts
  • apps/webapp/app/components/primitives/Pagination.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx
  • apps/webapp/app/components/runs/v3/BulkAction.tsx
  • apps/webapp/app/v3/services/cancelTaskRun.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx
  • apps/webapp/app/components/runs/v3/SharedFilters.tsx
  • apps/webapp/app/services/runsRepository.server.ts
  • apps/webapp/app/components/runs/v3/RunFilters.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions/route.tsx
`apps/webapp/**/*.ts`: In the webapp, all environment variables must be accessed through the `env` export of `env.server.ts`, instead of directly accessing `process.env`.

apps/webapp/**/*.ts: In the webapp, all environment variables must be accessed through the env export of env.server.ts, instead of directly accessing process.env.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/webapp.mdc)

List of files the instruction was applied to:

  • apps/webapp/app/services/worker.server.ts
  • apps/webapp/app/services/runsReplicationService.server.ts
  • apps/webapp/app/runEngine/services/triggerTask.server.ts
  • apps/webapp/app/v3/services/triggerTaskV1.server.ts
  • apps/webapp/test/runsRepository.test.ts
  • apps/webapp/app/v3/services/bulk/createBulkAction.server.ts
  • apps/webapp/app/v3/services/replayTaskRun.server.ts
  • apps/webapp/app/utils/searchParams.ts
  • apps/webapp/app/env.server.ts
  • apps/webapp/app/presenters/v3/ViewSchedulePresenter.server.ts
  • apps/webapp/app/v3/services/baseService.server.ts
  • apps/webapp/app/presenters/v3/BulkActionPresenter.server.ts
  • apps/webapp/app/presenters/v3/CreateBulkActionPresenter.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/presenters/v3/WaitpointPresenter.server.ts
  • apps/webapp/app/hooks/useSearchParam.ts
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/presenters/v3/BulkActionListPresenter.server.ts
  • apps/webapp/app/v3/commonWorker.server.ts
  • apps/webapp/app/v3/services/finalizeTaskRun.server.ts
  • apps/webapp/app/v3/services/cancelTaskRunV1.server.ts
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts
  • apps/webapp/app/utils/pathBuilder.ts
  • apps/webapp/app/v3/services/cancelTaskRun.server.ts
  • apps/webapp/app/services/runsRepository.server.ts
`apps/webapp/**/*.test.{ts,tsx}`: The `env.server.ts` file should never be imported into a test file, either directly or indirectly.

apps/webapp/**/*.test.{ts,tsx}: The env.server.ts file should never be imported into a test file, either directly or indirectly.

📄 Source: CodeRabbit Inference Engine (.cursor/rules/webapp.mdc)

List of files the instruction was applied to:

  • apps/webapp/test/runsRepository.test.ts
`**/*.test.{ts,tsx}`: Our tests are all vitest

**/*.test.{ts,tsx}: Our tests are all vitest

📄 Source: CodeRabbit Inference Engine (.github/copilot-instructions.md)

List of files the instruction was applied to:

  • apps/webapp/test/runsRepository.test.ts
🧠 Learnings (49)
📓 Common learnings
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
.env.example (2)
Learnt from: nicktrn
PR: triggerdotdev/trigger.dev#2155
File: hosting/docker/.env.example:4-7
Timestamp: 2025-06-06T23:55:01.933Z
Learning: In the trigger.dev project, .env.example files should contain actual example secret values rather than placeholders, as these help users understand the expected format. The files include clear warnings about not using these defaults in production and instructions for generating proper secrets.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-06-30T13:21:59.438Z
Learning: Applies to apps/webapp/**/*.ts : In the webapp, all environment variables must be accessed through the `env` export of `env.server.ts`, instead of directly accessing `process.env`.
internal-packages/run-engine/src/engine/types.ts (10)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to trigger.config.ts : Build extensions for Trigger.dev must be configured in the `build` property of `trigger.config.ts` using provided or custom extensions.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Each Trigger.dev task must have a unique `id` within your project.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Lifecycle hooks (`init`, `cleanup`, `onStart`, `onSuccess`, `onFailure`, `handleError`) must be defined as properties of the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to trigger.config.ts : The `trigger.config.ts` file must use `defineConfig` from `@trigger.dev/sdk/v3` to configure project settings, directories, retries, telemetry, runtime, machine settings, log level, max duration, and build options.
apps/webapp/app/components/runs/v3/TaskRunStatus.tsx (10)
Learnt from: nicktrn
PR: triggerdotdev/trigger.dev#1418
File: packages/core/src/v3/errors.ts:364-371
Timestamp: 2024-10-18T15:41:52.352Z
Learning: In `packages/core/src/v3/errors.ts`, within the `taskRunErrorEnhancer` function, `error.message` is always defined, so it's safe to directly call `error.message.includes("SIGTERM")` without additional checks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: nicktrn
PR: triggerdotdev/trigger.dev#1387
File: packages/cli-v3/src/executions/taskRunProcess.ts:408-413
Timestamp: 2024-10-12T01:08:24.066Z
Learning: In the `parseExecuteError` method in `packages/cli-v3/src/executions/taskRunProcess.ts`, using `String(error)` to populate the `message` field works fine and even prepends `error.name`.
Learnt from: nicktrn
PR: triggerdotdev/trigger.dev#1387
File: packages/cli-v3/src/executions/taskRunProcess.ts:408-413
Timestamp: 2024-10-07T10:32:30.100Z
Learning: In the `parseExecuteError` method in `packages/cli-v3/src/executions/taskRunProcess.ts`, using `String(error)` to populate the `message` field works fine and even prepends `error.name`.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Lifecycle hooks (`init`, `cleanup`, `onStart`, `onSuccess`, `onFailure`, `handleError`) must be defined as properties of the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST `export` every task, including subtasks, in Trigger.dev task files.
apps/webapp/app/services/worker.server.ts (9)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST NEVER use `client.defineJob` in Trigger.dev task files, as it is deprecated and will break the application.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Before generating any code for Trigger.dev tasks, verify that you are importing from `@trigger.dev/sdk/v3`, exporting every task, and not generating any deprecated code patterns.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST use `@trigger.dev/sdk/v3` when writing Trigger.dev tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
apps/webapp/app/components/primitives/Tooltip.tsx (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
apps/webapp/app/runEngine/services/triggerTask.server.ts (10)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Lifecycle hooks (`init`, `cleanup`, `onStart`, `onSuccess`, `onFailure`, `handleError`) must be defined as properties of the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
apps/webapp/app/v3/services/triggerTaskV1.server.ts (10)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Lifecycle hooks (`init`, `cleanup`, `onStart`, `onSuccess`, `onFailure`, `handleError`) must be defined as properties of the `task` function in Trigger.dev task files.
apps/webapp/test/runsRepository.test.ts (2)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-06-30T13:21:59.438Z
Learning: Applies to apps/webapp/app/**/*.test.{ts,tsx} : Tests should only import classes and functions from files matching `app/**/*.ts` of the webapp, and those files should not use environment variables; everything should be passed through as options instead.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to **/*.test.{ts,tsx} : Our tests are all vitest
apps/webapp/app/v3/services/bulk/createBulkAction.server.ts (11)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-06-30T13:21:59.438Z
Learning: Applies to apps/webapp/**/*.{ts,tsx} : When importing from `@trigger.dev/core` in the webapp, never import from the root `@trigger.dev/core` path; always use one of the subpath exports as defined in the package's package.json.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Before generating any code for Trigger.dev tasks, verify that you are importing from `@trigger.dev/sdk/v3`, exporting every task, and not generating any deprecated code patterns.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST `export` every task, including subtasks, in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST use `@trigger.dev/sdk/v3` when writing Trigger.dev tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
packages/core/src/v3/schemas/api.ts (10)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST use `@trigger.dev/sdk/v3` when writing Trigger.dev tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Lifecycle hooks (`init`, `cleanup`, `onStart`, `onSuccess`, `onFailure`, `handleError`) must be defined as properties of the `task` function in Trigger.dev task files.
apps/webapp/app/v3/services/replayTaskRun.server.ts (10)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST use `@trigger.dev/sdk/v3` when writing Trigger.dev tasks.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
internal-packages/database/prisma/migrations/20250709131914_bulk_action_group_environment_id_created_at_index/migration.sql (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
internal-packages/clickhouse/src/index.ts (11)
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST `export` every task, including subtasks, in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to trigger.config.ts : Global lifecycle hooks for tasks can be defined in `trigger.config.ts` to apply to all tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST NEVER use `client.defineJob` in Trigger.dev task files, as it is deprecated and will break the application.
apps/webapp/app/utils/searchParams.ts (1)
Learnt from: matt-aitken
PR: triggerdotdev/trigger.dev#1313
File: apps/webapp/app/hooks/useSearchParam.ts:21-21
Timestamp: 2024-09-17T16:37:27.060Z
Learning: When using `URLSearchParams.set` followed by `.toString()`, values are automatically URL-encoded. Manually encoding these values can lead to double encoding issues.
apps/webapp/app/env.server.ts (9)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-06-30T13:21:59.438Z
Learning: Applies to apps/webapp/**/*.ts : In the webapp, all environment variables must be accessed through the `env` export of `env.server.ts`, instead of directly accessing `process.env`.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to {packages/core,apps/webapp}/**/*.{ts,tsx} : We use zod a lot in packages/core and in the webapp
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-06-30T13:21:59.438Z
Learning: Applies to apps/webapp/app/**/*.test.{ts,tsx} : Tests should only import classes and functions from files matching `app/**/*.ts` of the webapp, and those files should not use environment variables; everything should be passed through as options instead.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-06-30T13:21:59.438Z
Learning: Applies to apps/webapp/**/*.test.{ts,tsx} : The `env.server.ts` file should never be imported into a test file, either directly or indirectly.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/webapp.mdc:0-0
Timestamp: 2025-06-30T13:21:59.438Z
Learning: Applies to apps/webapp/**/*.{ts,tsx} : When importing from `@trigger.dev/core` in the webapp, never import from the root `@trigger.dev/core` path; always use one of the subpath exports as defined in the package's package.json.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: nicktrn
PR: triggerdotdev/trigger.dev#1407
File: apps/kubernetes-provider/src/index.ts:37-39
Timestamp: 2024-10-16T12:24:37.279Z
Learning: In Node.js, when assigning default values to environment variables using the `||` operator (e.g., `const VAR = process.env.VAR || 'default'`), empty strings are treated as falsy values, so the default value will be used without additional checks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to trigger.config.ts : The `trigger.config.ts` file must use `defineConfig` from `@trigger.dev/sdk/v3` to configure project settings, directories, retries, telemetry, runtime, machine settings, log level, max duration, and build options.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
internal-packages/clickhouse/src/taskRuns.ts (3)
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx (3)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
Learnt from: matt-aitken
PR: triggerdotdev/trigger.dev#2025
File: internal-packages/database/prisma/schema.prisma:2103-2105
Timestamp: 2025-05-06T17:37:33.845Z
Learning: The `resolver` field in the Waitpoint model is used purely for filtering in the dashboard and doesn't change the underlying functionality of waitpoints. It provides additional classification (ENGINE, TOKEN, HTTP_CALLBACK) while the existing `type` field (MANUAL, DATETIME, etc.) continues to define the fundamental nature of the waitpoint.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
apps/webapp/app/components/BlankStatePanels.tsx (10)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Before generating any code for Trigger.dev tasks, verify that you are importing from `@trigger.dev/sdk/v3`, exporting every task, and not generating any deprecated code patterns.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST use `@trigger.dev/sdk/v3` when writing Trigger.dev tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Lifecycle hooks (`init`, `cleanup`, `onStart`, `onSuccess`, `onFailure`, `handleError`) must be defined as properties of the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST `export` every task, including subtasks, in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST NEVER use `client.defineJob` in Trigger.dev task files, as it is deprecated and will break the application.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
apps/webapp/app/presenters/v3/ViewSchedulePresenter.server.ts (3)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
internal-packages/emails/src/index.tsx (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
apps/webapp/app/components/primitives/TruncatedCopyableValue.tsx (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
apps/webapp/app/v3/services/baseService.server.ts (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
internal-packages/database/prisma/migrations/20250710105648_bulk_action_notification_type/migration.sql (2)
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2086
File: internal-packages/database/prisma/migrations/20250511145836_runtime_environment_add_is_branchable_environment/migration.sql:1-3
Timestamp: 2025-05-27T19:30:34.004Z
Learning: In modern PostgreSQL versions (11+), adding a column with a constant default value (like DEFAULT false, DEFAULT 0, DEFAULT 'text') does NOT require a table rewrite. PostgreSQL stores the default value in the catalog and applies it virtually when reading rows. Only non-constant defaults or more complex scenarios require table rewrites. Avoid suggesting multi-step migrations for simple constant defaults.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
apps/webapp/app/presenters/RunFilters.server.ts (2)
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
apps/webapp/app/components/primitives/AppliedFilter.tsx (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
apps/webapp/app/components/runs/v3/BatchFilters.tsx (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
internal-packages/database/prisma/migrations/20250616083614_bulk_action_v2/migration.sql (2)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2086
File: internal-packages/database/prisma/migrations/20250511145836_runtime_environment_add_is_branchable_environment/migration.sql:1-3
Timestamp: 2025-05-27T19:30:34.004Z
Learning: In modern PostgreSQL versions (11+), adding a column with a constant default value (like DEFAULT false, DEFAULT 0, DEFAULT 'text') does NOT require a table rewrite. PostgreSQL stores the default value in the catalog and applies it virtually when reading rows. Only non-constant defaults or more complex scenarios require table rewrites. Avoid suggesting multi-step migrations for simple constant defaults.
apps/webapp/app/presenters/v3/WaitpointPresenter.server.ts (4)
Learnt from: nicktrn
PR: triggerdotdev/trigger.dev#1389
File: apps/coordinator/src/index.ts:403-0
Timestamp: 2024-10-16T01:08:01.788Z
Learning: In `apps/coordinator/src/index.ts`, moving the `exitRun` and `crashRun` functions outside the `onConnection` method is not feasible because of TypeScript type issues with `socket`. Keeping these functions inside `onConnection` is preferred.
Learnt from: nicktrn
PR: triggerdotdev/trigger.dev#1389
File: apps/coordinator/src/index.ts:403-0
Timestamp: 2024-10-08T15:31:34.807Z
Learning: In `apps/coordinator/src/index.ts`, moving the `exitRun` and `crashRun` functions outside the `onConnection` method is not feasible because of TypeScript type issues with `socket`. Keeping these functions inside `onConnection` is preferred.
Learnt from: nicktrn
PR: triggerdotdev/trigger.dev#1389
File: apps/coordinator/src/index.ts:403-0
Timestamp: 2024-10-08T13:39:26.553Z
Learning: In `apps/coordinator/src/index.ts`, moving the `exitRun` and `crashRun` functions outside the `onConnection` method is not feasible because of TypeScript type issues with `socket`. Keeping these functions inside `onConnection` is preferred.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
internal-packages/database/prisma/migrations/20250623141255_bulk_action_group_counts_completed_at/migration.sql (1)
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2086
File: internal-packages/database/prisma/migrations/20250511145836_runtime_environment_add_is_branchable_environment/migration.sql:1-3
Timestamp: 2025-05-27T19:30:34.004Z
Learning: In modern PostgreSQL versions (11+), adding a column with a constant default value (like DEFAULT false, DEFAULT 0, DEFAULT 'text') does NOT require a table rewrite. PostgreSQL stores the default value in the catalog and applies it virtually when reading rows. Only non-constant defaults or more complex scenarios require table rewrites. Avoid suggesting multi-step migrations for simple constant defaults.
apps/webapp/app/hooks/useSearchParam.ts (1)
Learnt from: matt-aitken
PR: triggerdotdev/trigger.dev#1313
File: apps/webapp/app/hooks/useSearchParam.ts:21-21
Timestamp: 2024-09-17T16:37:27.060Z
Learning: When using `URLSearchParams.set` followed by `.toString()`, values are automatically URL-encoded. Manually encoding these values can lead to double encoding issues.
apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts (2)
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
apps/webapp/app/components/primitives/Accordion.tsx (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
apps/webapp/app/v3/commonWorker.server.ts (2)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
apps/webapp/app/v3/services/finalizeTaskRun.server.ts (6)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
apps/webapp/app/v3/services/cancelTaskRunV1.server.ts (8)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: nicktrn
PR: triggerdotdev/trigger.dev#1418
File: packages/core/src/v3/errors.ts:364-371
Timestamp: 2024-10-18T15:41:52.352Z
Learning: In `packages/core/src/v3/errors.ts`, within the `taskRunErrorEnhancer` function, `error.message` is always defined, so it's safe to directly call `error.message.includes("SIGTERM")` without additional checks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts (10)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST NEVER use `client.defineJob` in Trigger.dev task files, as it is deprecated and will break the application.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Before generating any code for Trigger.dev tasks, verify that you are importing from `@trigger.dev/sdk/v3`, exporting every task, and not generating any deprecated code patterns.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
internal-packages/run-engine/src/engine/index.ts (11)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to trigger.config.ts : Global lifecycle hooks for tasks can be defined in `trigger.config.ts` to apply to all tasks.
apps/webapp/app/components/runs/v3/TaskRunsTable.tsx (8)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Lifecycle hooks (`init`, `cleanup`, `onStart`, `onSuccess`, `onFailure`, `handleError`) must be defined as properties of the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
apps/webapp/app/utils/pathBuilder.ts (4)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST use `@trigger.dev/sdk/v3` when writing Trigger.dev tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx (8)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to **/*.{ts,tsx} : Always prefer using isomorphic code like fetch, ReadableStream, etc. instead of Node.js specific code
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to {packages/core,apps/webapp}/**/*.{ts,tsx} : We use zod a lot in packages/core and in the webapp
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
apps/webapp/app/v3/services/cancelTaskRun.server.ts (7)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When implementing idempotency, use the `idempotencyKeys` API from `@trigger.dev/sdk/v3` and provide an `idempotencyKey` when triggering tasks.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : ALWAYS generate Trigger.dev tasks using the `task` function from `@trigger.dev/sdk/v3` and NEVER use the deprecated `client.defineJob` pattern.
apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx (8)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : If you are able to generate an example payload for a task, do so.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to {packages/core,apps/webapp}/**/*.{ts,tsx} : We use zod a lot in packages/core and in the webapp
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
internal-packages/database/prisma/schema.prisma (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
apps/webapp/app/components/runs/v3/SharedFilters.tsx (1)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
apps/webapp/app/services/runsRepository.server.ts (8)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to {packages/core,apps/webapp}/**/*.{ts,tsx} : We use zod a lot in packages/core and in the webapp
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
apps/webapp/app/components/runs/v3/RunFilters.tsx (14)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to {packages/core,apps/webapp}/**/*.{ts,tsx} : We use zod a lot in packages/core and in the webapp
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Lifecycle hooks (`init`, `cleanup`, `onStart`, `onSuccess`, `onFailure`, `handleError`) must be defined as properties of the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST `export` every task, including subtasks, in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : If you are able to generate an example payload for a task, do so.
🧬 Code Graph Analysis (22)
apps/webapp/app/components/primitives/Tooltip.tsx (1)
apps/webapp/app/utils/cn.ts (1)
  • cn (31-33)
apps/webapp/app/components/primitives/Switch.tsx (1)
apps/webapp/app/utils/cn.ts (1)
  • cn (31-33)
apps/webapp/app/routes/storybook.badges/route.tsx (1)
apps/webapp/app/components/primitives/Badge.tsx (1)
  • Badge (19-25)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx (1)
apps/webapp/app/components/primitives/CopyableText.tsx (1)
  • CopyableText (7-57)
apps/webapp/app/components/primitives/Select.tsx (1)
apps/webapp/app/utils/cn.ts (1)
  • cn (31-33)
internal-packages/clickhouse/src/index.ts (1)
internal-packages/clickhouse/src/taskRuns.ts (1)
  • getTaskRunsCountQueryBuilder (110-119)
apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx (4)
apps/webapp/app/components/primitives/Buttons.tsx (1)
  • Button (294-329)
apps/webapp/app/assets/icons/StatusIcon.tsx (1)
  • StatusIcon (3-9)
apps/webapp/app/components/runs/v3/SharedFilters.tsx (1)
  • appliedSummary (387-397)
apps/webapp/app/components/runs/v3/WaitpointStatus.tsx (1)
  • waitpointStatusTitle (66-79)
apps/webapp/app/components/BlankStatePanels.tsx (6)
apps/webapp/app/hooks/useOrganizations.ts (1)
  • useOrganization (39-43)
apps/webapp/app/hooks/useProject.tsx (1)
  • useProject (20-24)
apps/webapp/app/hooks/useEnvironment.tsx (1)
  • useEnvironment (19-23)
apps/webapp/app/components/primitives/Headers.tsx (1)
  • Header1 (32-50)
apps/webapp/app/components/primitives/Buttons.tsx (1)
  • LinkButton (335-401)
apps/webapp/app/utils/pathBuilder.ts (1)
  • v3CreateBulkActionPath (257-275)
internal-packages/emails/src/index.tsx (1)
internal-packages/emails/emails/bulk-action-complete.tsx (1)
  • BulkActionCompletedEmailSchema (28-38)
apps/webapp/app/v3/services/baseService.server.ts (1)
apps/webapp/app/db.server.ts (1)
  • $replica (102-105)
apps/webapp/app/presenters/RunFilters.server.ts (2)
apps/webapp/app/services/preferences/uiPreferences.server.ts (1)
  • getRootOnlyFilterPreference (31-38)
apps/webapp/app/components/runs/v3/RunFilters.tsx (3)
  • getRunFiltersFromSearchParams (179-214)
  • TaskRunListSearchFilters (79-109)
  • TaskRunListSearchFilters (111-111)
apps/webapp/app/components/primitives/AppliedFilter.tsx (2)
apps/webapp/app/components/primitives/ShortcutKey.tsx (1)
  • variants (14-19)
packages/core/src/v3/schemas/style.ts (1)
  • Variant (8-8)
apps/webapp/app/components/runs/v3/BatchFilters.tsx (4)
apps/webapp/app/components/primitives/Buttons.tsx (1)
  • Button (294-329)
apps/webapp/app/assets/icons/StatusIcon.tsx (1)
  • StatusIcon (3-9)
apps/webapp/app/components/runs/v3/SharedFilters.tsx (1)
  • appliedSummary (387-397)
apps/webapp/app/components/runs/v3/BatchStatus.tsx (1)
  • batchStatusTitle (76-88)
apps/webapp/app/components/primitives/Accordion.tsx (2)
apps/webapp/app/utils/cn.ts (1)
  • cn (31-33)
apps/webapp/app/components/primitives/Icon.tsx (2)
  • RenderIcon (4-4)
  • Icon (12-37)
apps/webapp/app/components/primitives/RadioButton.tsx (1)
apps/webapp/app/utils/cn.ts (1)
  • cn (31-33)
apps/webapp/app/v3/services/cancelTaskRunV1.server.ts (1)
apps/webapp/app/v3/services/cancelTaskRun.server.ts (2)
  • CancelableTaskRun (21-24)
  • CancelTaskRunServiceOptions (9-14)
internal-packages/run-engine/src/engine/index.ts (1)
packages/core/src/v3/schemas/runEngine.ts (2)
  • ExecutionResult (122-125)
  • ExecutionResult (127-127)
internal-packages/run-engine/src/engine/systems/runAttemptSystem.ts (2)
packages/core/src/v3/schemas/runEngine.ts (2)
  • ExecutionResult (122-125)
  • ExecutionResult (127-127)
internal-packages/run-engine/src/engine/systems/executionSnapshotSystem.ts (1)
  • executionResultFromSnapshot (140-156)
apps/webapp/app/utils/pathBuilder.ts (3)
apps/webapp/app/components/runs/v3/RunFilters.tsx (2)
  • TaskRunListSearchFilters (79-109)
  • TaskRunListSearchFilters (111-111)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx (1)
  • action (85-130)
apps/webapp/app/utils/searchParams.ts (1)
  • objectToSearchParams (4-25)
apps/webapp/app/components/primitives/Pagination.tsx (2)
apps/webapp/app/components/primitives/Buttons.tsx (1)
  • LinkButton (335-401)
apps/webapp/app/utils/cn.ts (1)
  • cn (31-33)
apps/webapp/app/components/runs/v3/BulkAction.tsx (2)
apps/webapp/app/utils/cn.ts (1)
  • cn (31-33)
apps/webapp/app/components/primitives/Spinner.tsx (1)
  • Spinner (8-62)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions/route.tsx (17)
apps/webapp/app/services/session.server.ts (1)
  • requireUserId (25-35)
apps/webapp/app/utils/pathBuilder.ts (4)
  • EnvironmentParamSchema (26-28)
  • docsPath (475-477)
  • v3CreateBulkActionPath (257-275)
  • v3BulkActionPath (178-185)
apps/webapp/app/models/project.server.ts (1)
  • findProjectBySlug (109-120)
apps/webapp/app/models/runtimeEnvironment.server.ts (1)
  • findEnvironmentBySlug (116-145)
apps/webapp/app/presenters/v3/BulkActionListPresenter.server.ts (1)
  • BulkActionListPresenter (15-62)
apps/webapp/app/hooks/useOrganizations.ts (1)
  • useOrganization (39-43)
apps/webapp/app/hooks/useProject.tsx (1)
  • useProject (20-24)
apps/webapp/app/hooks/useEnvironment.tsx (1)
  • useEnvironment (19-23)
apps/webapp/app/components/layout/AppLayout.tsx (3)
  • PageContainer (13-15)
  • PageBody (17-38)
  • MainCenteredContainer (40-54)
apps/webapp/app/components/primitives/PageHeader.tsx (3)
  • NavBar (15-31)
  • PageTitle (41-58)
  • PageAccessories (60-62)
apps/webapp/app/components/admin/debugTooltip.tsx (1)
  • AdminDebugTooltip (14-34)
apps/webapp/app/components/primitives/Buttons.tsx (1)
  • LinkButton (335-401)
apps/webapp/app/components/BlankStatePanels.tsx (1)
  • BulkActionsNone (576-627)
apps/webapp/app/utils/cn.ts (1)
  • cn (31-33)
apps/webapp/app/components/primitives/Table.tsx (6)
  • Table (41-59)
  • TableHeader (66-82)
  • TableHeaderCell (137-179)
  • TableBody (89-97)
  • TableBlankRow (387-397)
  • TableCell (193-270)
apps/webapp/app/components/runs/v3/BulkAction.tsx (2)
  • BulkActionStatusCombo (78-95)
  • BulkActionTypeCombo (7-24)
apps/webapp/app/components/primitives/DateTime.tsx (1)
  • DateTime (19-62)
🪛 Biome (1.9.4)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx

[error] 226-290: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)

apps/webapp/app/services/runsRepository.server.ts

[error] 222-222: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 239-239: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 255-255: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ 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). (25)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • 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 (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (139)
apps/webapp/app/assets/icons/ListCheckedIcon.tsx (1)

1-48: LGTM! Well-implemented icon component.

The ListCheckedIcon component follows React best practices with proper TypeScript typing, theme-friendly SVG implementation using currentColor, and consistent styling. The component adheres to the coding guidelines by using function declarations and avoiding default exports.

apps/webapp/app/components/primitives/Accordion.tsx (3)

7-7: LGTM! Proper import of Icon component.

The import follows the established pattern for using the Icon primitive component.


23-26: LGTM! Well-defined TypeScript interface.

The AccordionTriggerProps type properly extends the original props with optional icon support, following TypeScript best practices.


28-46: LGTM! Clean icon integration with proper layout.

The AccordionTrigger enhancement properly:

  • Uses destructuring to extract the new icon props
  • Conditionally renders the icon with appropriate sizing and styling
  • Maintains proper flex layout with spacing
  • Uses the cn utility for className merging
  • Follows React patterns for conditional rendering
internal-packages/database/prisma/migrations/20250616084735_bulk_action_item_friendly_id_optional/migration.sql (1)

1-4: LGTM! Standard database migration to make friendlyId nullable.

The migration correctly uses standard SQL syntax to make the friendlyId column nullable in the BulkActionItem table. This aligns with the bulk actions 2.0 implementation where the friendlyId field is being deprecated.

internal-packages/database/prisma/migrations/20250616084546_bulk_action_item_drop_friendly_id_unique_constraint/migration.sql (1)

1-2: LGTM! Safe index removal with best practices.

The migration uses DROP INDEX CONCURRENTLY IF EXISTS which is the correct approach for safely removing an index without blocking table operations. This prevents downtime and handles the case where the index might not exist.

internal-packages/run-engine/src/engine/types.ts (1)

149-149: LGTM! Proper type addition for bulk action support.

The optional bulkActionId?: string property is correctly added to the TriggerParams type. This enables bulk action tracking throughout the run lifecycle while maintaining backward compatibility.

apps/webapp/app/services/worker.server.ts (1)

247-248: LGTM! Clear deprecation markers for bulk action handlers.

The deprecation comments clearly indicate the migration path from the old bulk action handlers to the new bulk actions worker. This is good practice for maintaining system clarity during a transition period.

Also applies to: 257-258

apps/webapp/app/v3/services/bulk/createBulkAction.server.ts (1)

1-3: LGTM! Good import optimizations.

The type-only import for BulkActionType makes the intent clearer and the reorganization of imports improves readability.

.env.example (2)

16-18: LGTM! Important timezone configuration added.

Setting TZ="UTC" ensures consistent time handling across different environments and deployments, which is crucial for a system that manages task runs and timestamps.


83-83: LGTM! Fixed formatting issue.

Removed the trailing comma from the commented line to correct the formatting.

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

724-724: LGTM! Added bulk action group IDs support to replication.

The addition of bulk_action_group_ids with proper null handling ensures that bulk action associations are correctly synchronized to ClickHouse as part of the broader bulk action feature implementation.

apps/webapp/app/runEngine/services/triggerTask.server.ts (1)

312-312: LGTM! Added bulk action ID support to task triggering.

The addition of bulkActionId with proper optional chaining ensures that tasks triggered as part of bulk actions are correctly associated with their bulk action groups.

packages/core/src/v3/isomorphic/friendlyId.ts (1)

97-97: LGTM! Clean addition following established patterns.

The new BulkActionId constant follows the same pattern as other IdUtil instances and is properly positioned with the other entity ID utilities.

apps/webapp/app/v3/services/triggerTaskV1.server.ts (1)

446-448: LGTM! Clean implementation of bulk action tracking.

The conditional logic correctly handles the bulkActionId option and properly converts it to an array format for the database field. This aligns with the database schema changes for bulk action support.

internal-packages/database/prisma/migrations/20250708130212_task_run_add_bulk_action_group_ids/migration.sql (1)

1-2: LGTM! Clean database migration for bulk action support.

The migration correctly adds the bulkActionGroupIds column as a text array with an appropriate default value. The column type and default are suitable for tracking multiple bulk action group associations.

apps/webapp/test/runsRepository.test.ts (1)

1066-1066: LGTM! Test updated to reflect API parameter name change.

The test correctly updates the parameter name from runFriendlyIds to runIds while maintaining the same functionality and test expectations.

internal-packages/database/prisma/migrations/20250709131914_bulk_action_group_environment_id_created_at_index/migration.sql (1)

1-2: LGTM! Well-designed index for bulk action queries.

The index on environmentId and createdAt DESC is well-suited for filtering bulk actions by environment and displaying recent actions first. The use of CONCURRENTLY and IF NOT EXISTS follows best practices for production database migrations.

internal-packages/database/prisma/migrations/20250710105648_bulk_action_notification_type/migration.sql (1)

1-6: Migration looks good and follows best practices.

The migration correctly creates the enum type before adding the column, and uses a constant default value which is efficient in modern PostgreSQL versions. The enum values 'NONE' and 'EMAIL' are clear and appropriate for notification preferences.

packages/core/src/v3/schemas/api.ts (1)

137-137: Good addition for bulk action tracking.

The optional bulkActionId field is well-placed within the options schema and maintains backward compatibility. This will enable proper tracking of task runs associated with bulk actions.

apps/webapp/app/components/runs/v3/TaskRunStatus.tsx (1)

268-268: Good debugging addition.

Adding the console.error before assertNever is helpful for debugging unexpected status values. This will provide valuable information when investigating any status-related issues without affecting the existing error handling flow.

apps/webapp/app/routes/storybook.badges/route.tsx (1)

7-7: Badge variant update aligns with component changes.

The change to use the "rounded" variant instead of the previous "small" and "outline" variants correctly reflects the updates to the Badge component API. The storybook now demonstrates the available variants accurately.

apps/webapp/app/components/primitives/Tooltip.tsx (2)

64-64: Clean enhancement for tooltip trigger styling.

The addition of the optional buttonStyle prop is well-implemented and maintains backward compatibility. The type definition using React.CSSProperties is appropriate for inline styling.

Also applies to: 76-76


83-88: Proper implementation of style prop.

The style attribute is correctly applied to the TooltipTrigger element, allowing for flexible inline styling of the trigger button. The integration with existing props like className and asChild is handled properly.

apps/webapp/app/components/primitives/Badge.tsx (1)

11-12: Badge variants removal verified – no usages of “small” or “outline” found

No occurrences of <Badge variant="small"> or <Badge variant="outline"> remain in the codebase. It’s safe to remove these variants.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx (2)

99-99: LGTM! Enhanced UX with copyable run ID.

The addition of the CopyableText import enables users to easily copy the run ID, which is particularly useful for bulk actions and run management workflows.


203-203: LGTM! Improved user interaction with copyable run ID.

Replacing the plain text with CopyableText component enhances the user experience by making the run's friendly ID easily copyable. This is especially valuable when working with bulk actions or referencing specific runs.

apps/webapp/app/components/primitives/Switch.tsx (1)

36-47: LGTM! Well-implemented secondary variant for small switches.

The new "secondary/small" variant properly extends the base small styling with appropriate border, background, and text modifications. The implementation follows the established patterns and uses the cn utility function correctly for class composition.

apps/webapp/app/v3/services/replayTaskRun.server.ts (2)

19-19: LGTM! Proper extension of OverrideOptions for bulk action support.

The addition of the optional bulkActionId property follows the established pattern for the type and enables bulk action tracking during replay operations.


111-111: LGTM! Correct propagation of bulkActionId through service call.

The bulkActionId is properly passed through to the TriggerTaskService.call method, enabling bulk action tracking during task run replay operations.

apps/webapp/app/env.server.ts (2)

2-2: LGTM! Improved import organization.

Moving the BoolEnv import to be first after zod improves code organization and consistency.


973-975: LGTM! Well-configured bulk action environment variables.

The new environment variables for bulk action processing are properly configured:

  • BULK_ACTION_BATCH_SIZE with default 100 items per batch
  • BULK_ACTION_BATCH_DELAY_MS with default 200ms delay between batches

These defaults provide reasonable performance characteristics for bulk operations while preventing system overload.

apps/webapp/tailwind.config.js (1)

170-170: LGTM! Clean addition of bulk actions color.

The new bulkActions color variable follows the established pattern and uses a distinct emerald shade that differentiates it from other feature colors.

Also applies to: 246-246

apps/webapp/app/components/navigation/SideMenu.tsx (2)

52-52: LGTM! Proper imports for bulk actions navigation.

The imports follow the established pattern and support the new bulk actions navigation item.

Also applies to: 91-91


276-282: LGTM! Bulk actions navigation item correctly implemented.

The new navigation item follows the established pattern with proper icon, color, and path configuration consistent with other menu items.

internal-packages/clickhouse/src/taskRuns.ts (1)

110-119: LGTM! Well-implemented count query builder.

The new function follows the established pattern with proper Zod schema validation and correct usage of the FINAL modifier for ClickHouse queries.

internal-packages/emails/emails/components/styles.ts (1)

32-35: LGTM! Good refactoring to extract common style values.

The new sans and grey style constants improve code reusability by extracting commonly used font family and color values that are already present throughout the file.

Also applies to: 74-76

apps/webapp/app/components/primitives/Select.tsx (3)

31-35: LGTM: New secondary style variant follows established patterns.

The new secondary style variant is well-implemented with appropriate Tailwind classes for background, border, and hover states, consistent with existing style definitions.


38-40: LGTM: Proper composition of size and style variants.

The new "secondary/small" variant correctly combines the small size with the secondary style using the cn utility function, following the established pattern used by other variants.


605-605: LGTM: Simplified render prop handling.

The change from wrapping the render prop in a Fragment to passing it directly to Ariakit.SelectHeading is a clean simplification that maintains the same functionality.

internal-packages/clickhouse/src/index.ts (3)

13-13: LGTM: Proper import addition for count query builder.

The import of getTaskRunsCountQueryBuilder is correctly placed alongside other taskRuns-related imports, maintaining consistency with the existing import organization.


20-20: LGTM: Consistent type export pattern.

The export of queryBuilder types follows the established pattern used for other type exports in the file.


149-149: LGTM: Count query builder properly integrated.

The countQueryBuilder property is correctly added to the taskRuns getter, using the same pattern as other query builders. This provides efficient counting functionality for the bulk actions feature.

apps/webapp/app/v3/services/finalizeTaskRun.server.ts (3)

32-32: LGTM: Proper type definition for bulk action integration.

The addition of optional bulkActionId parameter to the BaseInput type is correctly typed and maintains backward compatibility.


53-53: LGTM: Method signature correctly updated.

The bulkActionId parameter is properly added to the method signature, maintaining consistency with the type definition.


103-113: LGTM: Proper Prisma array update implementation.

The conditional logic correctly uses Prisma's push operation to add the bulkActionId to the bulkActionGroupIds array when provided, while leaving the field unchanged when not provided. This follows Prisma's recommended patterns for array updates.

apps/webapp/app/components/BlankStatePanels.tsx (2)

14-19: LGTM: Well-organized imports for new bulk actions functionality.

The imports are properly organized and include all necessary dependencies for the new BulkActionsNone component, including icons, images, hooks, and path utilities.

Also applies to: 21-21, 25-25, 29-29


576-627: LGTM: Well-structured bulk actions onboarding component.

The BulkActionsNone component follows established patterns in the file:

  • Correctly uses context hooks to get organization, project, and environment
  • Provides clear step-by-step instructions with accompanying images
  • Uses proper path builder function for navigation
  • Maintains consistent styling and component structure with other blank state panels
  • Includes appropriate visual hierarchy with numbered steps and content containers

The component provides a good user experience for onboarding users to the bulk actions feature.

apps/webapp/app/v3/services/baseService.server.ts (2)

2-2: LGTM: Proper import of replica client.

The import correctly includes the $replica client alongside the existing database imports, following the established import patterns.


8-11: LGTM: Well-implemented read replica support.

The constructor update properly adds read replica support:

  • Both _prisma and _replica parameters have appropriate defaults
  • Parameters are correctly typed as PrismaClientOrTransaction
  • Both are marked as protected readonly for use by subclasses
  • This enables services to separate read and write operations for better scalability

The implementation follows established dependency injection patterns in the service layer.

internal-packages/emails/src/index.tsx (3)

19-21: LGTM: Import follows established pattern.

The import of BulkActionCompletedEmail and its schema is consistent with other email type imports in the file.


38-38: LGTM: Schema union addition is correct.

The BulkActionCompletedEmailSchema is properly added to the discriminated union, maintaining type safety.


141-146: LGTM: Email template case implementation is correct.

The new case follows the established pattern with appropriate subject line and component rendering.

apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx (7)

78-78: LGTM: Improved clear button with tooltip.

The simplified button with tooltip provides better UX by clearly indicating the action without cluttering the interface.


110-110: LGTM: Consistent variant usage.

The change from "minimal/small" to "secondary/small" improves visual consistency across filter components.


286-286: LGTM: Icon addition improves visual hierarchy.

The StatusIcon with size-3.5 provides better visual identification of the filter type, and the "secondary/small" variant maintains consistency.

Also applies to: 291-291


412-412: LGTM: Consistent icon and variant updates.

The TagIcon addition and variant change maintain visual consistency with other applied filters.

Also applies to: 415-415


532-532: LGTM: Consistent icon and variant updates.

The FingerPrintIcon addition and variant change maintain visual consistency with other applied filters.

Also applies to: 535-535


601-601: LGTM: Placeholder text cleared appropriately.

Removing the placeholder text allows for more flexible input without suggesting a specific format.


650-650: LGTM: Consistent icon and variant updates.

The ListChecks icon addition and variant change maintain visual consistency with other applied filters.

Also applies to: 653-653

apps/webapp/app/presenters/v3/ViewSchedulePresenter.server.ts (5)

4-4: LGTM: ClickHouse client import added.

The import is necessary for the migration to the new NextRunListPresenter.


6-6: LGTM: Updated to NextRunListPresenter.

The migration from the legacy RunListPresenter to NextRunListPresenter aligns with the PR objectives for ClickHouse integration.


38-38: LGTM: OrganizationId added to query.

The organizationId field is required for the new NextRunListPresenter interface.


80-82: LGTM: Defensive programming with ClickHouse availability check.

The check ensures the system fails gracefully when ClickHouse is not available.


84-90: LGTM: Updated presenter instantiation and call.

The NextRunListPresenter constructor now correctly receives both Prisma and ClickHouse clients, and the call method properly passes the organizationId and period parameters.

apps/webapp/app/components/primitives/TruncatedCopyableValue.tsx (1)

5-26: LGTM: Well-designed reusable component.

The TruncatedCopyableValue component provides a clean abstraction for displaying truncated values with copy functionality. The implementation is solid:

  • Proper TypeScript typing with optional props
  • Sensible default for truncation length (8 characters)
  • Good UX with full value shown on hover
  • Consistent styling with existing design system
  • Proper use of slice(-length) to show trailing characters
apps/webapp/app/presenters/v3/BulkActionPresenter.server.ts (2)

12-48: LGTM: Standard presenter implementation with proper error handling.

The BulkActionPresenter follows established patterns:

  • Extends BasePresenter correctly
  • Uses replica database for read operations
  • Comprehensive field selection
  • Proper error handling when bulk action not found

60-68: LGTM: Clean data transformation and return.

The return object properly combines all necessary data with appropriate transformations:

  • User data formatted with getUsername helper
  • Safe fallback for missing user
  • Proper filter data handling with fallback to empty object
internal-packages/database/prisma/migrations/20250623141255_bulk_action_group_counts_completed_at/migration.sql (1)

1-18: Migration structure follows PostgreSQL best practices.

The migration correctly uses ALTER TYPE to add the new enum value and ALTER TABLE to modify the schema. The constant default values (DEFAULT 0) for the new integer columns won't require a table rewrite in modern PostgreSQL versions.

internal-packages/database/prisma/migrations/20250616083614_bulk_action_v2/migration.sql (1)

1-36: Excellent idempotent migration design.

The migration uses IF NOT EXISTS for column additions and proper procedural checks for foreign key constraints. The cascade behaviors are appropriate: CASCADE for environment deletion and SET NULL for user deletion, which maintains data integrity while handling referential constraints correctly.

apps/webapp/app/presenters/v3/CreateBulkActionPresenter.server.ts (1)

33-33: Confirm Prisma Replica Implementation Type

_replica is declared as PrismaClientOrTransaction and is initialized from $replica (a PrismaReplicaClient). Ensure that PrismaReplicaClient always extends PrismaClient; if so, the cast to PrismaClient is safe. Otherwise, introduce a runtime type guard or adjust the presenter’s signature.

• Verify the definition of PrismaReplicaClient in internal-packages/database/src/transaction.ts to confirm it inherits from PrismaClient.
• If it does not, replace the assertion with a type guard or update the presenter’s field type to PrismaClientOrTransaction.

apps/webapp/app/v3/commonWorker.server.ts (2)

193-201: Appropriate worker configuration for bulk actions.

The configuration uses reasonable timeouts (3 minutes) and retry attempts (5) for bulk operations. The schema validation ensures type safety for the job payload.


281-284: Clean job handler implementation.

The handler follows the established pattern of instantiating the service and calling the appropriate method. The async/await usage is correct.

apps/webapp/app/components/runs/v3/BatchFilters.tsx (4)

2-8: LGTM! Clean import additions for UI enhancements.

The new icon imports follow the established patterns and are properly used throughout the component.

Also applies to: 46-46


81-81: Good UI consistency improvements.

The variant changes from minimal/small to secondary/small and the more descriptive tooltip enhance the user experience and align with the design system updates.

Also applies to: 115-115, 117-117


284-284: Excellent icon consistency and variant alignment.

The addition of semantically appropriate icons (StatusIcon for status filters, Squares2X2Icon for batch ID filters) with consistent sizing and the secondary/small variant improves the visual hierarchy and user experience.

Also applies to: 289-289, 406-406, 409-409


98-98: Consistent icon implementation for filter types.

The Squares2X2Icon addition follows the established pattern and maintains visual consistency across filter types.

apps/webapp/app/components/primitives/AppliedFilter.tsx (3)

6-9: Well-structured variant system with clear naming.

The new secondary/small variant provides a distinct visual style with proper hover states, and the minimal/small to minimal/medium rename better reflects the actual sizing.

Also applies to: 14-17


2-2: Proper icon prop implementation with sensible defaults.

The optional icon prop is well-typed as ReactNode and the default variant change to secondary/small aligns with the UI consistency improvements.

Also applies to: 23-23, 33-33, 38-38


51-61: Improved component structure with better visual hierarchy.

The updated layout properly accommodates the icon with appropriate flex alignment, and the text color changes (bright label, dimmed value) enhance the visual hierarchy and readability.

apps/webapp/app/v3/services/cancelTaskRunV1.server.ts (4)

13-13: Correct import addition for type safety.

The CancelableTaskRun import is properly added to support the enhanced type safety in the method signature.


32-32: Appropriate optional field addition for bulk action tracking.

The optional bulkActionId field properly extends the service options to support bulk action association tracking.


36-36: Enhanced type safety with more specific parameter type.

The change from TaskRun to CancelableTaskRun improves type safety by requiring only the necessary fields for the cancellation operation.


51-61: Robust bulk action tracking implementation.

The logic correctly handles bulk action association even when cancellation is not possible, using proper Prisma array operations and ensuring consistent tracking through the finalize service.

Also applies to: 71-71

apps/webapp/app/presenters/v3/WaitpointPresenter.server.ts (3)

2-2: Correct imports for ClickHouse migration.

The import changes properly support the migration from Postgres-based to ClickHouse-based run listing with the appropriate client and presenter imports.

Also applies to: 6-6


51-51: Necessary updates for new presenter requirements.

The organizationId addition and type change to NextRunListItem[] properly support the enhanced presenter functionality and organization-level context.

Also applies to: 79-79


82-84: Robust ClickHouse integration with proper error handling.

The availability check for clickhouseClient provides graceful failure handling, and the presenter instantiation correctly passes both required clients with appropriate parameters including the new period parameter.

Also applies to: 86-96

apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts (4)

102-102: Enhanced bulk action queries with better data and filtering.

The addition of the name field supports UI display requirements, and the environmentId filter improves query specificity and proper scoping.

Also applies to: 106-106


120-139: Excellent edge case handling for bulk action availability.

The logic to fetch a specific bulk action when it's not in the recent ones ensures the filtering functionality works correctly even for older bulk actions, with proper scoping.


164-164: Simplified parameter handling with enhanced filtering.

The change from periodMs to period simplifies the parameter passing, and the bulkId parameter addition enables direct bulk action filtering at the repository level.

Also applies to: 171-171


246-246: Proper response mapping with fallback handling.

The inclusion of the name field with fallback to friendlyId ensures consistent data availability for UI components while gracefully handling null values.

apps/webapp/app/components/primitives/RadioButton.tsx (1)

25-25: LGTM! Consistent styling updates for radio buttons.

The changes update the radio button components to use a consistent indigo color scheme for checked states and improve visual feedback with hover states. The size adjustments (size-1.5 to size-2) enhance visibility.

Also applies to: 41-42, 80-80, 85-85, 134-134, 138-139

apps/webapp/app/presenters/v3/BulkActionListPresenter.server.ts (1)

1-62: Well-structured bulk action list presenter.

The implementation follows the established presenter pattern with proper pagination, filtering by environment, and consistent user data formatting.

apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts (1)

10-10: Correct migration to NextRunListPresenter with ClickHouse support.

The changes properly integrate organization context and ClickHouse client requirements. The validation ensures both organization and environment are present before proceeding.

Also applies to: 13-13, 15-15, 140-141, 145-146, 158-159, 166-169, 216-221, 224-224

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx (1)

1-105: Well-implemented SSE endpoint for bulk action progress streaming.

The implementation correctly handles user authorization, progress updates, and stream lifecycle. The reuse of DEV_PRESENCE_* configuration for timeout and polling intervals is pragmatic.

apps/webapp/app/utils/pathBuilder.ts (1)

170-186: Clean path builder additions for bulk action support.

The new path builders follow established patterns, and the renamed v3CreateBulkActionPath better reflects its purpose with enhanced parameter support for bulk action creation flows.

Also applies to: 257-275

internal-packages/run-engine/src/engine/systems/runAttemptSystem.ts (3)

958-976: LGTM: Well-designed bulk action integration.

The method signature changes cleanly integrate bulk action support while maintaining backward compatibility through optional parameters. The extended return type with alreadyFinished provides valuable information for callers to handle different cancellation scenarios appropriately.


986-999: LGTM: Correct handling of already finished runs.

The implementation properly handles the case where a run is already finished by:

  1. Conditionally updating bulkActionGroupIds when bulkActionId is provided
  2. Returning alreadyFinished: true to indicate the run state
  3. Using the existing snapshot data via executionResultFromSnapshot

This approach ensures bulk action tracking is maintained even for runs that were already completed.


1027-1031: LGTM: Proper bulk action tracking during cancellation.

The conditional update of bulkActionGroupIds during the run status update to "CANCELED" is implemented correctly. Using Prisma's push operation ensures the bulkActionId is appended to the existing array without overwriting other bulk action associations.

apps/webapp/app/hooks/useSearchParam.ts (3)

13-18: LGTM: Improved stateless design.

The refactoring eliminates internal mutable state by creating fresh URLSearchParams instances on each callback invocation. This makes the hook more predictable and reduces potential bugs from shared mutable state. The dependency array correctly includes only location and navigate.


56-62: LGTM: Useful addition of parameter existence check.

The new has method provides a clean way to check for parameter existence without retrieving the value. This is a valuable utility function that complements the existing API.


73-93: LGTM: Well-designed pure helper function.

The extraction of the set logic into a pure helper function is excellent. It:

  1. Centralizes parameter update logic
  2. Handles undefined values by deleting parameters
  3. Properly handles both string and array values
  4. Returns a new URLSearchParams instance, maintaining immutability

This approach aligns with functional programming principles and makes the code more maintainable.

internal-packages/run-engine/src/engine/index.ts (3)

392-393: LGTM: Clean integration of bulk action support.

The addition of the optional bulkActionId parameter to TriggerParams enables bulk action tracking from run creation while maintaining backward compatibility.


467-467: LGTM: Efficient bulk action group initialization.

The conditional initialization of bulkActionGroupIds only when bulkActionId is provided is efficient and avoids creating unnecessary empty arrays. This aligns with the database schema design where the field can be undefined.


699-728: LGTM: Consistent method signature updates.

The cancelRun method signature changes are consistent with the RunAttemptSystem.cancelRun modifications:

  1. Optional bulkActionId parameter added
  2. Return type extended to include alreadyFinished boolean
  3. Parameters properly passed through to the underlying system

The changes maintain the method's contract while enabling bulk action functionality.

apps/webapp/app/components/runs/v3/TaskRunsTable.tsx (3)

21-29: LGTM! Good migration to the new data model.

The import changes and type updates align with the broader migration from RunListPresenter to NextRunListPresenter using ClickHouse for run data querying.


95-104: Good update to use friendlyId consistently for run identification.

The migration to use friendlyId throughout the selection logic aligns with the new run identification approach in the updated presenters and repositories.

Also applies to: 120-121, 299-301, 310-310


411-411: Type update is consistent with the migration.

The RunActionsCell component correctly accepts the new NextRunListItem type.

apps/webapp/app/components/BulkActionFilterSummary.tsx (2)

19-22: Good use of Zod for type safety.

Using Zod schemas for BulkActionMode and BulkActionAction provides runtime type validation and a single source of truth for these types.


69-208: Excellent exhaustive filter handling with proper type checking.

The comprehensive handling of all filter types with assertNever ensures that any new filter types added in the future will cause a compile-time error, preventing bugs.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions/route.tsx (3)

62-101: Well-structured loader with proper error handling.

The loader correctly authenticates the user, validates parameters, and handles errors gracefully with appropriate HTTP responses.


136-183: Clean component structure with good UX patterns.

The conditional rendering of blank state vs. table, combined with the resizable panel for the inspector, provides an intuitive interface for managing bulk actions.


188-297: Comprehensive table implementation with helpful tooltips.

The table provides clear information about bulk actions with status tooltips that explain what each status means, enhancing user understanding.

apps/webapp/app/components/ListPagination.tsx (2)

18-30: Good UI improvements to pagination controls.

The addition of the visual divider with peer hover effects creates a more cohesive button group appearance. The opacity change when both buttons are disabled provides clear visual feedback.


38-52: Consistent button styling with improved visual connection.

The updated button variants and border styling create a visually connected pagination control that aligns with modern UI patterns.

Also applies to: 60-73

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx (4)

46-83: Well-structured loader with consistent error handling.

The loader follows the same pattern as other routes with proper authentication, parameter validation, and error handling.


85-130: Robust action handler with good error handling.

The abort functionality includes proper error logging and user-friendly error messages via redirects.


140-156: Efficient real-time updates with event streaming.

The implementation correctly subscribes to progress events only when the bulk action is pending and triggers revalidation to refresh the UI with updated data.


293-336: Excellent visual progress indicator with smooth animations.

The Meter component provides clear visual feedback with animated progress bars and contextual text based on the bulk action type.

apps/webapp/app/components/primitives/Pagination.tsx (1)

49-90: Excellent compact pagination UI implementation!

The new design with connected buttons and dynamic separator is clean and intuitive. The use of peer selectors for hover states and proper disabled state handling shows attention to detail.

internal-packages/emails/emails/bulk-action-complete.tsx (1)

1-134: Well-structured email component with proper validation

The email component is cleanly implemented with:

  • Proper Zod schema validation
  • Good preview defaults for development
  • Clear layout with all relevant bulk action details
  • Helpful Property component for consistent formatting
  • Correct past tense conversion for action types
apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx (2)

76-190: Well-structured bulk action creation with robust validation

The server-side implementation is excellent:

  • Proper authentication and authorization checks
  • Clean presenter pattern for data fetching
  • Comprehensive Zod validation schemas
  • Good error handling with detailed logging
  • Appropriate success/error redirects

192-459: Feature-rich bulk action creation UI

The component provides an excellent user experience with:

  • Clear instructions accordion for first-time users
  • Intuitive mode selection (filter vs selected runs)
  • Visual preview of the bulk action impact
  • Confirmation dialog to prevent accidental actions
  • Optional email notification on completion
  • Proper keyboard shortcuts (Cmd+Enter) for power users
apps/webapp/app/v3/services/cancelTaskRun.server.ts (2)

9-14: Clean integration of bulk action tracking

The additions properly support bulk action functionality:

  • bulkActionId option enables tracking cancellations by bulk action
  • alreadyFinished result flag helps bulk action processing handle race conditions
  • CancelableTaskRun type reduces coupling by only requiring necessary fields

Also applies to: 16-25


38-53: Consistent implementation across engine versions

Both V1 and V2 implementations correctly:

  • Accept the new CancelableTaskRun type
  • Handle the result properly with null checks in V1
  • Pass through bulkActionId to the engine in V2
  • Return the alreadyFinished status appropriately

Also applies to: 55-71

apps/webapp/app/components/runs/v3/BulkAction.tsx (1)

1-77: Well-structured refactoring of bulk action components.

The separation of type and status components improves modularity and reusability. The addition of optional className props provides good flexibility for styling.

apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts (1)

24-387: Well-architected bulk action service implementation.

The service provides a robust implementation with:

  • Proper separation of creation, processing, and aborting logic
  • Batch processing with configurable parameters
  • Comprehensive error handling with try-catch blocks
  • Email notification support
  • Proper status management and progress tracking
apps/webapp/app/components/runs/v3/SharedFilters.tsx (1)

104-410: Excellent improvements to time filter functionality and form handling.

The changes enhance the component with:

  • Rich metadata for time filters improving UI consistency
  • Proper form submission prevention with explicit button types
  • Clean state management when switching between filter types
  • Useful utility function export for date parsing
apps/webapp/app/services/runsRepository.server.ts (1)

19-49: Excellent use of Zod for input validation.

The schema provides strong type safety and runtime validation for the various filter options.

internal-packages/database/prisma/schema.prisma (1)

976-2041: Well-designed schema for bulk action v2 system.

The schema changes provide:

  • Comprehensive BulkActionGroup model with query support
  • Proper relationships and indexes for performance
  • Clear deprecation marking for legacy fields
  • Support for both query-based and direct run ID bulk actions
  • Email notification configuration
apps/webapp/app/components/runs/v3/RunFilters.tsx (6)

63-77: Well-structured preprocessing schema!

The StringOrStringArray schema elegantly handles the uniform preprocessing of string or string array inputs, properly filtering out empty values. This is a great refactoring that reduces code duplication across multiple filter fields.


114-177: Excellent helper functions for filter metadata!

The filterTitle and filterIcon functions provide a centralized way to manage human-readable titles and consistent iconography for filter keys. This improves maintainability and UI consistency.


179-214: Robust URL parameter parsing!

The getRunFiltersFromSearchParams function properly handles:

  • Filtering empty string values before assignment
  • URL decoding for tags (line 197)
  • Safe parsing with validation
  • Graceful fallback to empty object on parse failure

This ensures clean and validated filter objects from URL parameters.


626-641: Great UI improvement for bulk action items!

The enhanced bulk action dropdown now displays:

  • The action name prominently
  • Action type with appropriate styling
  • Creation timestamp
  • Proper layout with adequate spacing

This makes it much easier for users to identify and select specific bulk actions.


251-251: Consistent UI refinements throughout!

The systematic updates to use:

  • XMarkIcon instead of trash icon for clarity
  • secondary/small variant for all filter-related buttons and switches
  • filterIcon() helper for consistent iconography in applied filters

These changes create a more cohesive and polished user interface.

Also applies to: 286-286, 471-474, 559-568, 668-672, 792-795, 822-822, 939-942, 1059-1062, 1179-1182


707-708: Proper handling of empty tag values!

Filtering out empty strings from tag values before using them as controlled values prevents UI issues and ensures clean data flow.

Also applies to: 736-736

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx (3)

114-174: Clean refactoring with improved component separation.

The extraction of the runs list logic into a dedicated RunsList component improves code organization and maintainability.


194-214: Well-implemented keyboard shortcuts for bulk actions.

The keyboard shortcuts for replay ("r") and cancel ("c") provide an efficient way for power users to access bulk actions. The implementation correctly handles both scenarios with and without selected items.


293-304: Excellent implementation of resizable panels for bulk actions.

The resizable panel setup provides great UX with sensible size constraints (min: 300px, default: 400px, max: 600px) that ensure the inspector remains usable while allowing user customization.

Comment on lines +17 to +21
const totalCount = await this._replica.bulkActionGroup.count({
where: {
environmentId,
},
});
Copy link
Collaborator

@nicktrn nicktrn Jul 11, 2025

Choose a reason for hiding this comment

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

I wonder if this is still covered by this composite index: @@index([environmentId, createdAt(sort: Desc)])

(needs to be tested once deployed with a larger table)

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 yep we should test this, locally it will always do a sequential scan

Comment on lines +35 to +37
if (!clickhouseClient) {
throw new Error("Clickhouse client not found");
}
Copy link
Collaborator

@nicktrn nicktrn Jul 11, 2025

Choose a reason for hiding this comment

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

There's a few of these dotted around everywhere. Maybe this would be a good time to make env.CLICKHOUSE_URL required, we can then remove all these checks.

Copy link
Member Author

Choose a reason for hiding this comment

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

The only downside is it means each of our services would have to define the env var then.

Otherwise I think it makes sense, because it is definitely required after this PR

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

♻️ Duplicate comments (1)
apps/webapp/app/services/runsRepository.server.ts (1)

172-174: Consider the performance implications of in-memory status filtering.

While this workaround addresses ClickHouse data delays, filtering large result sets in memory could impact performance. Consider implementing a more scalable solution such as:

  • Adding a small delay before querying to allow ClickHouse to catch up
  • Implementing a secondary verification query
  • Using ClickHouse's eventual consistency features if available
🧹 Nitpick comments (4)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx (1)

226-290: Remove unnecessary Fragment wrapper

The Fragment wrapper is redundant since it contains only one child element.

-          <>
             {list.runs.length === 0 && !list.hasAnyRuns ? (
               list.possibleTasks.length === 0 ? (
                 <CreateFirstTaskInstructions />
               ) : (
                 <RunTaskInstructions />
               )
             ) : (
               <div className={cn("grid h-full max-h-full grid-rows-[auto_1fr] overflow-hidden")}>
                 <div className="flex items-start justify-between gap-x-2 p-2">
                   <RunsFilters
                     possibleTasks={list.possibleTasks}
                     bulkActions={list.bulkActions}
                     hasFilters={list.hasFilters}
                     rootOnlyDefault={rootOnlyDefault}
                   />
                   <div className="flex items-center justify-end gap-x-2">
                     {!isShowingBulkActionInspector && (
                       <LinkButton
                         variant="secondary/small"
                         to={v3CreateBulkActionPath(
                           organization,
                           project,
                           environment,
                           filters,
                           selectedItems.size > 0 ? "selected" : undefined
                         )}
                         LeadingIcon={ListCheckedIcon}
                         className={selectedItems.size > 0 ? "pr-1" : undefined}
                         tooltip={
                           <div className="-mr-1 flex items-center gap-3 text-xs text-text-dimmed">
                             <div className="flex items-center gap-0.5">
                               <span>Replay</span>
                               <ShortcutKey shortcut={{ key: "r" }} variant={"small"} />
                             </div>
                             <div className="flex items-center gap-0.5">
                               <span>Cancel</span>
                               <ShortcutKey shortcut={{ key: "c" }} variant={"small"} />
                             </div>
                           </div>
                         }
                       >
                         <span className="flex items-center gap-x-1 whitespace-nowrap text-text-bright">
                           <span>Bulk action</span>
                           {selectedItems.size > 0 && (
                             <Badge variant="rounded">{selectedItems.size}</Badge>
                           )}
                         </span>
                       </LinkButton>
                     )}
                     <ListPagination list={list} />
                   </div>
                 </div>

                 <TaskRunsTable
                   total={list.runs.length}
                   hasFilters={list.hasFilters}
                   filters={list.filters}
                   runs={list.runs}
                   isLoading={isLoading}
                   allowSelection
                 />
               </div>
             )}
-          </>
apps/webapp/app/services/runsRepository.server.ts (3)

222-222: Use optional chaining for safer property access

-    if (options.batchId && options.batchId.startsWith("batch_")) {
+    if (options.batchId?.startsWith("batch_")) {

239-239: Use optional chaining for safer property access

-    if (options.scheduleId && options.scheduleId.startsWith("sched_")) {
+    if (options.scheduleId?.startsWith("sched_")) {

255-255: Use optional chaining for safer property access

-    if (options.bulkId && options.bulkId.startsWith("bulk_")) {
+    if (options.bulkId?.startsWith("bulk_")) {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bc197fb and 0413dab.

⛔ Files ignored due to path filters (3)
  • apps/webapp/app/assets/images/open-bulk-actions-panel.png is excluded by !**/*.png
  • apps/webapp/app/assets/images/select-runs-individually.png is excluded by !**/*.png
  • apps/webapp/app/assets/images/select-runs-using-filters.png is excluded by !**/*.png
📒 Files selected for processing (80)
  • .env.example (2 hunks)
  • apps/webapp/app/assets/icons/ListCheckedIcon.tsx (1 hunks)
  • apps/webapp/app/components/BlankStatePanels.tsx (2 hunks)
  • apps/webapp/app/components/BulkActionFilterSummary.tsx (1 hunks)
  • apps/webapp/app/components/ListPagination.tsx (1 hunks)
  • apps/webapp/app/components/navigation/SideMenu.tsx (3 hunks)
  • apps/webapp/app/components/primitives/Accordion.tsx (2 hunks)
  • apps/webapp/app/components/primitives/AppliedFilter.tsx (3 hunks)
  • apps/webapp/app/components/primitives/Badge.tsx (1 hunks)
  • apps/webapp/app/components/primitives/Pagination.tsx (1 hunks)
  • apps/webapp/app/components/primitives/RadioButton.tsx (4 hunks)
  • apps/webapp/app/components/primitives/Select.tsx (2 hunks)
  • apps/webapp/app/components/primitives/Switch.tsx (1 hunks)
  • apps/webapp/app/components/primitives/Tooltip.tsx (2 hunks)
  • apps/webapp/app/components/primitives/TruncatedCopyableValue.tsx (1 hunks)
  • apps/webapp/app/components/runs/v3/BatchFilters.tsx (6 hunks)
  • apps/webapp/app/components/runs/v3/BulkAction.tsx (2 hunks)
  • apps/webapp/app/components/runs/v3/RunFilters.tsx (23 hunks)
  • apps/webapp/app/components/runs/v3/SharedFilters.tsx (11 hunks)
  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx (1 hunks)
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx (8 hunks)
  • apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx (7 hunks)
  • apps/webapp/app/env.server.ts (2 hunks)
  • apps/webapp/app/hooks/useSearchParam.ts (2 hunks)
  • apps/webapp/app/presenters/RunFilters.server.ts (1 hunks)
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts (4 hunks)
  • apps/webapp/app/presenters/v3/BulkActionListPresenter.server.ts (1 hunks)
  • apps/webapp/app/presenters/v3/BulkActionPresenter.server.ts (1 hunks)
  • apps/webapp/app/presenters/v3/CreateBulkActionPresenter.server.ts (1 hunks)
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts (4 hunks)
  • apps/webapp/app/presenters/v3/RunListPresenter.server.ts (0 hunks)
  • apps/webapp/app/presenters/v3/ViewSchedulePresenter.server.ts (3 hunks)
  • apps/webapp/app/presenters/v3/WaitpointPresenter.server.ts (3 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions/route.tsx (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.next.runs._index/route.tsx (0 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.next.runs/route.tsx (0 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx (2 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx (5 hunks)
  • apps/webapp/app/routes/account.tokens/route.tsx (0 hunks)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx (1 hunks)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx (1 hunks)
  • apps/webapp/app/routes/resources.taskruns.bulk.cancel.ts (0 hunks)
  • apps/webapp/app/routes/resources.taskruns.bulk.replay.ts (0 hunks)
  • apps/webapp/app/routes/storybook.badges/route.tsx (1 hunks)
  • apps/webapp/app/runEngine/services/triggerTask.server.ts (1 hunks)
  • apps/webapp/app/services/runsReplicationService.server.ts (2 hunks)
  • apps/webapp/app/services/runsRepository.server.ts (6 hunks)
  • apps/webapp/app/services/worker.server.ts (2 hunks)
  • apps/webapp/app/utils/pathBuilder.ts (2 hunks)
  • apps/webapp/app/utils/searchParams.ts (1 hunks)
  • apps/webapp/app/v3/commonWorker.server.ts (3 hunks)
  • apps/webapp/app/v3/services/baseService.server.ts (1 hunks)
  • apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts (1 hunks)
  • apps/webapp/app/v3/services/bulk/createBulkAction.server.ts (1 hunks)
  • apps/webapp/app/v3/services/cancelTaskRun.server.ts (2 hunks)
  • apps/webapp/app/v3/services/cancelTaskRunV1.server.ts (4 hunks)
  • apps/webapp/app/v3/services/finalizeTaskRun.server.ts (3 hunks)
  • apps/webapp/app/v3/services/replayTaskRun.server.ts (2 hunks)
  • apps/webapp/app/v3/services/triggerTaskV1.server.ts (1 hunks)
  • apps/webapp/tailwind.config.js (2 hunks)
  • apps/webapp/test/runsRepository.test.ts (1 hunks)
  • internal-packages/clickhouse/src/index.ts (2 hunks)
  • internal-packages/clickhouse/src/taskRuns.ts (1 hunks)
  • internal-packages/database/prisma/migrations/20250616083614_bulk_action_v2/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250616084546_bulk_action_item_drop_friendly_id_unique_constraint/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250616084735_bulk_action_item_friendly_id_optional/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250623141255_bulk_action_group_counts_completed_at/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250708130212_task_run_add_bulk_action_group_ids/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250709131914_bulk_action_group_environment_id_created_at_index/migration.sql (1 hunks)
  • internal-packages/database/prisma/migrations/20250710105648_bulk_action_notification_type/migration.sql (1 hunks)
  • internal-packages/database/prisma/schema.prisma (5 hunks)
  • internal-packages/emails/emails/bulk-action-complete.tsx (1 hunks)
  • internal-packages/emails/emails/components/styles.ts (2 hunks)
  • internal-packages/emails/src/index.tsx (3 hunks)
  • internal-packages/run-engine/src/engine/index.ts (4 hunks)
  • internal-packages/run-engine/src/engine/systems/runAttemptSystem.ts (7 hunks)
  • internal-packages/run-engine/src/engine/types.ts (1 hunks)
  • packages/core/src/v3/isomorphic/friendlyId.ts (1 hunks)
  • packages/core/src/v3/schemas/api.ts (1 hunks)
💤 Files with no reviewable changes (6)
  • apps/webapp/app/routes/account.tokens/route.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.next.runs/route.tsx
  • apps/webapp/app/routes/resources.taskruns.bulk.cancel.ts
  • apps/webapp/app/routes/resources.taskruns.bulk.replay.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.next.runs._index/route.tsx
  • apps/webapp/app/presenters/v3/RunListPresenter.server.ts
✅ Files skipped from review due to trivial changes (1)
  • apps/webapp/app/components/runs/v3/WaitpointTokenFilters.tsx
🚧 Files skipped from review as they are similar to previous changes (69)
  • internal-packages/database/prisma/migrations/20250616084735_bulk_action_item_friendly_id_optional/migration.sql
  • apps/webapp/app/routes/storybook.badges/route.tsx
  • apps/webapp/app/v3/services/bulk/createBulkAction.server.ts
  • .env.example
  • apps/webapp/app/services/worker.server.ts
  • apps/webapp/app/components/primitives/Tooltip.tsx
  • apps/webapp/app/components/primitives/Badge.tsx
  • apps/webapp/test/runsRepository.test.ts
  • apps/webapp/app/utils/searchParams.ts
  • apps/webapp/app/v3/services/triggerTaskV1.server.ts
  • internal-packages/clickhouse/src/taskRuns.ts
  • apps/webapp/app/services/runsReplicationService.server.ts
  • internal-packages/database/prisma/migrations/20250616084546_bulk_action_item_drop_friendly_id_unique_constraint/migration.sql
  • internal-packages/database/prisma/migrations/20250710105648_bulk_action_notification_type/migration.sql
  • apps/webapp/app/components/runs/v3/TaskRunStatus.tsx
  • internal-packages/run-engine/src/engine/types.ts
  • apps/webapp/app/runEngine/services/triggerTask.server.ts
  • packages/core/src/v3/isomorphic/friendlyId.ts
  • internal-packages/database/prisma/migrations/20250708130212_task_run_add_bulk_action_group_ids/migration.sql
  • apps/webapp/app/components/primitives/Switch.tsx
  • internal-packages/emails/emails/components/styles.ts
  • apps/webapp/app/env.server.ts
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx
  • internal-packages/database/prisma/migrations/20250709131914_bulk_action_group_environment_id_created_at_index/migration.sql
  • apps/webapp/app/presenters/v3/ViewSchedulePresenter.server.ts
  • apps/webapp/app/components/BlankStatePanels.tsx
  • packages/core/src/v3/schemas/api.ts
  • apps/webapp/tailwind.config.js
  • apps/webapp/app/assets/icons/ListCheckedIcon.tsx
  • apps/webapp/app/components/primitives/Select.tsx
  • internal-packages/database/prisma/migrations/20250616083614_bulk_action_v2/migration.sql
  • apps/webapp/app/v3/services/finalizeTaskRun.server.ts
  • apps/webapp/app/v3/services/baseService.server.ts
  • apps/webapp/app/presenters/v3/BulkActionPresenter.server.ts
  • apps/webapp/app/components/primitives/AppliedFilter.tsx
  • internal-packages/clickhouse/src/index.ts
  • apps/webapp/app/components/navigation/SideMenu.tsx
  • internal-packages/database/prisma/migrations/20250623141255_bulk_action_group_counts_completed_at/migration.sql
  • apps/webapp/app/components/primitives/TruncatedCopyableValue.tsx
  • internal-packages/run-engine/src/engine/systems/runAttemptSystem.ts
  • apps/webapp/app/v3/services/replayTaskRun.server.ts
  • apps/webapp/app/presenters/v3/CreateBulkActionPresenter.server.ts
  • apps/webapp/app/components/primitives/Accordion.tsx
  • internal-packages/run-engine/src/engine/index.ts
  • apps/webapp/app/v3/commonWorker.server.ts
  • apps/webapp/app/components/ListPagination.tsx
  • apps/webapp/app/components/primitives/Pagination.tsx
  • apps/webapp/app/hooks/useSearchParam.ts
  • apps/webapp/app/v3/services/cancelTaskRunV1.server.ts
  • internal-packages/emails/src/index.tsx
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.$bulkActionParam.stream.tsx
  • apps/webapp/app/presenters/v3/WaitpointPresenter.server.ts
  • internal-packages/emails/emails/bulk-action-complete.tsx
  • apps/webapp/app/presenters/v3/BulkActionListPresenter.server.ts
  • apps/webapp/app/components/primitives/RadioButton.tsx
  • apps/webapp/app/presenters/v3/NextRunListPresenter.server.ts
  • apps/webapp/app/presenters/RunFilters.server.ts
  • apps/webapp/app/components/runs/v3/BatchFilters.tsx
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions.$bulkActionParam/route.tsx
  • apps/webapp/app/presenters/v3/ApiRunListPresenter.server.ts
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx
  • apps/webapp/app/components/BulkActionFilterSummary.tsx
  • apps/webapp/app/utils/pathBuilder.ts
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx
  • apps/webapp/app/v3/services/cancelTaskRun.server.ts
  • apps/webapp/app/components/runs/v3/SharedFilters.tsx
  • apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts
  • apps/webapp/app/components/runs/v3/BulkAction.tsx
  • internal-packages/database/prisma/schema.prisma
🧰 Additional context used
📓 Path-based instructions (5)
apps/webapp/**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/webapp.mdc
**/*.tsx

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/writing-tasks.mdc
**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .github/copilot-instructions.md
{packages/core,apps/webapp}/**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .github/copilot-instructions.md
apps/webapp/**/*.ts

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/webapp.mdc
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx (7)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to **/*.{ts,tsx} : Always prefer using isomorphic code like fetch, ReadableStream, etc. instead of Node.js specific code
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to {packages/core,apps/webapp}/**/*.{ts,tsx} : We use zod a lot in packages/core and in the webapp
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
apps/webapp/app/components/runs/v3/RunFilters.tsx (14)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Scheduled tasks must use `schedules.task` from `@trigger.dev/sdk/v3` and define a `cron` property for declarative schedules.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to {packages/core,apps/webapp}/**/*.{ts,tsx} : We use zod a lot in packages/core and in the webapp
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/*.tsx : When using React hooks for realtime updates, use `@trigger.dev/react-hooks` and provide a Public Access Token via context or props.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Lifecycle hooks (`init`, `cleanup`, `onStart`, `onSuccess`, `onFailure`, `handleError`) must be defined as properties of the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from inside another task, use the task instance's `trigger`, `batchTrigger`, `triggerAndWait`, `batchTriggerAndWait`, `batch.trigger`, `batch.triggerAndWait`, `batch.triggerByTask`, or `batch.triggerByTaskAndWait` methods.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : You MUST `export` every task, including subtasks, in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : If you are able to generate an example payload for a task, do so.
apps/webapp/app/services/runsRepository.server.ts (7)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
🪛 Biome (1.9.4)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx

[error] 226-290: Avoid using unnecessary Fragment.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment

(lint/complexity/noUselessFragments)

apps/webapp/app/services/runsRepository.server.ts

[error] 222-222: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 239-239: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 255-255: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ 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). (25)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 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 (1, 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 (ubuntu-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 (windows-latest - pnpm)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (16)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.bulk-actions/route.tsx (3)

62-101: LGTM: Well-structured loader with proper error handling

The loader implementation follows best practices with:

  • Proper authentication via requireUserId
  • Parameter validation using EnvironmentParamSchema
  • Error handling with tryCatch
  • Appropriate 404 responses for missing resources
  • Generic error handling for the presenter call

103-186: LGTM: Clean component structure with proper TypeScript usage

The main component is well-structured with:

  • Proper type annotations and hook usage
  • Conditional rendering based on data state
  • Appropriate blank state handling
  • Resizable panel implementation for inspector functionality
  • Consistent styling with utility classes

188-297: LGTM: Comprehensive bulk actions table implementation

The table component includes:

  • Proper data mapping and display
  • Consistent styling with selected state handling
  • Appropriate use of utility components like DateTime and TruncatedCopyableValue
  • Proper navigation with v3BulkActionPath
  • Good accessibility with proper table semantics
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs._index/route.tsx (3)

84-86: LGTM: Appropriate ClickHouse dependency check

The error handling for unsupported ClickHouse is appropriate since the NextRunListPresenter requires ClickHouse functionality.


88-95: LGTM: Simplified filter handling with new presenter

The refactored filter handling using getRunFiltersFromRequest and the new presenter is cleaner and more maintainable than the previous implementation.


195-214: LGTM: Well-implemented keyboard shortcuts for bulk actions

The keyboard shortcuts implementation is clean and follows the established pattern:

  • Proper key bindings (r for replay, c for cancel)
  • Correct URL parameter handling
  • Appropriate mode setting based on selection state
apps/webapp/app/services/runsRepository.server.ts (4)

21-49: LGTM: Comprehensive input validation with Zod

The schema definitions are well-structured with appropriate validation for all filter types. The separation of input options and filter options is a good design choice.


60-92: LGTM: Clean separation of ID fetching from full data retrieval

The listRunIds method properly separates the concern of fetching run IDs from ClickHouse, which allows for more efficient querying and better performance.


185-203: LGTM: Efficient count method implementation

The countRuns method properly uses ClickHouse's count query builder with the same filter logic, ensuring consistency between counting and listing operations.


268-345: LGTM: Comprehensive filter application logic

The filter application function handles all filter types appropriately with proper parameterization to prevent SQL injection and consistent formatting.

apps/webapp/app/components/runs/v3/RunFilters.tsx (6)

63-77: LGTM: Robust preprocessor for string/array handling

The StringOrStringArray preprocessor handles edge cases well:

  • Converts single strings to arrays
  • Filters out empty strings
  • Handles undefined/null values appropriately
  • Provides consistent typing

114-177: LGTM: Centralized filter metadata functions

The filterTitle and filterIcon functions provide consistent mapping from filter keys to display elements, improving maintainability and UI consistency.


179-214: LGTM: Robust URL parameter parsing

The getRunFiltersFromSearchParams function:

  • Properly handles URL decoding for tags
  • Filters out empty values
  • Uses safe parsing with fallback to empty object
  • Provides consistent parameter extraction

251-251: LGTM: Consistent UI improvements

The update to use XMarkIcon and secondary/small variant with tooltip improves the user experience and maintains consistency with other UI elements.


626-640: LGTM: Enhanced bulk action dropdown with improved layout

The updated bulk action dropdown:

  • Uses proper height with [&>div]:h-fit
  • Displays name prominently
  • Shows type and creation date in a well-structured layout
  • Uses consistent spacing and typography

707-708: LGTM: Improved tag filtering logic

The filtering of empty string values before setting the controlled value prevents UI issues with empty tags.

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

♻️ Duplicate comments (1)
apps/webapp/app/services/runsRepository.server.ts (1)

172-174: Performance concern with in-memory status filtering.

This approach filters large result sets in memory after fetching from the database, which can impact performance with large datasets.

🧹 Nitpick comments (4)
apps/webapp/app/services/runsRepository.server.ts (4)

222-222: Use optional chaining for cleaner code.

The condition can be simplified using optional chaining as suggested by static analysis.

Apply this diff:

-    if (options.batchId && options.batchId.startsWith("batch_")) {
+    if (options.batchId?.startsWith("batch_")) {

239-239: Use optional chaining for cleaner code.

The condition can be simplified using optional chaining as suggested by static analysis.

Apply this diff:

-    if (options.scheduleId && options.scheduleId.startsWith("sched_")) {
+    if (options.scheduleId?.startsWith("sched_")) {

255-255: Use optional chaining for cleaner code.

The condition can be simplified using optional chaining as suggested by static analysis.

Apply this diff:

-    if (options.bulkId && options.bulkId.startsWith("bulk_")) {
+    if (options.bulkId?.startsWith("bulk_")) {

345-349: Remove redundant ID conversion.

The runIds are already converted to friendly IDs in the #convertRunListInputOptionsToFilterRunsOptions method (line 261), making the conversion here redundant.

Apply this diff:

   if (options.runIds && options.runIds.length > 0) {
     queryBuilder.where("friendly_id IN {runIds: Array(String)}", {
-      runIds: options.runIds.map((runId) => RunId.toFriendlyId(runId)),
+      runIds: options.runIds,
     });
   }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fed987e and e823159.

📒 Files selected for processing (2)
  • apps/webapp/app/services/runsRepository.server.ts (6 hunks)
  • apps/webapp/test/runsRepository.test.ts (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/webapp/test/runsRepository.test.ts
🧰 Additional context used
📓 Path-based instructions (4)
apps/webapp/**/*.ts

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/webapp.mdc
apps/webapp/**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/webapp.mdc
**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .github/copilot-instructions.md
{packages/core,apps/webapp}/**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .github/copilot-instructions.md
🧠 Learnings (2)
📓 Common learnings
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
apps/webapp/app/services/runsRepository.server.ts (8)
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Schema tasks must use `schemaTask` from `@trigger.dev/sdk/v3` and validate payloads using a schema (e.g., Zod).
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to internal-packages/database/**/*.{ts,tsx} : We use prisma in internal-packages/database for our database interactions using PostgreSQL
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-06-30T13:21:33.994Z
Learning: Applies to {packages/core,apps/webapp}/**/*.{ts,tsx} : We use zod a lot in packages/core and in the webapp
Learnt from: ericallam
PR: triggerdotdev/trigger.dev#2175
File: apps/webapp/app/services/environmentMetricsRepository.server.ts:202-207
Timestamp: 2025-06-14T08:07:46.625Z
Learning: In apps/webapp/app/services/environmentMetricsRepository.server.ts, the ClickHouse methods (getTaskActivity, getCurrentRunningStats, getAverageDurations) intentionally do not filter by the `tasks` parameter at the ClickHouse level, even though the tasks parameter is accepted by the public methods. This is done on purpose as there is not much benefit from adding that filtering at the ClickHouse layer.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `runs` and `tasks` APIs from `@trigger.dev/sdk/v3` to subscribe to run updates and implement realtime features.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When using retry, queue, machine, or maxDuration options, configure them within the `task` function in Trigger.dev task files.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : Use the `metadata` API from `@trigger.dev/sdk/v3` to attach, update, and access structured metadata within task runs.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : The `run` function must contain the main logic for each Trigger.dev task.
🪛 Biome (1.9.4)
apps/webapp/app/services/runsRepository.server.ts

[error] 222-222: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 239-239: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)


[error] 255-255: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

⏰ 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). (25)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 10)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 10)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: typecheck / typecheck
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (5)
apps/webapp/app/services/runsRepository.server.ts (5)

1-9: Imports follow coding guidelines correctly.

The imports properly use subpath exports from @trigger.dev/core and follow the established patterns for the webapp.


19-46: Well-structured Zod schema for input validation.

The schema comprehensively covers all filtering options with proper type definitions. The separation between input options and internal filter options is clean.


60-92: Clean separation of concerns in listRunIds method.

The method correctly delegates filtering to the centralized applyRunFiltersToQueryBuilder function and handles pagination cursors appropriately.


273-350: Comprehensive filtering logic implementation.

The centralized filtering function properly handles all the various filter types with appropriate ClickHouse query syntax. The logic correctly applies filters for organization, project, environment, and all optional filters.


352-354: Clean export for input validation.

The exported function properly encapsulates the Zod schema validation for external use.

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

♻️ Duplicate comments (3)
apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts (3)

35-37: Consider making CLICKHOUSE_URL environment variable required.

This check could be eliminated if CLICKHOUSE_URL is made a required environment variable, as suggested in past reviews.


147-149: Consider making CLICKHOUSE_URL environment variable required.

This is another instance of the ClickHouse client validation that could be removed if the environment variable is made required.


284-284: Fix potential undefined cursor when no runs are processed.

When runIdsToProcess is empty (meaning all runs have been processed), runIdsToProcess.at(-1) returns undefined, which could cause issues with cursor-based pagination logic.

Apply this fix to handle the empty array case:

-        cursor: runIdsToProcess.at(runIdsToProcess.length - 1),
+        cursor: runIdsToProcess.length > 0 ? runIdsToProcess.at(-1) : null,
🧹 Nitpick comments (1)
apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts (1)

177-264: Consider adding transaction for bulk operation processing.

The run processing logic involves multiple database operations (fetching runs, calling services, updating counts) that could benefit from transaction wrapping to ensure consistency, especially if failures occur partway through batch processing.

Consider wrapping the batch processing logic in a transaction:

+    await this._prisma.$transaction(async (tx) => {
       const runs = await this._replica.taskRun.findMany({
         // ... existing query
       });

       // ... processing logic

+      // Update bulk action group within transaction
+      await tx.bulkActionGroup.update({
+        where: { id: bulkActionId },
+        data: {
+          cursor: runIdsToProcess.length > 0 ? runIdsToProcess.at(-1) : null,
+          successCount: { increment: successCount },
+          failureCount: { increment: failureCount },
+          status: isFinished ? BulkActionStatus.COMPLETED : undefined,
+          completedAt: isFinished ? new Date() : undefined,
+        },
+      });
+    });
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 885e2bf and d80af53.

📒 Files selected for processing (2)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx (1 hunks)
  • apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx
🧰 Additional context used
📓 Path-based instructions (4)
apps/webapp/**/*.ts

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/webapp.mdc
apps/webapp/**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .cursor/rules/webapp.mdc
**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .github/copilot-instructions.md
{packages/core,apps/webapp}/**/*.{ts,tsx}

Instructions used from:

Sources:
📄 CodeRabbit Inference Engine

  • .github/copilot-instructions.md
🧠 Learnings (2)
📓 Common learnings
Learnt from: matt-aitken
PR: triggerdotdev/trigger.dev#2264
File: apps/webapp/app/services/runsRepository.server.ts:172-174
Timestamp: 2025-07-12T18:06:04.105Z
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.
apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts (2)
Learnt from: matt-aitken
PR: triggerdotdev/trigger.dev#2264
File: apps/webapp/app/services/runsRepository.server.ts:172-174
Timestamp: 2025-07-12T18:06:04.105Z
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.
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-06-30T13:22:21.528Z
Learning: Applies to **/trigger/**/*.{ts,tsx,js,jsx} : When triggering a task from backend code, use `tasks.trigger`, `tasks.batchTrigger`, or `tasks.triggerAndPoll` from `@trigger.dev/sdk/v3` and set the `TRIGGER_SECRET_KEY` environment variable.
🧬 Code Graph Analysis (1)
apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts (10)
apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.bulkaction.tsx (2)
  • CreateBulkActionPayload (107-127)
  • CreateBulkActionPayload (128-128)
apps/webapp/app/services/clickhouseInstance.server.ts (1)
  • clickhouseClient (5-5)
apps/webapp/app/services/runsRepository.server.ts (2)
  • RunsRepository (57-271)
  • parseRunListInputOptions (352-354)
packages/core/src/v3/isomorphic/friendlyId.ts (1)
  • BulkActionId (97-97)
apps/webapp/app/v3/commonWorker.server.ts (1)
  • commonWorker (299-299)
apps/webapp/app/v3/services/cancelTaskRun.server.ts (1)
  • CancelTaskRunService (26-72)
apps/webapp/app/v3/services/replayTaskRun.server.ts (1)
  • ReplayTaskRunService (21-131)
apps/webapp/app/utils/pathBuilder.ts (1)
  • v3BulkActionPath (178-185)
apps/webapp/app/components/primitives/DateTime.tsx (1)
  • formatDateTime (64-80)
apps/webapp/app/presenters/RunFilters.server.ts (1)
  • getRunFiltersFromRequest (7-50)
⏰ 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). (25)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 10)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 10)
  • 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, 10)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (10, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (9, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 10)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 10)
  • 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
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
apps/webapp/app/v3/services/bulk/BulkActionV2.server.ts (2)

389-431: LGTM: Well-implemented filter normalization.

The getFilters helper function correctly handles both selected run IDs and filter-based modes, properly normalizes time periods to absolute timestamps to prevent time drift during batch processing, and ensures consistent cursor/direction handling.


354-386: LGTM: Proper abort handling with state validation.

The abort method correctly validates the bulk action state, acknowledges the queued job to prevent further processing, and updates the status appropriately.

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