X Tutup
Skip to content

Commit 0531a23

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/compute-workload-manager
2 parents e9b5fd3 + b192b71 commit 0531a23

File tree

248 files changed

+19199
-2749
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

248 files changed

+19199
-2749
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/redis-worker": patch
3+
---
4+
5+
Fix slow batch queue processing by removing spurious cooloff on concurrency blocks and fixing a race condition where retry attempt counts were not atomically updated during message re-queue.

.changeset/input-stream-wait.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"@trigger.dev/sdk": patch
3+
"@trigger.dev/react-hooks": patch
4+
---
5+
6+
Add input streams for bidirectional communication with running tasks. Define typed input streams with `streams.input<T>({ id })`, then consume inside tasks via `.wait()` (suspends the process), `.once()` (waits for next message), or `.on()` (subscribes to a continuous stream). Send data from backends with `.send(runId, data)` or from frontends with the new `useInputStreamSend` React hook.
7+
8+
Upgrade S2 SDK from 0.17 to 0.22 with support for custom endpoints (s2-lite) via the new `endpoints` configuration, `AppendRecord.string()` API, and `maxInflightBytes` session option.

.changeset/metal-steaks-try.md

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(sdk): batch triggerAndWait variants now return correct run.taskIdentifier instead of unknown

.changeset/modern-boxes-watch.md

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+
Add PAYLOAD_TOO_LARGE error to handle graceful recovery of sending batch trigger items with payloads that exceed the maximum payload size

.claude/rules/database-safety.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
paths:
3+
- "internal-packages/database/**"
4+
---
5+
6+
# Database Migration Safety
7+
8+
- When adding indexes to **existing tables**, use `CREATE INDEX CONCURRENTLY IF NOT EXISTS` to avoid table locks. These must be in their own separate migration file (one index per file).
9+
- Indexes on **newly created tables** (same migration as `CREATE TABLE`) do not need CONCURRENTLY.
10+
- When indexing a **new column on an existing table**, split into two migrations: first `ADD COLUMN IF NOT EXISTS`, then `CREATE INDEX CONCURRENTLY IF NOT EXISTS` in a separate file.
11+
- After generating a migration with Prisma, remove extraneous lines for: `_BackgroundWorkerToBackgroundWorkerFile`, `_BackgroundWorkerToTaskQueue`, `_TaskRunToTaskRunTag`, `_WaitpointRunConnections`, `_completedWaitpoints`, `SecretStore_key_idx`, and unrelated TaskRun indexes.
12+
- Never drop columns or tables without explicit approval.
13+
- New code should target `RunEngineVersion.V2` only.

