Skip to content

Commit 3a0735d

Browse files
committed
Merge remote-tracking branch 'origin/main' into dashboard/new-sidebar-v2-eol
# Conflicts: # apps/webapp/app/components/run/TriggerDetail.tsx # apps/webapp/app/components/runs/v3/RunIcon.tsx # apps/webapp/app/entry.server.tsx # apps/webapp/app/presenters/HttpEndpointPresenter.server.ts # apps/webapp/app/routes/api.v1.$endpointSlug.schedules.$id.registrations.ts # apps/webapp/app/routes/api.v1.$endpointSlug.sources.$id.ts # apps/webapp/app/routes/api.v1.$endpointSlug.triggers.$id.registrations.$key.ts # apps/webapp/app/routes/api.v1.$endpointSlug.triggers.$id.registrations.ts # apps/webapp/app/routes/api.v1.accounts.$accountId.connections.$clientSlug/route.ts # apps/webapp/app/routes/api.v1.endpointindex.$indexId.ts # apps/webapp/app/routes/api.v1.event-dispatchers.ephemeral.ts # apps/webapp/app/routes/api.v1.events.$eventId.ts # apps/webapp/app/routes/api.v1.events.bulk.ts # apps/webapp/app/routes/api.v1.events.ts # apps/webapp/app/routes/api.v1.http-endpoints.$httpEndpointId.env.$envType.$shortcode.ts # apps/webapp/app/routes/api.v1.jobs.$jobSlug.invoke.ts # apps/webapp/app/routes/api.v1.runs.$runId.logs/route.ts # apps/webapp/app/routes/api.v1.runs.$runId.statuses.$id/route.ts # apps/webapp/app/routes/api.v1.runs.$runId.statuses.ts # apps/webapp/app/routes/api.v1.runs.$runId.tasks.$id.complete/route.ts # apps/webapp/app/routes/api.v1.runs.$runId.tasks.$id.fail/route.ts # apps/webapp/app/routes/api.v1.runs.$runId.tasks/route.ts # apps/webapp/app/routes/api.v1.webhooks.$key.ts # apps/webapp/app/routes/api.v2.$endpointSlug.sources.$id.ts # apps/webapp/app/routes/api.v2.$endpointSlug.triggers.$id.registrations.$key.ts # apps/webapp/app/routes/api.v2.events.$eventId.ts # apps/webapp/app/routes/api.v2.runs.$runId.statuses.ts # apps/webapp/app/services/endpoints/indexEndpoint.server.ts # apps/webapp/app/services/endpoints/performEndpointIndexService.server.ts # apps/webapp/app/services/events/sqsEventConsumer.server.ts # apps/webapp/app/services/httpendpoint/HandleHttpEndpointService.server.ts # apps/webapp/app/services/triggers/registerWebhook.server.ts # apps/webapp/app/services/worker.server.ts # apps/webapp/remix.config.js # apps/webapp/tsconfig.json # packages/cli-v3/src/dev/backgroundWorker.ts # packages/core/package.json # references/hello-world/src/trigger/example.ts
2 parents 4dc7529 + d855d55 commit 3a0735d

File tree

466 files changed

+40642
-7192
lines changed

Some content is hidden

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

466 files changed

+40642
-7192
lines changed

.changeset/breezy-turtles-talk.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@trigger.dev/react-hooks": patch
3+
"@trigger.dev/sdk": patch
4+
"trigger.dev": patch
5+
"@trigger.dev/build": patch
6+
"@trigger.dev/core": patch
7+
"@trigger.dev/rsc": patch
8+
---
9+
10+
Run Engine 2.0 (alpha)

.changeset/cold-coins-burn.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

.changeset/little-trains-begin.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/ninety-cars-peel.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/wise-mirrors-hug.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.changeset/witty-jars-approve.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

.configs/tsconfig.base.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es2022",
4-
"lib": ["ES2022", "DOM", "DOM.Iterable"],
4+
"lib": ["ES2022", "DOM", "DOM.Iterable", "DOM.AsyncIterable"],
55
"module": "NodeNext",
66
"moduleResolution": "NodeNext",
77
"moduleDetection": "force",

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# dependencies
1111

12-
node_modules
12+
**/node_modules
1313
.pnp
1414
.pnp.js
1515

