Skip to content

Commit 76b48c3

Browse files
authored
Merge branch 'main' into docs/refresh-dashboard-ui-references-tri-11939
2 parents 5e04fbe + 64e5d73 commit 76b48c3

276 files changed

Lines changed: 14762 additions & 28405 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
---
4+
5+
Fix a `chat.agent` message-loss race where sending a message right after an action (such as an undo) could drop the follow-up's response from the UI until a refresh.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"trigger.dev": patch
3+
---
4+
5+
Remove the legacy `--mcp` and `--mcp-port` options from the `dev` command. Run the dedicated `trigger mcp` command to start the Trigger.dev MCP server.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
Removed the unused `ResourceMonitor` export from `@trigger.dev/core/v3/serverOnly`. It was a server-side logging helper with no remaining consumers.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/core": patch
3+
---
4+
5+
Removed the unused `@trigger.dev/core/v3/zodNamespace` export and the legacy v3 socket message schemas. These were only used by the now-retired v3 engine and have no v4 consumers.

.claude/rules/legacy-v3-code.md

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,24 @@ paths:
33
- "apps/webapp/app/v3/**"
44
---
55

6-
# Legacy V1 Engine Code in `app/v3/`
6+
# v3 (engine V1) has been removed
77

8-
The `v3/` directory name is misleading - most code here is actively used by the current V2 engine. Only the specific files below are legacy V1-only code.
8+
The v3 engine (RunEngineVersion `V1`: MarQS queue + Graphile worker) is end-of-life and its execution code has been removed from the webapp. The `app/v3/` directory name is historical: everything under it now serves the current V2 engine (`@internal/run-engine` + `@trigger.dev/redis-worker`).
99

10-
## V1-Only Files - Never Modify
10+
There is no `V1` execution path anymore. If you find a `RunEngineVersion` branch, the `V1` arm should only reject or finalize gracefully (for example, mark a historical run cancelled in the DB), never run V1 work. Do not reintroduce MarQS, the graphile worker, or the v3 socket.io namespaces.
1111

12-
- `marqs/` directory (entire MarQS queue system: sharedQueueConsumer, devQueueConsumer, fairDequeuingStrategy, devPubSub)
13-
- `legacyRunEngineWorker.server.ts` (V1 background job worker)
14-
- `services/triggerTaskV1.server.ts` (deprecated V1 task triggering)
15-
- `services/cancelTaskRunV1.server.ts` (deprecated V1 cancellation)
16-
- `authenticatedSocketConnection.server.ts` (V1 dev WebSocket using DevQueueConsumer)
17-
- `sharedSocketConnection.ts` (V1 shared queue socket using SharedQueueConsumer)
12+
## The deprecation boundary (keep this)
1813

19-
## V1/V2 Branching Pattern
14+
Requests from clients still on v3 (old SDK/CLI) or historical V1 runs must return a clean 4xx, never a 5xx. The boundary lives in:
2015

21-
Some services act as routers that branch on `RunEngineVersion`:
22-
- `services/cancelTaskRun.server.ts` - calls V1 service or `engine.cancelRun()` for V2
23-
- `services/batchTriggerV3.server.ts` - uses marqs for V1 path, run-engine for V2
16+
- `engineDeprecation.server.ts` - the `V3_TRIGGER_DEPRECATION_MESSAGE` / `V3_DEV_DEPRECATION_MESSAGE` / `V3_MIGRATION_URL` upgrade messages.
17+
- `engineVersion.server.ts` - `determineEngineVersion()` still detects a V1 project/run so callers can reject it.
18+
- `services/triggerTask.server.ts`, `services/cancelTaskRun.server.ts`, `services/rescheduleTaskRun.server.ts` - the `V1` arm rejects or finalizes gracefully instead of executing.
19+
- `services/initializeDeployment.server.ts` - the `DEPRECATE_V3_CLI_DEPLOYS_ENABLED`-gated v3 CLI deploy rejection.
20+
- `handleWebsockets.server.ts` - the legacy `trigger dev` websocket closes with the upgrade message.
2421

