Skip to content

Commit

Permalink
Merge branch 'main' into worker-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
nicktrn committed Dec 7, 2023
2 parents d8698e2 + 11f8ff1 commit 2afa199
Show file tree
Hide file tree
Showing 75 changed files with 536 additions and 161 deletions.
13 changes: 13 additions & 0 deletions apps/proxy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# proxy

## 0.0.8

### Patch Changes

- @trigger.dev/core@2.3.2

## 0.0.7

### Patch Changes

- Updated dependencies [f3efcc0c]
- @trigger.dev/core@2.3.1

## 0.0.6

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion apps/proxy/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "proxy",
"version": "0.0.6",
"version": "0.0.8",
"private": true,
"scripts": {
"deploy": "wrangler deploy",
Expand Down
4 changes: 2 additions & 2 deletions apps/webapp/app/services/db/pgListen.server.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Logger } from "@trigger.dev/core-backend";
import type { PoolClient } from "pg";
import { z } from "zod";
import { Logger } from "@trigger.dev/core";
import { logger } from "~/services/logger.server";
import { NotificationCatalog, NotificationChannel, notificationCatalog } from "./types";
import { safeJsonParse } from "~/utils/json";
import { NotificationCatalog, NotificationChannel, notificationCatalog } from "./types";

export class PgListenService {
#poolClient: PoolClient;
Expand Down
4 changes: 2 additions & 2 deletions apps/webapp/app/services/logger.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { LogLevel } from "@trigger.dev/core";
import { Logger } from "@trigger.dev/core";
import type { LogLevel } from "@trigger.dev/core-backend";
import { Logger } from "@trigger.dev/core-backend";
import { sensitiveDataReplacer } from "./sensitiveDataReplacer";
import { AsyncLocalStorage } from "async_hooks";

Expand Down
16 changes: 10 additions & 6 deletions apps/webapp/app/services/runs/performRunExecutionV3.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1053,20 +1053,24 @@ export class PerformRunExecutionV3Service {
return await this.#failRunExecution(this.#prismaClient, run, output);
}

await this.#prismaClient.jobRun.update({
const updatedJob = await this.#prismaClient.jobRun.update({
where: { id: run.id },
data: {
status: "WAITING_TO_EXECUTE",
executionDuration: {
increment: durationInMs,
},
executionCount: {
executionFailureCount: {
increment: 1,
},
},
});

await ResumeRunService.enqueue(run, this.#prismaClient);
if (updatedJob.executionFailureCount >= 10) {
return await this.#failRunExecution(this.#prismaClient, run, output);
}

// Use the job.executionFailureCount to determine how long to wait before retrying, using an exponential backoff
const runAt = new Date(Date.now() + Math.pow(1.5, updatedJob.executionFailureCount) * 500); // 500ms, 750ms, 1125ms, 1687ms, 2531ms, 3796ms, 5694ms, 8541ms, 12812ms, 19218ms

await ResumeRunService.enqueue(run, this.#prismaClient, runAt);
}

async #failRunExecution(
Expand Down
16 changes: 16 additions & 0 deletions integrations/airtable/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @trigger.dev/airtable

## 2.3.2

### Patch Changes

- 0c14e4cd: Fixed importing package subpath
- @trigger.dev/integration-kit@2.3.2
- @trigger.dev/sdk@2.3.2

## 2.3.1

### Patch Changes

- Updated dependencies [f3efcc0c]
- @trigger.dev/sdk@2.3.1
- @trigger.dev/integration-kit@2.3.1

## 2.3.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions integrations/airtable/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/airtable",
"version": "2.3.0",
"version": "2.3.2",
"description": "Trigger.dev integration for airtable",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -25,8 +25,8 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@trigger.dev/integration-kit": "workspace:^2.3.0",
"@trigger.dev/sdk": "workspace:^2.3.0",
"@trigger.dev/integration-kit": "workspace:^2.3.2",
"@trigger.dev/sdk": "workspace:^2.3.2",
"airtable": "^0.12.1",
"zod": "3.22.3"
},
Expand Down
4 changes: 2 additions & 2 deletions integrations/airtable/src/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { z } from "zod";
import * as events from "./events";
import { Airtable, AirtableRunTask } from "./index";
import { ListWebhooksResponse, ListWebhooksResponseSchema } from "./schemas";
import { WebhookSource, WebhookTrigger } from "@trigger.dev/sdk/triggers/webhook";
import { registerJobNamespace } from "@trigger.dev/integration-kit/webhooks";
import { WebhookSource, WebhookTrigger } from "@trigger.dev/sdk";
import { registerJobNamespace } from "@trigger.dev/integration-kit";
import { Buffer } from "node:buffer";