.eslintrc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/actions/get-image-tag/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ runs:
3131
sha=$(echo ${{ github.sha }} | head -c7)
3232
ts=$(date +%s)
3333
tag=${env}-${sha}-${ts}
34+
elif [[ "${{ github.ref_name }}" == re2-*-* ]]; then
35+
env=$(echo ${{ github.ref_name }} | cut -d- -f2)
36+
sha=$(echo ${{ github.sha }} | head -c7)
37+
ts=$(date +%s)
38+
tag=${env}-${sha}-${ts}
3439
elif [[ "${{ github.ref_name }}" == v.docker.* ]]; then
3540
version="${GITHUB_REF_NAME#v.docker.}"
3641
tag="v${version}"

.github/workflows/e2e.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ jobs:
3838
- name: 📥 Download deps
3939
run: pnpm install --frozen-lockfile --filter trigger.dev...
4040

41+
- name: 📀 Generate Prisma Client
42+
run: pnpm run generate
43+
4144
- name: 🔧 Build v3 cli monorepo dependencies
4245
run: pnpm run build --filter trigger.dev^...
4346

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: "⚒️ Publish Worker RE2"
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
image_tag:
7+
description: The image tag to publish
8+
type: string
9+
required: false
10+
default: ""
11+
push:
12+
tags:
13+
- "re2-test-*"
14+
- "re2-prod-*"
15+
16+
permissions:
17+
packages: write
18+
contents: read
19+
20+
jobs:
21+
check-branch:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Fail if re2-prod-* is pushed from a non-main branch
25+
if: startsWith(github.ref_name, 're2-prod-') && github.base_ref != 'main'
26+
run: |
27+
echo "🚫 re2-prod-* tags can only be pushed from the main branch."
28+
exit 1
29+
build:
30+
needs: check-branch
31+
strategy:
32+
matrix:
33+
package: [supervisor]
34+
runs-on: ubuntu-latest
35+
env:
36+
DOCKER_BUILDKIT: "1"
37+
steps:
38+
- name: ⬇️ Checkout git repo
39+
uses: actions/checkout@v4
40+
41+
- name: 📦 Get image repo
42+
id: get_repository
43+
run: |
44+
if [[ "${{ matrix.package }}" == *-provider ]]; then
45+
provider_type=$(echo "${{ matrix.package }}" | cut -d- -f1)
46+
repo=provider/${provider_type}
47+
else
48+
repo="${{ matrix.package }}"
49+
fi
50+
echo "repo=${repo}" >> "$GITHUB_OUTPUT"
51+
52+
- id: get_tag
53+
uses: ./.github/actions/get-image-tag
54+
with:
55+
tag: ${{ inputs.image_tag }}
56+
57+
- name: 🐋 Set up Docker Buildx
58+
uses: docker/setup-buildx-action@v3
59+
60+
# ..to avoid rate limits when pulling images
61+
- name: 🐳 Login to DockerHub
62+
uses: docker/login-action@v3
63+
with:
64+
username: ${{ secrets.DOCKERHUB_USERNAME }}
65+
password: ${{ secrets.DOCKERHUB_TOKEN }}
66+
67+
- name: 🚢 Build Container Image
68+
run: |
69+
docker build -t infra_image -f ./apps/${{ matrix.package }}/Containerfile .
70+
71+
# ..to push image
72+
- name: 🐙 Login to GitHub Container Registry
73+
uses: docker/login-action@v3
74+
with:
75+
registry: ghcr.io
76+
username: ${{ github.repository_owner }}
77+
password: ${{ secrets.GITHUB_TOKEN }}
78+
79+
- name: 🐙 Push to GitHub Container Registry
80+
run: |
81+
docker tag infra_image "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
82+
docker push "$REGISTRY/$REPOSITORY:$IMAGE_TAG"
83+
env:
84+
REGISTRY: ghcr.io/triggerdotdev
85+
REPOSITORY: ${{ steps.get_repository.outputs.repo }}
86+
IMAGE_TAG: ${{ steps.get_tag.outputs.tag }}
87+
88+
- name: 🐙 Push 'v3' tag to GitHub Container Registry
89+
if: steps.get_tag.outputs.is_semver == 'true'
90+
run: |
91+
docker tag infra_image "$REGISTRY/$REPOSITORY:v3"
92+
docker push "$REGISTRY/$REPOSITORY:v3"
93+
env:
94+
REGISTRY: ghcr.io/triggerdotdev
95+
REPOSITORY: ${{ steps.get_repository.outputs.repo }}