25-
When editing these shared services, only modify V2 code paths.
22+
## V2 modern stack
2623

27-
## V2 Modern Stack
28-
29-
- **Run lifecycle**: `@internal/run-engine` (internal-packages/run-engine)
30-
- **Background jobs**: `@trigger.dev/redis-worker` (not graphile-worker/zodworker)
31-
- **Queue operations**: RunQueue inside run-engine (not MarQS)
32-
- **V2 engine singleton**: `runEngine.server.ts`, `runEngineHandlers.server.ts`
33-
- **V2 workers**: `commonWorker.server.ts`, `alertsWorker.server.ts`, `batchTriggerWorker.server.ts`
24+
- **Run lifecycle**: `@internal/run-engine` (`runEngine.server.ts`, `runEngineHandlers.server.ts`)
25+
- **Background jobs**: `@trigger.dev/redis-worker` (`commonWorker.server.ts`, `alertsWorker.server.ts`, `batchTriggerWorker.server.ts`; `legacyRunEngineWorker.server.ts` still hosts the live batch-completion jobs)
26+
- **Queue operations**: RunQueue inside run-engine (`runQueue.server.ts`), not MarQS

.github/workflows/e2e-webapp.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
jobs:
1515
e2eTests:
1616
name: "🧪 E2E Tests: Webapp"
17-
runs-on: warp-ubuntu-latest-x64-8x
17+
runs-on: warp-ubuntu-latest-x64-16x
1818
timeout-minutes: 20
1919
env:
2020
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
os: [warp-ubuntu-latest-x64-4x, warp-windows-latest-x64-4x]
23+
os: [warp-ubuntu-latest-x64-4x, warp-windows-latest-x64-8x]
2424
package-manager: ["npm", "pnpm"]
2525
steps:
2626
- name: ⬇️ Checkout repo

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
4949
release:
5050
name: 🚀 Release npm packages
51-
runs-on: ubuntu-latest
51+
runs-on: ubuntu-latest # this cannot run on non-GH runner
5252
environment: npm-publish
5353
permissions:
5454
contents: write
@@ -281,7 +281,7 @@ jobs:
281281
# The prerelease job needs to be on the same workflow file due to a limitation related to how npm verifies OIDC claims.
282282
prerelease:
283283
name: 🧪 Prerelease
284-
runs-on: ubuntu-latest
284+
runs-on: ubuntu-latest # this cannot run on non-GH runner
285285
environment: npm-publish
286286
permissions:
287287
contents: read

.github/workflows/typecheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ permissions:
88

99
jobs:
1010
typecheck:
11-
runs-on: warp-ubuntu-latest-x64-8x
11+
runs-on: warp-ubuntu-latest-x64-16x
1212

1313
steps:
1414
- name: ⬇️ Checkout repo

.github/workflows/unit-tests-internal.yml

Lines changed: 35 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,14 @@ on:
1414
jobs:
1515
unitTests:
1616
name: "🧪 Unit Tests: Internal"
17-
runs-on: warp-ubuntu-latest-x64-8x
18-
strategy:
19-
# one flaky shard shouldn't cancel its siblings - lets us re-run only the failed shard
20-
fail-fast: false
21-
matrix:
22-
shardIndex: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
23-
shardTotal: [12]
17+
# Single big machine instead of a 12-job matrix: the internal suites are serial
18+
# (fileParallelism: false) and container-wait-bound, so 12 in-machine shard processes
19+
# fit comfortably in 32 vCPUs while paying the setup cost (install, prisma generate,
20+
# image pulls) once instead of 12 times.
21+
runs-on: warp-ubuntu-latest-x64-32x
2422
env:
2523
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
26-
SHARD_INDEX: ${{ matrix.shardIndex }}
27-
SHARD_TOTAL: ${{ matrix.shardTotal }}
24+
SHARD_TOTAL: 12
2825
steps:
2926
- name: 🔧 Disable IPv6
3027
run: |
@@ -108,8 +105,34 @@ jobs:
108105
- name: 📀 Generate Prisma Client
109106
run: pnpm run generate
110107

