Skip to content

Commit d951f72

Browse files
authored
Merge branch 'main' into main
2 parents 5c643a8 + 74c2076 commit d951f72

Some content is hidden

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

53 files changed

+965
-288
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
commit: "chore: Update version for release"
7070
title: "chore: Update version for release"
7171
publish: pnpm run changeset:release
72-
createGithubReleases: false
72+
createGithubReleases: true
7373
env:
7474
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7575
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

apps/webapp/app/env.server.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ const EnvironmentSchema = z.object({
177177

178178
LOOPS_API_KEY: z.string().optional(),
179179
MARQS_DISABLE_REBALANCING: z.coerce.boolean().default(false),
180+
MARQS_VISIBILITY_TIMEOUT_MS: z.coerce
181+
.number()
182+
.int()
183+
.default(60 * 1000 * 15),
184+
PROD_TASK_HEARTBEAT_INTERVAL_MS: z.coerce.number().int().optional(),
180185

181186
VERBOSE_GRAPHILE_LOGGING: z.string().default("false"),
182187
V2_MARQS_ENABLED: z.string().default("0"),

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.electric.$runParam/route.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ function ConnectedDevWarning() {
11551155
<Paragraph variant="small">
11561156
Runs usually start within 2 seconds in{" "}
11571157
<EnvironmentLabel environment={{ type: "DEVELOPMENT" }} />. Check you're running the
1158-
CLI: <InlineCode className="whitespace-nowrap">npx trigger.dev@beta dev</InlineCode>
1158+
CLI: <InlineCode className="whitespace-nowrap">npx trigger.dev@latest dev</InlineCode>
11591159
</Paragraph>
11601160
</div>
11611161
</Callout>

apps/webapp/app/v3/environmentVariables/environmentVariablesRepository.server.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,6 +798,15 @@ async function resolveBuiltInProdVariables(runtimeEnvironment: RuntimeEnvironmen
798798
]);
799799
}
800800

801+
if (env.PROD_TASK_HEARTBEAT_INTERVAL_MS) {
802+
result = result.concat([
803+
{
804+
key: "HEARTBEAT_INTERVAL_MS",
805+
value: String(env.PROD_TASK_HEARTBEAT_INTERVAL_MS),
806+
},
807+
]);
808+
}
809+
801810
const commonVariables = await resolveCommonBuiltInVariables(runtimeEnvironment);
802811

803812
return [...result, ...commonVariables];

apps/webapp/app/v3/marqs/devQueueConsumer.server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ export class DevQueueConsumer {
162162
/**
163163
* @deprecated Use `taskRunHeartbeat` instead
164164
*/
165-
public async taskHeartbeat(workerId: string, id: string, seconds: number = 60) {
166-
logger.debug("[DevQueueConsumer] taskHeartbeat()", { id, seconds });
165+
public async taskHeartbeat(workerId: string, id: string) {
166+
logger.debug("[DevQueueConsumer] taskHeartbeat()", { id });
167167

168168
const taskRunAttempt = await prisma.taskRunAttempt.findUnique({
169169
where: { friendlyId: id },
@@ -173,13 +173,13 @@ export class DevQueueConsumer {
173173
return;
174174
}
175175

176-
await marqs?.heartbeatMessage(taskRunAttempt.taskRunId, seconds);
176+
await marqs?.heartbeatMessage(taskRunAttempt.taskRunId);
177177
}
178178

179-
public async taskRunHeartbeat(workerId: string, id: string, seconds: number = 60) {
180-
logger.debug("[DevQueueConsumer] taskRunHeartbeat()", { id, seconds });
179+
public async taskRunHeartbeat(workerId: string, id: string) {
180+
logger.debug("[DevQueueConsumer] taskRunHeartbeat()", { id });
181181

182-
await marqs?.heartbeatMessage(id, seconds);
182+
await marqs?.heartbeatMessage(id);
183183
}
184184

185185
public async stop(reason: string = "CLI disconnected") {

apps/webapp/app/v3/marqs/index.server.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -698,8 +698,8 @@ export class MarQS {
698698
}
699699

700700
// This should increment by the number of seconds, but with a max value of Date.now() + visibilityTimeoutInMs
701-
public async heartbeatMessage(messageId: string, seconds: number = 30) {
702-
await this.options.visibilityTimeoutStrategy.heartbeat(messageId, seconds * 1000);
701+
public async heartbeatMessage(messageId: string) {
702+
await this.options.visibilityTimeoutStrategy.heartbeat(messageId, this.visibilityTimeoutInMs);
703703
}
704704

705705
get visibilityTimeoutInMs() {
@@ -1871,7 +1871,7 @@ function getMarQSClient() {
18711871
redis: redisOptions,
18721872
defaultEnvConcurrency: env.DEFAULT_ENV_EXECUTION_CONCURRENCY_LIMIT,
18731873
defaultOrgConcurrency: env.DEFAULT_ORG_EXECUTION_CONCURRENCY_LIMIT,
1874-
visibilityTimeoutInMs: 120 * 1000, // 2 minutes,
1874+
visibilityTimeoutInMs: env.MARQS_VISIBILITY_TIMEOUT_MS,
18751875
enableRebalancing: !env.MARQS_DISABLE_REBALANCING,
18761876
subscriber: concurrencyTracker,
18771877
});

apps/webapp/app/v3/marqs/sharedQueueConsumer.server.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,8 +1169,8 @@ class SharedQueueTasks {
11691169
} satisfies TaskRunExecutionLazyAttemptPayload;
11701170
}
11711171

1172-
async taskHeartbeat(attemptFriendlyId: string, seconds: number = 60) {
1173-
logger.debug("[SharedQueueConsumer] taskHeartbeat()", { id: attemptFriendlyId, seconds });
1172+
async taskHeartbeat(attemptFriendlyId: string) {
1173+
logger.debug("[SharedQueueConsumer] taskHeartbeat()", { id: attemptFriendlyId });
11741174

11751175
const taskRunAttempt = await prisma.taskRunAttempt.findUnique({
11761176
where: { friendlyId: attemptFriendlyId },
@@ -1180,13 +1180,13 @@ class SharedQueueTasks {
11801180
return;
11811181
}
11821182

1183-
await marqs?.heartbeatMessage(taskRunAttempt.taskRunId, seconds);
1183+
await marqs?.heartbeatMessage(taskRunAttempt.taskRunId);
11841184
}
11851185

1186-
async taskRunHeartbeat(runId: string, seconds: number = 60) {
1187-
logger.debug("[SharedQueueConsumer] taskRunHeartbeat()", { runId, seconds });
1186+
async taskRunHeartbeat(runId: string) {
1187+
logger.debug("[SharedQueueConsumer] taskRunHeartbeat()", { runId });
11881188

1189-
await marqs?.heartbeatMessage(runId, seconds);
1189+
await marqs?.heartbeatMessage(runId);
11901190
}
11911191

11921192
public async taskRunFailed(completion: TaskRunFailedExecutionResult) {

docs/cli-deploy-commands.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "CLI deploy options"
3-
sidebarTitle: "Deploy"
3+
sidebarTitle: "deploy"
44
description: "Use these options to help deploy your tasks to Trigger.dev."
55
---
66

docs/cli-deploy.mdx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ title: "CLI deploy command"
33
description: "The `trigger.dev deploy` command can be used to manually deploy."
44
---
55

6-
import ComingSoon from '/snippets/coming-soon-generic.mdx';
76
import CliDeployCommands from '/snippets/cli-commands-deploy.mdx';
87

98
<CliDeployCommands/>
10-
11-
{/* todo add options, remove the reference docs */}

docs/cli-dev-commands.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "CLI dev command"
3-
sidebarTitle: "Dev"
3+
sidebarTitle: "dev"
44
description: "The `trigger.dev dev` command is used to run your tasks locally."
55
---
66

docs/cli-init-commands.mdx

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
title: "CLI init command"
3-
sidebarTitle: "Init"
3+
sidebarTitle: "init"
44
description: "Use these options when running the CLI `init` command."
55
---
66

7+
import CommonOptions from '/snippets/cli-options-common.mdx';
8+
79
Run the command like this:
810

911
<CodeGroup>
@@ -49,25 +51,8 @@ yarn dlx trigger.dev@latest init
4951
Additional arguments to pass to the package manager. Accepts CSV for multiple args.
5052
</ParamField>
5153

52-
<ParamField body="Login profile" type="--profile">
53-
The login profile to use. Defaults to "default".
54-
</ParamField>
54+
### Common options
5555

56-
<ParamField body="API URL" type="--api-url | -a">
57-
Override the default API URL. If not specified, it uses `https://api.trigger.dev`.
58-
</ParamField>
59-
60-
<ParamField body="Log level" type="--log-level | -l">
61-
The CLI log level to use. Options are `debug`, `info`, `log`, `warn`, `error`, and `none`. This
62-
does not affect the log level of your trigger.dev tasks. Defaults to "log".
63-
</ParamField>
56+
These options are available on most commands.
6457

65-
<ParamField body="Skip telemetry" type="--skip-telemetry">
66-
Opt-out of sending telemetry data.
67-
</ParamField>
68-
69-
## Standard options
70-
71-
<ParamField body="Help" type="--help | -h">
72-
Shows the help information for the command.
73-
</ParamField>
58+
<CommonOptions />

docs/cli-introduction.mdx

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,23 @@ title: "Introduction"
33
description: "The Trigger.dev CLI has a number of options and commands to help you develop locally, self host, and deploy your tasks."
44
---
55

6-
## Standard options
6+
import HelpOption from '/snippets/cli-options-help.mdx';
7+
import VersionOption from '/snippets/cli-options-version.mdx';
78

8-
<ParamField body="Help" type="--help | -h">
9-
Displays a list of all help commands.
10-
</ParamField>
9+
## Options
1110

12-
<ParamField body="Version" type="--version | -v">
13-
Displays the version number.
14-
</ParamField>
11+
<HelpOption />
12+
<VersionOption />
1513

1614
## Commands
1715

18-
| Command | Description |
19-
| :------------------------------------------------------- | :--------------------------------------------------------------------- |
20-
| [Login](/cli-login-commands) | Login with Trigger.dev so you can perform authenticated actions. |
21-
| [Init](/cli-init-commands) | Initialize your existing project for development with Trigger.dev. |
22-
| [Dev](/cli-dev-commands) | Run your Trigger.dev tasks locally. |
23-
| [Deploy](/cli-deploy-commands) | Deploy your Trigger.dev v3 project to the cloud. |
24-
| [Whoami](/cli-whoami-commands) | Display the current logged in user and project details. |
25-
| [Logout](/cli-logout-commands) | Logout of Trigger.dev. |
26-
| [List-profiles](/cli-list-profiles-commands) | List all of your CLI profiles. |
27-
| [Update](/cli-update-commands) | Updates all `@trigger.dev/*` packages to match the CLI version. |
16+
| Command | Description |
17+
| :------------------------------------------- | :----------------------------------------------------------------- |
18+
| [login](/cli-login-commands) | Login with Trigger.dev so you can perform authenticated actions. |
19+
| [init](/cli-init-commands) | Initialize your existing project for development with Trigger.dev. |
20+
| [dev](/cli-dev-commands) | Run your Trigger.dev tasks locally. |
21+
| [deploy](/cli-deploy-commands) | Deploy your Trigger.dev v3 project to the cloud. |
22+
| [whoami](/cli-whoami-commands) | Display the current logged in user and project details. |
23+
| [logout](/cli-logout-commands) | Logout of Trigger.dev. |
24+
| [list-profiles](/cli-list-profiles-commands) | List all of your CLI profiles. |
25+
| [update](/cli-update-commands) | Updates all `@trigger.dev/*` packages to match the CLI version. |

docs/cli-list-profiles-commands.mdx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
---
2-
title: "CLI list profiles command"
3-
sidebarTitle: "List profiles"
2+
title: "CLI list-profiles command"
3+
sidebarTitle: "list-profiles"
44
description: "Use these options when using the `list-profiles` CLI command."
55
---
66

7+
import LogLevelOption from "/snippets/cli-options-log-level.mdx";
8+
import SkipTelemetryOption from "/snippets/cli-options-skip-telemetry.mdx";
9+
import HelpOption from "/snippets/cli-options-help.mdx";
10+
import VersionOption from "/snippets/cli-options-version.mdx";
11+
712
Run the command like this:
813

914
<CodeGroup>
@@ -24,17 +29,14 @@ yarn dlx trigger.dev@latest list-profiles
2429

2530
## Options
2631

27-
<ParamField body="Log level" type="--log-level | -l">
28-
The CLI log level to use. Options are `debug`, `info`, `log`, `warn`, `error`, and `none`. This
29-
does not affect the log level of your trigger.dev tasks. Defaults to `log`.
30-
</ParamField>
32+
### Common options
33+
34+
These options are available on most commands.
35+
36+
<LogLevelOption />
3137

32-
<ParamField body="Skip telemetry" type="--skip-telemetry">
33-
Opt-out of sending telemetry data.
34-
</ParamField>
38+
<SkipTelemetryOption />
3539

36-
## Standard options
40+
<HelpOption />
3741

38-
<ParamField body="Help" type="--help | -h">
39-
Shows the help information for the command.
40-
</ParamField>
42+
<VersionOption />

docs/cli-login-commands.mdx

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
title: "CLI login command"
3-
sidebarTitle: "Login"
3+
sidebarTitle: "login"
44
description: "Use these options when logging in to Trigger.dev using the CLI."
55
---
66

7+
import CommonOptions from '/snippets/cli-options-common.mdx';
8+
79
Run the command like this:
810

911
<CodeGroup>
@@ -24,29 +26,8 @@ yarn dlx trigger.dev@latest login
2426

2527
## Options
2628

27-
<ParamField body="Login profile" type="--profile">
28-
Specifies the login profile to use. If not provided, it defaults to "default".
29-
</ParamField>
30-
31-
<ParamField body="API URL" type="-a | --api-url">
32-
Overrides the default API URL. If not specified, it uses `https://api.trigger.dev`.
33-
</ParamField>
34-
35-
<ParamField body="Log level" type="-l | --log-level">
36-
Sets the CLI log level. Available options are `debug`, `info`, `log`, `warn`, `error`, and `none`.
37-
This setting doesn't affect the log level of your trigger.dev tasks. The default is `log`.
38-
</ParamField>
39-
40-
<ParamField body="Skip telemetry" type="--skip-telemetry">
41-
Opts out of sending telemetry data.
42-
</ParamField>
43-
44-
## Standard options
29+
### Common options
4530

46-
<ParamField body="Version" type="--version | -v">
47-
Displays the version number of the CLI.
48-
</ParamField>
31+
These options are available on most commands.
4932

50-
<ParamField body="Help" type="--help | -h">
51-
Shows the help information for the command.
52-
</ParamField>
33+
<CommonOptions />

docs/cli-logout-commands.mdx

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
---
22
title: "CLI logout command"
3-
sidebarTitle: "Logout"
3+
sidebarTitle: "logout"
44
description: "Use these options when using the `logout` CLI command."
55
---
66

7+
import CommonOptions from '/snippets/cli-options-common.mdx';
8+
79
Run the command like this:
810

911
<CodeGroup>
@@ -24,25 +26,8 @@ yarn dlx trigger.dev@latest logout
2426

2527
## Options
2628

27-
<ParamField body="Login profile" type="--profile">
28-
The login profile to use. Defaults to `default`.
29-
</ParamField>
30-
31-
<ParamField body="API URL" type="--api-url | -a">
32-
Override the API URL. Defaults to `https://api.trigger.dev`.
33-
</ParamField>
34-
35-
<ParamField body="Log level" type="--log-level | -l">
36-
The CLI log level to use. Options are `debug`, `info`, `log`, `warn`, `error`, and `none`. This
37-
does not affect the log level of your trigger.dev tasks. Defaults to `log`.
38-
</ParamField>
39-
40-
<ParamField body="Skip telemetry" type="--skip-telemetry">
41-
Opt-out of sending telemetry data.
42-
</ParamField>
29+
### Common options
4330

44-
## Standard options
31+
These options are available on most commands.
4532

46-
<ParamField body="Help" type="--help | -h">
47-
Shows the help information for the command.
48-
</ParamField>
33+
<CommonOptions />

0 commit comments

Comments
 (0)