.github/workflows/publish.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,10 @@ on:
2424
- "packages/**"
2525
- "!packages/**/*.md"
2626
- "!packages/**/*.eslintrc"
27+
- "internal-packages/**"
2728
- "apps/**"
2829
- "!apps/**/*.md"
2930
- "!apps/**/*.eslintrc"
30-
- "integrations/**"
31-
- "!integrations/**/*.md"
32-
- "!integrations/**/*.eslintrc"
3331
- "pnpm-lock.yaml"
3432
- "pnpm-workspace.yaml"
3533
- "turbo.json"

.github/workflows/unit-tests.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ jobs:
2424
node-version: 20.11.1
2525
cache: "pnpm"
2626

27+
# ..to avoid rate limits when pulling images
28+
- name: 🐳 Login to DockerHub
29+
uses: docker/login-action@v3
30+
with:
31+
username: ${{ secrets.DOCKERHUB_USERNAME }}
32+
password: ${{ secrets.DOCKERHUB_TOKEN }}
33+
2734
- name: 📥 Download deps
2835
run: pnpm install --frozen-lockfile
2936

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
link-workspace-packages=false
22
public-hoist-pattern[]=*prisma*
3-
prefer-workspace-packages=true
3+
prefer-workspace-packages=true
4+
update-notifier=false

.vscode/launch.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,22 @@
133133
"command": "pnpm exec trigger dev",
134134
"cwd": "${workspaceFolder}/references/hello-world",
135135
"sourceMaps": true
136+
},
137+
{
138+
"type": "node-terminal",
139+
"request": "launch",
140+
"name": "Debug RunEngine tests",
141+
"command": "pnpm run test --filter @internal/run-engine",
142+
"cwd": "${workspaceFolder}",
143+
"sourceMaps": true
144+
},
145+
{
146+
"type": "node-terminal",
147+
"request": "launch",
148+
"name": "Debug RunQueue tests",
149+
"command": "pnpm run test ./src/engine/tests/waitpoints.test.ts",
150+
"cwd": "${workspaceFolder}/internal-packages/run-engine",
151+
"sourceMaps": true
136152
}
137153
]
138154
}

.zed/tasks.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
[
2+
{
3+
"label": "Build packages",
4+
"command": "pnpm run build --filter \"@trigger.dev/*\" --filter trigger.dev",
5+
//"args": [],
6+
// Env overrides for the command, will be appended to the terminal's environment from the settings.
7+
"env": { "foo": "bar" },
8+
// Current working directory to spawn the command into, defaults to current project root.
9+
//"cwd": "/path/to/working/directory",
10+
// Whether to use a new terminal tab or reuse the existing one to spawn the process, defaults to `false`.
11+
"use_new_terminal": false,
12+
// Whether to allow multiple instances of the same task to be run, or rather wait for the existing ones to finish, defaults to `false`.
13+
"allow_concurrent_runs": false,
14+
// What to do with the terminal pane and tab, after the command was started:
15+
// * `always` — always show the task's pane, and focus the corresponding tab in it (default)
16+
// * `no_focus` — always show the task's pane, add the task's tab in it, but don't focus it
17+
// * `never` — do not alter focus, but still add/reuse the task's tab in its pane
18+
"reveal": "always",
19+
// What to do with the terminal pane and tab, after the command has finished:
20+
// * `never` — Do nothing when the command finishes (default)
21+
// * `always` — always hide the terminal tab, hide the pane also if it was the last tab in it
22+
// * `on_success` — hide the terminal tab on task success only, otherwise behaves similar to `always`
23+
"hide": "never",
24+
// Which shell to use when running a task inside the terminal.
25+
// May take 3 values:
26+
// 1. (default) Use the system's default terminal configuration in /etc/passwd
27+
// "shell": "system"
28+
// 2. A program:
29+
// "shell": {
30+
// "program": "sh"
31+
// }
32+
// 3. A program with arguments:
33+
// "shell": {
34+
// "with_arguments": {
35+
// "program": "/bin/bash",
36+
// "args": ["--login"]
37+
// }
38+
// }
39+
"shell": "system",
40+
// Whether to show the task line in the output of the spawned task, defaults to `true`.
41+
"show_summary": true,
42+
// Whether to show the command line in the output of the spawned task, defaults to `true`.
43+
"show_output": true
44+
}
45+
]

