Skip to content

Commit 60ec55a

Browse files
committed
Merge remote-tracking branch 'origin/main' into kapa-ai-widget
2 parents 033598e + f579afb commit 60ec55a

File tree

142 files changed

+6762
-1672
lines changed

Some content is hidden

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

142 files changed

+6762
-1672
lines changed

.changeset/blue-eyes-tickle.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
The dev command will now use the platform-provided engine URL

.changeset/eighty-rings-divide.md

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+
Configurable queue consumer count in supervisor session

.changeset/hip-cups-wave.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 issue where realtime streams would cut off after 5 minutes

.changeset/polite-impalas-care.md

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+
Fixes runLimiter check on #dequeueRuns

.changeset/pre.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,30 @@
1717
"@trigger.dev/sdk": "3.3.17"
1818
},
1919
"changesets": [
20+
"blue-eyes-tickle",
2021
"breezy-turtles-talk",
22+
"eighty-rings-divide",
2123
"four-needles-add",
2224
"green-lions-relate",
25+
"hip-cups-wave",
2326
"honest-files-decide",
2427
"late-chairs-ring",
2528
"moody-squids-count",
2629
"nice-colts-boil",
30+
"polite-impalas-care",
2731
"polite-lies-fix",
2832
"red-wasps-cover",
2933
"shiny-kiwis-beam",
3034
"smart-coins-hammer",
3135
"sour-mirrors-accept",
36+
"spotty-ducks-punch",
37+
"spotty-pants-wink",
38+
"tender-jobs-collect",
39+
"tidy-books-smell",
3240
"tiny-buckets-teach",
3341
"tricky-houses-invite",
3442
"two-tigers-dream",
35-
"weak-jobs-hide"
43+
"weak-jobs-hide",
44+
"wet-deers-think"
3645
]
3746
}

.changeset/spotty-ducks-punch.md

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+
fix: default machine config indexing now works

.changeset/spotty-pants-wink.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
Prevent large outputs from overwriting each other

.changeset/tender-jobs-collect.md

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+
TriggerApiError 4xx errors will no longer cause tasks to be retried

.changeset/tidy-books-smell.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
- Fix polling interval reset bug that could create duplicate intervals
7+
- Protect against unexpected attempt number changes
8+
- Prevent run execution zombies after warm starts

.changeset/wet-deers-think.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"trigger.dev": patch
3+
"@trigger.dev/core": patch
4+
---
5+
6+
Fix QUEUED status snapshot handler