const WebhookFromSourceSchema = z.union([
Expand Down
15 changes: 15 additions & 0 deletions integrations/github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @trigger.dev/github

## 2.3.2

### Patch Changes

- @trigger.dev/integration-kit@2.3.2
- @trigger.dev/sdk@2.3.2

## 2.3.1

### Patch Changes

- Updated dependencies [f3efcc0c]
- @trigger.dev/sdk@2.3.1
- @trigger.dev/integration-kit@2.3.1

## 2.3.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions integrations/github/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/github",
"version": "2.3.0",
"version": "2.3.2",
"description": "The official GitHub integration for Trigger.dev",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -29,8 +29,8 @@
"@octokit/request": "^6.2.5",
"@octokit/request-error": "^4.0.1",
"@octokit/webhooks": "^10.4.0",
"@trigger.dev/integration-kit": "workspace:^2.3.0",
"@trigger.dev/sdk": "workspace:^2.3.0",
"@trigger.dev/integration-kit": "workspace:^2.3.2",
"@trigger.dev/sdk": "workspace:^2.3.2",
"octokit": "^2.0.14",
"zod": "3.22.3"
},
Expand Down
15 changes: 15 additions & 0 deletions integrations/linear/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @trigger.dev/linear

## 2.3.2

### Patch Changes

- @trigger.dev/integration-kit@2.3.2
- @trigger.dev/sdk@2.3.2

## 2.3.1

### Patch Changes

- Updated dependencies [f3efcc0c]
- @trigger.dev/sdk@2.3.1
- @trigger.dev/integration-kit@2.3.1

## 2.3.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions integrations/linear/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/linear",
"version": "2.3.0",
"version": "2.3.2",
"description": "Trigger.dev integration for @linear/sdk",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -26,8 +26,8 @@
},
"dependencies": {
"@linear/sdk": "^8.0.0",
"@trigger.dev/integration-kit": "workspace:^2.3.0",
"@trigger.dev/sdk": "workspace:^2.3.0",
"@trigger.dev/integration-kit": "workspace:^2.3.2",
"@trigger.dev/sdk": "workspace:^2.3.2",
"zod": "3.22.3"
},
"engines": {
Expand Down
15 changes: 15 additions & 0 deletions integrations/openai/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @trigger.dev/slack

## 2.3.2

### Patch Changes

- @trigger.dev/integration-kit@2.3.2
- @trigger.dev/sdk@2.3.2

## 2.3.1

### Patch Changes

- Updated dependencies [f3efcc0c]
- @trigger.dev/sdk@2.3.1
- @trigger.dev/integration-kit@2.3.1

## 2.3.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions integrations/openai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/openai",
"version": "2.3.0",
"version": "2.3.2",
"description": "The official OpenAI integration for Trigger.dev",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand Down Expand Up @@ -42,8 +42,8 @@
},
"dependencies": {
"openai": "^4.16.1",
"@trigger.dev/sdk": "workspace:^2.3.0",
"@trigger.dev/integration-kit": "workspace:^2.3.0"
"@trigger.dev/sdk": "workspace:^2.3.2",
"@trigger.dev/integration-kit": "workspace:^2.3.2"
},
"engines": {
"node": ">=18.0.0"
Expand Down
16 changes: 16 additions & 0 deletions integrations/plain/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @trigger.dev/plain

## 2.3.2

### Patch Changes

- 0c14e4cd: Fixed importing package subpath
- @trigger.dev/integration-kit@2.3.2
- @trigger.dev/sdk@2.3.2

## 2.3.1

### Patch Changes

- Updated dependencies [f3efcc0c]
- @trigger.dev/sdk@2.3.1
- @trigger.dev/integration-kit@2.3.1

## 2.3.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions integrations/plain/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/plain",
"version": "2.3.0",
"version": "2.3.2",
"description": "The official Plain.com integration for Trigger.dev",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -24,8 +24,8 @@
"build:tsup": "tsup"
},
"dependencies": {
"@trigger.dev/integration-kit": "workspace:^2.3.0",
"@trigger.dev/sdk": "workspace:^2.3.0",
"@trigger.dev/integration-kit": "workspace:^2.3.2",
"@trigger.dev/sdk": "workspace:^2.3.2",
"@team-plain/typescript-sdk": "^2.7.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion integrations/plain/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PlainClient } from "@team-plain/typescript-sdk";
import { Prettify } from "@trigger.dev/integration-kit/prettify";
import { Prettify } from "@trigger.dev/integration-kit";

export type PlainSDK = InstanceType<typeof PlainClient>;

Expand Down
15 changes: 15 additions & 0 deletions integrations/replicate/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @trigger.dev/replicate

## 2.3.2

### Patch Changes

- @trigger.dev/integration-kit@2.3.2
- @trigger.dev/sdk@2.3.2

## 2.3.1

### Patch Changes

- Updated dependencies [f3efcc0c]
- @trigger.dev/sdk@2.3.1
- @trigger.dev/integration-kit@2.3.1

## 2.3.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions integrations/replicate/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/replicate",
"version": "2.3.0",
"version": "2.3.2",
"description": "Trigger.dev integration for replicate",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -25,8 +25,8 @@
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@trigger.dev/integration-kit": "workspace:^2.3.0",
"@trigger.dev/sdk": "workspace:^2.3.0",
"@trigger.dev/integration-kit": "workspace:^2.3.2",
"@trigger.dev/sdk": "workspace:^2.3.2",
"replicate": "^0.18.1",
"zod": "3.22.3"
},
Expand Down
15 changes: 15 additions & 0 deletions integrations/resend/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @trigger.dev/resend