CONTRIBUTING.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,13 +230,21 @@ pnpm run db:studio
230230
cd packages/database
231231
```
232232

233-
3. Create and apply the migrations
233+
3. Create a migration
234234

235235
```
236-
pnpm run db:migrate:dev
236+
pnpm run db:migrate:dev:create
237237
```
238238

239-
This creates a migration file and executes the migrations against your database and applies changes to the database schema(s)
239+
This creates a migration file. Check the migration file does only what you want. If you're adding any database indexes they must use `CONCURRENTLY`, otherwise they'll lock the table when executed.
240+
241+
4. Run the migration.
242+
243+
```
244+
pnpm run db:migrate:deploy
245+
pnpm run generate
246+
```
247+
This executes the migrations against your database and applies changes to the database schema(s), and then regenerates the Prisma client.
240248

241249
4. Commit generated migrations as well as changes to the schema.prisma file
242250
5. If you're using VSCode you may need to restart the Typescript server in the webapp to get updated type inference. Open a TypeScript file, then open the Command Palette (View > Command Palette) and run `TypeScript: Restart TS server`.

apps/coordinator/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323
"tinyexec": "^0.3.0"
2424
},
2525
"devDependencies": {
26-
"@types/node": "^18",
2726
"dotenv": "^16.4.2",
2827
"esbuild": "^0.19.11",
29-
"tsx": "^4.7.0",
30-
"typescript": "^5.3.3"
28+
"tsx": "^4.7.0"
3129
}
3230
}

apps/coordinator/src/checkpointer.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ExponentialBackoff } from "@trigger.dev/core/v3/apps";
2-
import { testDockerCheckpoint } from "@trigger.dev/core/v3/apps";
2+
import { testDockerCheckpoint } from "@trigger.dev/core/v3/serverOnly";
33
import { nanoid } from "nanoid";
44
import fs from "node:fs/promises";
55
import { ChaosMonkey } from "./chaosMonkey";
@@ -277,6 +277,7 @@ export class Checkpointer {
277277
return result.checkpoint;
278278
} finally {
279279
if (opts.shouldHeartbeat) {
280+
// @ts-ignore - Some kind of node incompatible type issue
280281
clearInterval(interval);
281282
}
282283
removeCurrentAbortController();

apps/coordinator/tsconfig.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{
2-
"include": ["./src/**/*.ts"],
3-
"exclude": ["node_modules"],
42
"compilerOptions": {
5-
"target": "es2016",
3+
"target": "es2018",
64
"module": "commonjs",
75
"esModuleInterop": true,
86
"resolveJsonModule": true,

apps/docker-provider/package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,8 @@
2020
"execa": "^8.0.1"
2121
},
2222
"devDependencies": {
23-
"@types/node": "^18.19.8",
2423
"dotenv": "^16.4.2",
2524
"esbuild": "^0.19.11",
26-
"tsx": "^4.7.0",
27-
"typescript": "^5.3.3"
25+
"tsx": "^4.7.0"
2826
}
2927
}

apps/docker-provider/src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import {
77
TaskOperationsRestoreOptions,
88
} from "@trigger.dev/core/v3/apps";
99
import { SimpleLogger } from "@trigger.dev/core/v3/apps";
10-
import { isExecaChildProcess, testDockerCheckpoint } from "@trigger.dev/core/v3/apps";
10+
import { isExecaChildProcess } from "@trigger.dev/core/v3/apps";
11+
import { testDockerCheckpoint } from "@trigger.dev/core/v3/serverOnly";
1112
import { setTimeout } from "node:timers/promises";
1213
import { PostStartCauses, PreStopCauses } from "@trigger.dev/core/v3";
1314

apps/kubernetes-provider/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
"devDependencies": {
2424
"dotenv": "^16.4.2",
2525
"esbuild": "^0.19.11",
26-
"tsx": "^4.7.0",
27-
"typescript": "^5.3.3"
26+
"tsx": "^4.7.0"
2827
}
2928
}

0 commit comments

Comments
 (0)