.vscode/launch.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
{
2626
"type": "node-terminal",
2727
"request": "launch",
28-
"name": "Debug fairDequeuingStrategy.test.ts",
29-
"command": "pnpm run test -t FairDequeuingStrategy",
28+
"name": "Debug triggerTask.test.ts",
29+
"command": "pnpm run test --run ./test/engine/triggerTask.test.ts",
3030
"envFile": "${workspaceFolder}/.env",
3131
"cwd": "${workspaceFolder}/apps/webapp",
3232
"sourceMaps": true

DOCKER_INSTALLATION.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,47 +8,56 @@ If you don't have Docker installed on your machine, you'll run into some complic
88

99
Below are the steps on how you can avoid that.
1010

11-
First you need to setup docker-compose as it is an underlying tool that this command: `pnpm run docker` fires behind the scene.
11+
First you need to setup docker compose as it is an underlying tool that this command: `pnpm run docker` fires behind the scene.
1212

1313
## Linux
1414

15-
To install Docker Compose on Linux Ubuntu via the terminal, you can follow these steps:
15+
To install Docker Compose on Linux Ubuntu, you can follow these steps:
1616

17-
1. Update the package index on your system by running the following command:
17+
1. Create the Docker config directory and cli-plugins subdirectory:
1818

1919
```shell
20-
sudo apt update
20+
DOCKER_CONFIG=${DOCKER_CONFIG:-$HOME/.docker}
21+
mkdir -p $DOCKER_CONFIG/cli-plugins
2122
```
2223

23-
2. Install the required dependencies by running the following command:
24+
2. Download the Docker Compose plugin:
2425

2526
```shell
26-
sudo apt install curl
27+
curl -SL "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o $DOCKER_CONFIG/cli-plugins/docker-compose
2728
```
2829

29-
3. Download the Docker Compose binary into the `/usr/local/bin` directory using the `curl` command:
30+
Note:
31+
32+
- To install for all users, replace `$DOCKER_CONFIG/cli-plugins` with `/usr/local/lib/docker/cli-plugins`
33+
34+
3. Set the appropriate permissions to make the Docker Compose plugin executable:
3035

3136
```shell
32-
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
37+
chmod +x $DOCKER_CONFIG/cli-plugins/docker-compose
3338
```
3439

35-
4. Set the appropriate permissions to make the `docker-compose` binary executable:
40+
If you installed for all users:
3641

3742
```shell
38-
sudo chmod +x /usr/local/bin/docker-compose
43+
sudo chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
3944
```
4045

41-
5. Verify that Docker Compose has been successfully installed by running the following command:
46+
4. Verify that Docker Compose has been successfully installed:
4247

4348
```shell
44-
docker-compose --version
49+
docker compose version
4550
```
4651

47-
This command should display the version information of Docker Compose without any errors.
52+
You should see output similar to:
53+
54+
```
55+
Docker Compose version vX.Y.Z
56+
```
4857

49-
After following these steps, you should have Docker Compose installed on your Ubuntu system, and you can use it by running `docker-compose` commands in the terminal.
58+
After following these steps, you should have Docker Compose installed on your Ubuntu system, and you can use it by running `docker compose` commands in the terminal.
5059

51-
When you've verified that the `docker-compose` package is installed and you proceed to start Docker with `pnpm run docker`.
60+
When you've verified that the `docker compose` package is installed and you proceed to start Docker with `pnpm run docker`.
5261

5362
You'll probably get an error similar to the one below:
5463

apps/supervisor/src/env.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const Env = z.object({
3333
TRIGGER_DEQUEUE_ENABLED: BoolEnv.default("true"),
3434
TRIGGER_DEQUEUE_INTERVAL_MS: z.coerce.number().int().default(1000),
3535
TRIGGER_DEQUEUE_MAX_RUN_COUNT: z.coerce.number().int().default(10),
36+
TRIGGER_DEQUEUE_MAX_CONSUMER_COUNT: z.coerce.number().int().default(1),
3637

3738
// Optional services
3839
TRIGGER_WARM_START_URL: z.string().optional(),

apps/supervisor/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ class ManagedSupervisor {
118118
dequeueIntervalMs: env.TRIGGER_DEQUEUE_INTERVAL_MS,
119119
queueConsumerEnabled: env.TRIGGER_DEQUEUE_ENABLED,
120120
maxRunCount: env.TRIGGER_DEQUEUE_MAX_RUN_COUNT,
121+
maxConsumerCount: env.TRIGGER_DEQUEUE_MAX_CONSUMER_COUNT,
121122
runNotificationsEnabled: env.TRIGGER_WORKLOAD_API_ENABLED,
122123
preDequeue: async () => {
123124
if (this.isKubernetes) {

apps/webapp/app/components/code/JSONEditor.tsx

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { json as jsonLang } from "@codemirror/lang-json";
2-
import type { ViewUpdate } from "@codemirror/view";
1+
import { json as jsonLang, jsonParseLinter } from "@codemirror/lang-json";
2+
import type { EditorView, ViewUpdate } from "@codemirror/view";
33
import { CheckIcon, ClipboardIcon, TrashIcon } from "@heroicons/react/20/solid";
44
import type { ReactCodeMirrorProps, UseCodeMirror } from "@uiw/react-codemirror";
55
import { useCodeMirror } from "@uiw/react-codemirror";
@@ -8,6 +8,7 @@ import { cn } from "~/utils/cn";
88
import { Button } from "../primitives/Buttons";
99
import { getEditorSetup } from "./codeMirrorSetup";
1010
import { darkTheme } from "./codeMirrorTheme";
11+
import { linter, lintGutter, type Diagnostic } from "@codemirror/lint";
1112

1213
export interface JSONEditorProps extends Omit<ReactCodeMirrorProps, "onBlur"> {
1314
defaultValue?: string;
@@ -18,18 +19,35 @@ export interface JSONEditorProps extends Omit<ReactCodeMirrorProps, "onBlur"> {
1819
onBlur?: (code: string) => void;
1920
showCopyButton?: boolean;
2021
showClearButton?: boolean;
22+
linterEnabled?: boolean;
23+
allowEmpty?: boolean;
2124
}
2225

2326
const languages = {
2427
json: jsonLang,
2528
};
2629

30+
function emptyAwareJsonLinter() {
31+
return (view: EditorView): Diagnostic[] => {
32+
const content = view.state.doc.toString().trim();
33+
34+
// return no errors if content is empty
35+
if (!content) {
36+
return [];
37+
}
38+
39+
return jsonParseLinter()(view);
40+
};
41+
}
42+
2743
type JSONEditorDefaultProps = Partial<JSONEditorProps>;
2844

2945
const defaultProps: JSONEditorDefaultProps = {
3046
language: "json",
3147
readOnly: true,
3248
basicSetup: false,
49+
linterEnabled: true,
50+
allowEmpty: true,
3351
};
3452

3553
export function JSONEditor(opts: JSONEditorProps) {
@@ -44,6 +62,8 @@ export function JSONEditor(opts: JSONEditorProps) {
4462
autoFocus,
4563
showCopyButton = true,
4664
showClearButton = true,
65+
linterEnabled,
66+
allowEmpty,
4767
} = {
4868
...defaultProps,
4969
...opts,
@@ -56,6 +76,19 @@ export function JSONEditor(opts: JSONEditorProps) {
5676

5777
extensions.push(languageExtension());
5878

79+
if (linterEnabled) {
80+
extensions.push(lintGutter());
81+
82+
switch (language) {
83+
case "json": {
84+
extensions.push(allowEmpty ? linter(emptyAwareJsonLinter()) : linter(jsonParseLinter()));
85+
break;
86+
}
87+
default:
88+
language satisfies never;
89+
}
90+
}
91+
5992
const editor = useRef<HTMLDivElement>(null);
6093
const settings: Omit<UseCodeMirror, "onBlur"> = {
6194
...opts,

apps/webapp/app/components/code/codeMirrorSetup.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { closeBrackets } from "@codemirror/autocomplete";
22
import { indentWithTab } from "@codemirror/commands";
3-
import { jsonParseLinter } from "@codemirror/lang-json";
43
import { bracketMatching } from "@codemirror/language";
5-
import { lintGutter, lintKeymap, linter } from "@codemirror/lint";
4+
import { lintKeymap } from "@codemirror/lint";
65
import { highlightSelectionMatches } from "@codemirror/search";
76
import { Prec, type Extension } from "@codemirror/state";
87
import {
@@ -21,8 +20,6 @@ export function getEditorSetup(showLineNumbers = true, showHighlights = true): A
2120
dropCursor(),
2221
bracketMatching(),
2322
closeBrackets(),
24-
lintGutter(),
25-
linter(jsonParseLinter()),
2623
Prec.highest(
2724
keymap.of([
2825
{

apps/webapp/app/components/code/codeMirrorTheme.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,32 @@ export function darkTheme(): Extension {
3939
fontSize: "14px",
4040
},
4141

42+
".cm-tooltip.cm-tooltip-lint": {
43+
backgroundColor: tooltipBackground,
44+
},
45+
46+
".cm-diagnostic": {
47+
padding: "4px 8px",
48+
color: ivory,
49+
fontFamily: "Geist Mono Variable",
50+
fontSize: "12px",
51+
},
52+
53+
".cm-diagnostic-error": {
54+
borderLeft: "2px solid #e11d48",
55+
},
56+
57+
".cm-lint-marker-error": {
58+
content: "none",
59+
backgroundColor: "#e11d48",
60+
height: "100%",
61+
width: "2px",
62+
},
63+
64+
".cm-lintPoint:after": {
65+
borderBottom: "4px solid #e11d48",
66+
},
67+
4268
".cm-cursor, .cm-dropCursor": { borderLeftColor: cursor },
4369
"&.cm-focused .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": {
4470
backgroundColor: selection,
@@ -82,6 +108,7 @@ export function darkTheme(): Extension {
82108

83109
".cm-tooltip": {
84110
border: "none",
111+
marginTop: "6px",
85112
backgroundColor: tooltipBackground,
86113
},
87114
".cm-tooltip .cm-tooltip-arrow:before": {

apps/webapp/app/components/runs/v3/RunFilters.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,8 @@ function BatchIdDropdown({
841841
if (batchId) {
842842
if (!batchId.startsWith("batch_")) {
843843
error = "Batch IDs start with 'batch_'";
844-
} else if (batchId.length !== 27) {
845-
error = "Batch IDs are 27 characters long";
844+
} else if (batchId.length !== 27 && batchId.length !== 31) {
845+
error = "Batch IDs are 27 or 31 characters long";
846846
}
847847
}
848848

apps/webapp/app/components/runs/v3/SpanEvents.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ export function SpanEventError({
8383
time={spanEvent.time}
8484
titleClassName="text-rose-500"
8585
/>
86-
{enhancedException.message && <Callout variant="error">{enhancedException.message}</Callout>}
86+
{enhancedException.message && (
87+
<Callout variant="error">
88+
<pre className="text-wrap font-sans text-sm font-normal text-rose-200">
89+
{enhancedException.message}
90+
</pre>
91+
</Callout>
92+
)}
8793
{enhancedException.link &&
8894
(enhancedException.link.magic === "CONTACT_FORM" ? (
8995
<Feedback

apps/webapp/app/env.server.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ const EnvironmentSchema = z.object({
384384
.int()
385385
.default(60 * 1000 * 15),
386386
MARQS_SHARED_QUEUE_LIMIT: z.coerce.number().int().default(1000),
387+
MARQS_MAXIMUM_QUEUE_PER_ENV_COUNT: z.coerce.number().int().default(50),
387388
MARQS_DEV_QUEUE_LIMIT: z.coerce.number().int().default(1000),
388389
MARQS_MAXIMUM_NACK_COUNT: z.coerce.number().int().default(64),
389390
MARQS_CONCURRENCY_LIMIT_BIAS: z.coerce.number().default(0.75),
@@ -624,6 +625,9 @@ const EnvironmentSchema = z.object({
624625
/** The maximum concurrent local run processes executing at once in dev */
625626
DEV_MAX_CONCURRENT_RUNS: z.coerce.number().int().default(25),
626627

628+
/** The CLI should connect to this for dev runs */
629+
DEV_ENGINE_URL: z.string().default(process.env.APP_ORIGIN ?? "http://localhost:3030"),
630+
627631
LEGACY_RUN_ENGINE_WORKER_ENABLED: z.string().default(process.env.WORKER_ENABLED ?? "true"),
628632
LEGACY_RUN_ENGINE_WORKER_CONCURRENCY_WORKERS: z.coerce.number().int().default(2),
629633
LEGACY_RUN_ENGINE_WORKER_CONCURRENCY_TASKS_PER_WORKER: z.coerce.number().int().default(1),

0 commit comments

Comments
 (0)