Skip to content

Commit 232b7cd

Browse files
author
Rishi Raj Jain
authored
Merge branch 'triggerdotdev:main' into main
2 parents 65cff19 + 8cf8544 commit 232b7cd

File tree

106 files changed

+2987
-1428
lines changed

Some content is hidden

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

106 files changed

+2987
-1428
lines changed

.changeset/hip-coins-reply.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/cli": patch
3+
---
4+
5+
Added hostname option to the cli dev command

.changeset/lemon-clocks-love.md

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

.changeset/rude-spoons-compete.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@trigger.dev/cli": patch
3+
---
4+
5+
Bugfix: @trigger.dev/cli init now correctly identifies the App Dir when using JS

.changeset/soft-glasses-repair.md

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

.github/workflows/publish.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- improvements/*
78
tags:
89
- "v.docker.*"
910
paths:
@@ -95,6 +96,12 @@ jobs:
9596
name: e2e Tests
9697
runs-on: buildjet-4vcpu-ubuntu-2204
9798
steps:
99+
- name: 🐳 Login to Docker Hub
100+
uses: docker/login-action@v2
101+
with:
102+
username: ${{ secrets.DOCKERHUB_USERNAME }}
103+
password: ${{ secrets.DOCKERHUB_TOKEN }}
104+
98105
- name: ⬇️ Checkout repo
99106
uses: actions/checkout@v3
100107
with:
@@ -154,6 +161,11 @@ jobs:
154161
version: ${{ steps.get_version.outputs.version }}
155162
short_sha: ${{ steps.get_commit.outputs.sha_short }}
156163
steps:
164+
- name: 🐳 Login to Docker Hub
165+
uses: docker/login-action@v2
166+
with:
167+
username: ${{ secrets.DOCKERHUB_USERNAME }}
168+
password: ${{ secrets.DOCKERHUB_TOKEN }}
157169
- name: ⬇️ Checkout repo
158170
uses: actions/checkout@v3
159171

@@ -167,6 +179,10 @@ jobs:
167179
IMAGE_TAG="v${ORIGINAL_VERSION}"
168180
fi
169181
echo "IMAGE_TAG=${IMAGE_TAG}"
182+
elif [[ $GITHUB_REF == refs/heads/improvements/* ]]; then
183+
ORIGINAL_VERSION="${GITHUB_REF#refs/heads/improvements/}"
184+
IMAGE_TAG="${ORIGINAL_VERSION}.rc"
185+
echo "IMAGE_TAG=${IMAGE_TAG}"
170186
elif [[ $GITHUB_REF == refs/heads/* ]]; then
171187
IMAGE_TAG="${GITHUB_REF#refs/heads/}"
172188
echo "IMAGE_TAG=${IMAGE_TAG}"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,4 @@ We provide an official trigger.dev docker image you can use to easily self-host
6262

6363
## Development
6464

65-
To setup and develop locally or contribute to the open source project, follow our [developement guide](./CONTRIBUTING.md).
65+
To setup and develop locally or contribute to the open source project, follow our [development guide](./CONTRIBUTING.md).

apps/webapp/app/components/run/RunOverview.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ function BlankTasks({
273273
basicStatus: RunBasicStatus;
274274
}) {
275275
switch (basicStatus) {
276+
default:
276277
case "COMPLETED":
277278
return <Paragraph variant="small">There were no tasks for this run.</Paragraph>;
278279
case "FAILED":
@@ -288,8 +289,6 @@ function BlankTasks({
288289
<TaskCardSkeleton />
289290
</div>
290291
);
291-
default:
292-
return <Paragraph variant="small">There were no tasks for this run.</Paragraph>;
293292
}
294293
}
295294

apps/webapp/app/consts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export const LIVE_ENVIRONMENT = "live";
22
export const DEV_ENVIRONMENT = "development";
33
export const MAX_LIVE_PROJECTS = 1;
4-
export const DEFAULT_MAX_CONCURRENT_RUNS = 10000;
4+
export const DEFAULT_MAX_CONCURRENT_RUNS = 10;
5+
export const MAX_CONCURRENT_RUNS_LIMIT = 20;
56
export const PREPROCESS_RETRY_LIMIT = 2;
67
export const EXECUTE_JOB_RETRY_LIMIT = 10;

apps/webapp/app/db.server.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { PrismaClient, Prisma } from "@trigger.dev/database";
22
import invariant from "tiny-invariant";
33
import { z } from "zod";
44
import { logger } from "./services/logger.server";
5+
import { env } from "./env.server";
56

67
export type PrismaTransactionClient = Omit<
78
PrismaClient,
@@ -84,17 +85,24 @@ function getClient() {
8485
const { DATABASE_URL } = process.env;
8586
invariant(typeof DATABASE_URL === "string", "DATABASE_URL env var not set");
8687

88+
const databaseUrl = new URL(DATABASE_URL);
89+
90+
// We need to add the connection_limit and pool_timeout query params to the url, in a way that works if the DATABASE_URL already has query params
91+
const query = databaseUrl.searchParams;
92+
query.set("connection_limit", env.DATABASE_CONNECTION_LIMIT.toString());
93+
query.set("pool_timeout", env.DATABASE_POOL_TIMEOUT.toString());
94+
databaseUrl.search = query.toString();
95+
8796
// Remove the username:password in the url and print that to the console
88-
const urlWithoutCredentials = new URL(DATABASE_URL);
97+
const urlWithoutCredentials = new URL(databaseUrl.href);
8998
urlWithoutCredentials.password = "";
9099

91100
console.log(`🔌 setting up prisma client to ${urlWithoutCredentials.toString()}`);
92101

93102
const client = new PrismaClient({
94103
datasources: {
95104
db: {
96-
url: DATABASE_URL,
97-
// We can't set directUrl here, and we don't have to
105+
url: databaseUrl.href,
98106
},
99107
},
100108
log: [

apps/webapp/app/env.server.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { SecretStoreOptionsSchema } from "./services/secrets/secretStore.server"
44
const EnvironmentSchema = z.object({
55
NODE_ENV: z.union([z.literal("development"), z.literal("production"), z.literal("test")]),
66
DATABASE_URL: z.string(),
7+
DATABASE_CONNECTION_LIMIT: z.coerce.number().int().default(10),
8+
DATABASE_POOL_TIMEOUT: z.coerce.number().int().default(60),
79
DIRECT_URL: z.string(),
810
SESSION_SECRET: z.string(),
911
MAGIC_LINK_SECRET: z.string(),
@@ -31,6 +33,13 @@ const EnvironmentSchema = z.object({
3133
RESEND_API_KEY: z.string().optional(),
3234
PLAIN_API_KEY: z.string().optional(),
3335
RUNTIME_PLATFORM: z.enum(["docker-compose", "ecs", "local"]).default("local"),
36+
WORKER_SCHEMA: z.string().default("graphile_worker"),
37+
WORKER_CONCURRENCY: z.coerce.number().int().default(10),
38+
WORKER_POLL_INTERVAL: z.coerce.number().int().default(1000),
39+
EXECUTION_WORKER_CONCURRENCY: z.coerce.number().int().default(10),
40+
EXECUTION_WORKER_POLL_INTERVAL: z.coerce.number().int().default(1000),
41+
WORKER_ENABLED: z.string().default("true"),
42+
EXECUTION_WORKER_ENABLED: z.string().default("true"),
3443
});
3544

3645
export type Environment = z.infer<typeof EnvironmentSchema>;

0 commit comments

Comments
 (0)