.claude/rules/docs-writing.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
paths:
3+
- "docs/**"
4+
---
5+
6+
# Documentation Writing Rules
7+
8+
- Use Mintlify MDX format. Frontmatter: `title`, `description`, `sidebarTitle` (optional).
9+
- After creating a new page, add it to `docs.json` navigation under the correct group.
10+
- Use Mintlify components: `<Note>`, `<Warning>`, `<Info>`, `<Tip>`, `<CodeGroup>`, `<Expandable>`, `<Steps>`/`<Step>`.
11+
- Code examples should be complete and runnable where possible.
12+
- Always import from `@trigger.dev/sdk`, never `@trigger.dev/sdk/v3`.
13+
- Keep paragraphs short. Use headers to break up content.
14+
- Link to related pages using relative paths (e.g., `[Tasks](/tasks/overview)`).

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
paths:
3+
- "apps/webapp/app/v3/**"
4+
---
5+
6+
# Legacy V1 Engine Code in `app/v3/`
7+
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.
9+
10+
## V1-Only Files - Never Modify
11+
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)
18+
19+
## V1/V2 Branching Pattern
20+
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
24+
25+
When editing these shared services, only modify V2 code paths.
26+
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`

.claude/rules/sdk-packages.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
paths:
3+
- "packages/**"
4+
---
5+
6+
# Public Package Rules
7+
8+
- Changes to `packages/` are **customer-facing**. Always add a changeset: `pnpm run changeset:add`
9+
- Default to **patch**. Get maintainer approval for minor. Never select major without explicit approval.
10+
- `@trigger.dev/core`: **Never import the root**. Always use subpath imports (e.g., `@trigger.dev/core/v3`).
11+
- Do NOT update `rules/` or `.claude/skills/trigger-dev-tasks/` unless explicitly asked. These are maintained in separate dedicated passes.
12+
- Test changes using `references/hello-world` reference project.

.claude/rules/server-apps.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
paths:
3+
- "apps/**"
4+
---
5+
6+
# Server App Changes
7+
8+
When modifying server apps (webapp, supervisor, coordinator, etc.) with **no package changes**, add a `.server-changes/` file instead of a changeset:
9+
10+
```bash
11+
cat > .server-changes/descriptive-name.md << 'EOF'
12+
---
13+
area: webapp
14+
type: fix
15+
---
16+
17+
Brief description of what changed and why.
18+
EOF
19+
```
20+
21+
- **area**: `webapp` | `supervisor` | `coordinator` | `kubernetes-provider` | `docker-provider`
22+
- **type**: `feature` | `fix` | `improvement` | `breaking`
23+
- If the PR also touches `packages/`, just the changeset is sufficient (no `.server-changes/` needed).

.github/workflows/changesets-pr.yml

Lines changed: 30 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
paths:
88
- "packages/**"
99
- ".changeset/**"
10+
- ".server-changes/**"
1011
- "package.json"
1112
- "pnpm-lock.yaml"
1213

@@ -50,7 +51,7 @@ jobs:
5051
env:
5152
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5253

53-
- name: Update PR title with version
54+
- name: Update PR title and enhance body
5455
if: steps.changesets.outputs.published != 'true'
5556
env:
5657
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -61,6 +62,15 @@ jobs:
6162
# we arbitrarily reference the version of the cli package here; it is the same for all package releases
6263
VERSION=$(git show origin/changeset-release/main:packages/cli-v3/package.json | jq -r '.version')
6364
gh pr edit "$PR_NUMBER" --title "chore: release v$VERSION"
65+
66+
# Enhance the PR body with a clean, deduplicated summary
67+
RAW_BODY=$(gh pr view "$PR_NUMBER" --json body --jq '.body')
68+
ENHANCED_BODY=$(CHANGESET_PR_BODY="$RAW_BODY" node scripts/enhance-release-pr.mjs "$VERSION")
69+
if [ -n "$ENHANCED_BODY" ]; then
70+
gh api repos/triggerdotdev/trigger.dev/pulls/"$PR_NUMBER" \
71+
-X PATCH \
72+
-f body="$ENHANCED_BODY"
73+
fi
6474
fi
6575
6676
update-lockfile:
@@ -88,15 +98,26 @@ jobs:
8898
- name: Install and update lockfile
8999
run: pnpm install --no-frozen-lockfile
90100

91-
- name: Commit and push lockfile
101+
- name: Clean up consumed .server-changes/ files
92102
run: |
93103
set -e
94-
if git diff --quiet pnpm-lock.yaml; then
95-
echo "No lockfile changes"
96-
else
97-
git config user.name "github-actions[bot]"
98-
git config user.email "github-actions[bot]@users.noreply.github.com"
99-
git add pnpm-lock.yaml
100-
git commit -m "chore: update lockfile for release"
104+
shopt -s nullglob
105+
files=(.server-changes/*.md)
106+
for f in "${files[@]}"; do
107+
if [ "$(basename "$f")" != "README.md" ]; then
108+
git rm --ignore-unmatch "$f"
109+
fi
110+
done
111+
112+
- name: Commit and push lockfile + server-changes cleanup
113+
run: |
114+
set -e
115+
git config user.name "github-actions[bot]"
116+
git config user.email "github-actions[bot]@users.noreply.github.com"
117+
git add pnpm-lock.yaml
118+
if ! git diff --cached --quiet; then
119+
git commit -m "chore: update lockfile and clean up .server-changes/ for release"
101120
git push origin changeset-release/main
121+
else
122+
echo "No changes to commit"
102123
fi

0 commit comments

Comments
 (0)
X Tutup