## 2.3.2

### Patch Changes

- @trigger.dev/integration-kit@2.3.2
- @trigger.dev/sdk@2.3.2

## 2.3.1

### Patch Changes

- Updated dependencies [f3efcc0c]
- @trigger.dev/sdk@2.3.1
- @trigger.dev/integration-kit@2.3.1

## 2.3.0

### Minor Changes
Expand Down
6 changes: 3 additions & 3 deletions integrations/resend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trigger.dev/resend",
"version": "2.3.0",
"version": "2.3.2",
"description": "The official Resend.com integration for Trigger.dev",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -24,8 +24,8 @@
"build:tsup": "tsup"
},
"dependencies": {
"@trigger.dev/integration-kit": "workspace:^2.3.0",
"@trigger.dev/sdk": "workspace:^2.3.0",
"@trigger.dev/integration-kit": "workspace:^2.3.2",
"@trigger.dev/sdk": "workspace:^2.3.2",
"resend": "^2.0.0"
},
"engines": {
Expand Down
15 changes: 15 additions & 0 deletions integrations/sendgrid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# @trigger.dev/sendgrid

## 2.3.2

### Patch Changes

- @trigger.dev/integration-kit@2.3.2
- @trigger.dev/sdk@2.3.2

## 2.3.1

### Patch Changes

- Updated dependencies [f3efcc0c]
- @trigger.dev/sdk@2.3.1
- @trigger.dev/integration-kit@2.3.1

## 2.3.0

### Minor Changes
Expand Down

0 comments on commit 2afa199

Please sign in to comment.