111-
- name: 🧪 Run Internal Unit Tests
112-
run: pnpm run test:internal --reporter=default --reporter=blob --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --passWithNoTests
108+
- name: 🏗️ Build test dependencies
109+
# Build once up-front so the parallel shard runs below (turbo --only) never race
110+
# to build or cache-restore the same outputs concurrently.
111+
run: pnpm exec turbo run build --filter "@internal/*..."
112+
113+
- name: 🧪 Run Internal Unit Tests (${{ env.SHARD_TOTAL }} in-machine shards)
114+
run: |
115+
# Same shard partitioning as the old 12-job matrix (DurationShardingSequencer
116+
# keys off --shard=i/N), but as parallel local processes. --only skips the
117+
# ^build dependency handled by the step above.
118+
status=0
119+
declare -a pids
120+
for i in $(seq 1 "$SHARD_TOTAL"); do
121+
pnpm exec turbo run test --only --concurrency=1 --filter "@internal/*" -- \
122+
--run --reporter=default --reporter=blob --shard="$i/$SHARD_TOTAL" --passWithNoTests \
123+
> "/tmp/internal-shard-$i.log" 2>&1 &
124+
pids[i]=$!
125+
done
126+
for i in $(seq 1 "$SHARD_TOTAL"); do
127+
if ! wait "${pids[i]}"; then
128+
status=1
129+
echo "::error::internal unit test shard $i/$SHARD_TOTAL failed"
130+
fi
131+
echo "::group::🧪 shard $i/$SHARD_TOTAL"
132+
cat "/tmp/internal-shard-$i.log"
133+
echo "::endgroup::"
134+
done
135+
exit "$status"
113136
114137
- name: Gather all reports
115138
if: ${{ !cancelled() }}
@@ -118,44 +141,6 @@ jobs:
118141
find . -type f -path '*/.vitest-reports/blob-*.json' \
119142
-exec bash -c 'src="$1"; basename=$(basename "$src"); pkg=$(dirname "$src" | sed "s|^\./||;s|/\.vitest-reports$||;s|/|_|g"); cp "$src" ".vitest-reports/${pkg}-${basename}"' _ {} \;
120143
121-
- name: Upload blob reports to GitHub Actions Artifacts
144+
- name: 📊 Merge reports
122145
if: ${{ !cancelled() }}
123-
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
124-
with:
125-
name: internal-blob-report-${{ matrix.shardIndex }}
126-
path: .vitest-reports/*
127-
include-hidden-files: true
128-
retention-days: 1
129-
130-
merge-reports:
131-
name: "📊 Merge Reports"
132-
if: ${{ !cancelled() }}
133-
needs: [unitTests]
134-
runs-on: warp-ubuntu-latest-x64-2x
135-
steps:
136-
- name: ⬇️ Checkout repo
137-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
138-
with:
139-
fetch-depth: 1
140-
persist-credentials: false
141-
142-
- name: ⎔ Setup pnpm
143-
uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v5.0.0
144-
with:
145-
version: 10.33.2
146-
147-
- name: ⎔ Setup node
148-
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
149-
with:
150-
node-version: 22.23.1
151-
# no cache enabled, we're not installing deps
152-
153-
- name: Download blob reports from GitHub Actions Artifacts
154-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
155-
with:
156-
path: .vitest-reports
157-
pattern: internal-blob-report-*
158-
merge-multiple: true
159-
160-
- name: Merge reports
161146
run: pnpm dlx vitest@4.1.7 run --merge-reports --pass-with-no-tests

0 commit comments

Comments
 (0)