trigger.dev 3.0.0-beta.47 → 3.0.0-beta.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Containerfile.prod
CHANGED
|
@@ -43,12 +43,14 @@ ARG TRIGGER_DEPLOYMENT_ID
|
|
|
43
43
|
ARG TRIGGER_DEPLOYMENT_VERSION
|
|
44
44
|
ARG TRIGGER_CONTENT_HASH
|
|
45
45
|
ARG TRIGGER_PROJECT_REF
|
|
46
|
+
ARG NODE_EXTRA_CA_CERTS
|
|
46
47
|
|
|
47
48
|
ENV TRIGGER_PROJECT_ID=${TRIGGER_PROJECT_ID} \
|
|
48
49
|
TRIGGER_DEPLOYMENT_ID=${TRIGGER_DEPLOYMENT_ID} \
|
|
49
50
|
TRIGGER_DEPLOYMENT_VERSION=${TRIGGER_DEPLOYMENT_VERSION} \
|
|
50
51
|
TRIGGER_CONTENT_HASH=${TRIGGER_CONTENT_HASH} \
|
|
51
52
|
TRIGGER_PROJECT_REF=${TRIGGER_PROJECT_REF} \
|
|
53
|
+
NODE_EXTRA_CA_CERTS=${NODE_EXTRA_CA_CERTS} \
|
|
52
54
|
NODE_ENV=production
|
|
53
55
|
|
|
54
56
|
USER node
|
package/dist/index.js
CHANGED
|
@@ -798,7 +798,7 @@ import invariant from "tiny-invariant";
|
|
|
798
798
|
import { z as z4 } from "zod";
|
|
799
799
|
|
|
800
800
|
// package.json
|
|
801
|
-
var version = "3.0.0-beta.
|
|
801
|
+
var version = "3.0.0-beta.49";
|
|
802
802
|
var dependencies = {
|
|
803
803
|
"@anatine/esbuild-decorators": "^0.2.19",
|
|
804
804
|
"@clack/prompts": "^0.7.0",
|
|
@@ -815,7 +815,7 @@ var dependencies = {
|
|
|
815
815
|
"@opentelemetry/sdk-trace-base": "^1.22.0",
|
|
816
816
|
"@opentelemetry/sdk-trace-node": "^1.22.0",
|
|
817
817
|
"@opentelemetry/semantic-conventions": "^1.22.0",
|
|
818
|
-
"@trigger.dev/core": "workspace:3.0.0-beta.
|
|
818
|
+
"@trigger.dev/core": "workspace:3.0.0-beta.49",
|
|
819
819
|
"@types/degit": "^2.8.3",
|
|
820
820
|
chalk: "^5.2.0",
|
|
821
821
|
chokidar: "^3.5.3",
|
|
@@ -1321,7 +1321,7 @@ function initializeTracing() {
|
|
|
1321
1321
|
resource,
|
|
1322
1322
|
spanLimits: {
|
|
1323
1323
|
attributeCountLimit: 1e3,
|
|
1324
|
-
attributeValueLengthLimit:
|
|
1324
|
+
attributeValueLengthLimit: 2048,
|
|
1325
1325
|
eventCountLimit: 100,
|
|
1326
1326
|
attributePerEventCountLimit: 100,
|
|
1327
1327
|
linkCountLimit: 10,
|
|
@@ -1793,6 +1793,13 @@ async function resolveConfig(path7, config) {
|
|
|
1793
1793
|
if (!config.tsconfigPath) {
|
|
1794
1794
|
config.tsconfigPath = await findFilePath(path7, "tsconfig.json");
|
|
1795
1795
|
}
|
|
1796
|
+
if (!config.additionalFiles) {
|
|
1797
|
+
config.additionalFiles = [];
|
|
1798
|
+
}
|
|
1799
|
+
if (config.extraCACerts) {
|
|
1800
|
+
config.additionalFiles.push(config.extraCACerts);
|
|
1801
|
+
config.extraCACerts = config.extraCACerts.replace(/^(\.[.]?\/)+/, "");
|
|
1802
|
+
}
|
|
1796
1803
|
return config;
|
|
1797
1804
|
}
|
|
1798
1805
|
async function normalizeConfig(config, overrides) {
|
|
@@ -2793,7 +2800,10 @@ async function login(options) {
|
|
|
2793
2800
|
`Please visit the following URL to login:
|
|
2794
2801
|
${chalkLink(authorizationCodeResult.url)}`
|
|
2795
2802
|
);
|
|
2796
|
-
|
|
2803
|
+
try {
|
|
2804
|
+
await open_default(authorizationCodeResult.url);
|
|
2805
|
+
} catch (e) {
|
|
2806
|
+
}
|
|
2797
2807
|
const getPersonalAccessTokenSpinner = spinner();
|
|
2798
2808
|
getPersonalAccessTokenSpinner.start("Waiting for you to login");
|
|
2799
2809
|
try {
|
|
@@ -4202,7 +4212,8 @@ ${authorization.error}`
|
|
|
4202
4212
|
buildPlatform: options.buildPlatform,
|
|
4203
4213
|
pushImage: options.push,
|
|
4204
4214
|
selfHostedRegistry: !!options.registry,
|
|
4205
|
-
noCache: options.noCache
|
|
4215
|
+
noCache: options.noCache,
|
|
4216
|
+
extraCACerts: resolvedConfig.config.extraCACerts
|
|
4206
4217
|
});
|
|
4207
4218
|
}
|
|
4208
4219
|
if (!deploymentResponse.data.externalBuildData) {
|
|
@@ -4226,7 +4237,8 @@ ${authorization.error}`
|
|
|
4226
4237
|
projectRef: resolvedConfig.config.project,
|
|
4227
4238
|
loadImage: options.loadImage,
|
|
4228
4239
|
buildPlatform: options.buildPlatform,
|
|
4229
|
-
noCache: options.noCache
|
|
4240
|
+
noCache: options.noCache,
|
|
4241
|
+
extraCACerts: resolvedConfig.config.extraCACerts
|
|
4230
4242
|
},
|
|
4231
4243
|
deploymentSpinner
|
|
4232
4244
|
);
|
|
@@ -4443,6 +4455,14 @@ Did you include it in config.additionalFiles? ${cliLink(
|
|
|
4443
4455
|
docs.config.prisma
|
|
4444
4456
|
)}`
|
|
4445
4457
|
},
|
|
4458
|
+
{
|
|
4459
|
+
regex: /@prisma\/client did not initialize yet/,
|
|
4460
|
+
message: `Prisma client not initialized yet.
|
|
4461
|
+
Did you forget to add the postinstall script? ${cliLink(
|
|
4462
|
+
"Config docs",
|
|
4463
|
+
docs.config.prisma
|
|
4464
|
+
)}`
|
|
4465
|
+
},
|
|
4446
4466
|
{
|
|
4447
4467
|
regex: /sh: 1: (?<packageOrBinary>.*): not found/,
|
|
4448
4468
|
message: `$packageOrBinary not found
|
|
@@ -4563,6 +4583,7 @@ async function buildAndPushImage(options, updater) {
|
|
|
4563
4583
|
`TRIGGER_CONTENT_HASH=${options.contentHash}`,
|
|
4564
4584
|
"--build-arg",
|
|
4565
4585
|
`TRIGGER_PROJECT_REF=${options.projectRef}`,
|
|
4586
|
+
...options.extraCACerts ? ["--build-arg", `NODE_EXTRA_CA_CERTS=${options.extraCACerts}`] : [],
|
|
4566
4587
|
"-t",
|
|
4567
4588
|
`${options.registryHost}/${options.imageTag}`,
|
|
4568
4589
|
".",
|
|
@@ -4653,6 +4674,7 @@ async function buildAndPushSelfHostedImage(options) {
|
|
|
4653
4674
|
`TRIGGER_CONTENT_HASH=${options.contentHash}`,
|
|
4654
4675
|
"--build-arg",
|
|
4655
4676
|
`TRIGGER_PROJECT_REF=${options.projectRef}`,
|
|
4677
|
+
...options.extraCACerts ? ["--build-arg", `NODE_EXTRA_CA_CERTS=${options.extraCACerts}`] : [],
|
|
4656
4678
|
"-t",
|
|
4657
4679
|
imageRef,
|
|
4658
4680
|
"."
|
|
@@ -5707,20 +5729,31 @@ var BackgroundWorker = class {
|
|
|
5707
5729
|
}, 2e4);
|
|
5708
5730
|
child.on("message", async (msg) => {
|
|
5709
5731
|
const message = this._handler.parseMessage(msg);
|
|
5710
|
-
if (message.
|
|
5732
|
+
if (!message.success) {
|
|
5711
5733
|
clearTimeout(timeout);
|
|
5712
5734
|
resolved = true;
|
|
5713
|
-
|
|
5735
|
+
reject(new Error(`Failed to parse message: ${message.error}`));
|
|
5714
5736
|
child.kill();
|
|
5715
|
-
|
|
5737
|
+
return;
|
|
5738
|
+
}
|
|
5739
|
+
if (message.data.type === "TASKS_READY" && !resolved) {
|
|
5716
5740
|
clearTimeout(timeout);
|
|
5717
5741
|
resolved = true;
|
|
5718
|
-
|
|
5742
|
+
resolve6(message.data.payload.tasks);
|
|
5719
5743
|
child.kill();
|
|
5720
|
-
} else if (message.type === "
|
|
5744
|
+
} else if (message.data.type === "UNCAUGHT_EXCEPTION") {
|
|
5721
5745
|
clearTimeout(timeout);
|
|
5722
5746
|
resolved = true;
|
|
5723
|
-
reject(
|
|
5747
|
+
reject(
|
|
5748
|
+
new UncaughtExceptionError(message.data.payload.error, message.data.payload.origin)
|
|
5749
|
+
);
|
|
5750
|
+
child.kill();
|
|
5751
|
+
} else if (message.data.type === "TASKS_FAILED_TO_PARSE") {
|
|
5752
|
+
clearTimeout(timeout);
|
|
5753
|
+
resolved = true;
|
|
5754
|
+
reject(
|
|
5755
|
+
new TaskMetadataParseError(message.data.payload.zodIssues, message.data.payload.tasks)
|
|
5756
|
+
);
|
|
5724
5757
|
child.kill();
|
|
5725
5758
|
}
|
|
5726
5759
|
});
|
|
@@ -6123,9 +6156,13 @@ var TaskRunProcess = class {
|
|
|
6123
6156
|
}
|
|
6124
6157
|
async #handleMessage(msg) {
|
|
6125
6158
|
const message = this._handler.parseMessage(msg);
|
|
6126
|
-
|
|
6159
|
+
if (!message.success) {
|
|
6160
|
+
logger.error(`Dropping message: ${message.error}`, { message });
|
|
6161
|
+
return;
|
|
6162
|
+
}
|
|
6163
|
+
switch (message.data.type) {
|
|
6127
6164
|
case "TASK_RUN_COMPLETED": {
|
|
6128
|
-
const { result, execution } = message.payload;
|
|
6165
|
+
const { result, execution } = message.data.payload;
|
|
6129
6166
|
logger.debug(`[${this.runId}] task run completed`, {
|
|
6130
6167
|
result
|
|
6131
6168
|
});
|
|
@@ -6151,7 +6188,7 @@ var TaskRunProcess = class {
|
|
|
6151
6188
|
if (this.messageId) {
|
|
6152
6189
|
this.onTaskRunHeartbeat.post(this.messageId);
|
|
6153
6190
|
} else {
|
|
6154
|
-
this.onTaskHeartbeat.post(message.payload.id);
|
|
6191
|
+
this.onTaskHeartbeat.post(message.data.payload.id);
|
|
6155
6192
|
}
|
|
6156
6193
|
break;
|
|
6157
6194
|
}
|
|
@@ -6460,10 +6497,14 @@ function useDev({
|
|
|
6460
6497
|
`${dashboardUrl}/projects/v3/${config.project}`
|
|
6461
6498
|
);
|
|
6462
6499
|
websocket.addEventListener("open", async (event) => {
|
|
6500
|
+
logger.debug("WebSocket opened", { event });
|
|
6463
6501
|
});
|
|
6464
6502
|
websocket.addEventListener("close", (event) => {
|
|
6503
|
+
logger.debug("WebSocket closed", { event });
|
|
6465
6504
|
});
|
|
6466
6505
|
websocket.addEventListener("error", (event) => {
|
|
6506
|
+
logger.log(`${chalkError("WebSocketError:")} ${event.error.message}`);
|
|
6507
|
+
logger.debug("WebSocket error", { event, rawError: event.error });
|
|
6467
6508
|
});
|
|
6468
6509
|
backgroundWorkerCoordinator.onWorkerTaskHeartbeat.attach(
|
|
6469
6510
|
async ({ worker, backgroundWorkerId, id }) => {
|
|
@@ -6521,29 +6562,40 @@ function useDev({
|
|
|
6521
6562
|
});
|
|
6522
6563
|
});
|
|
6523
6564
|
websocket.addEventListener("message", async (event) => {
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6565
|
+
try {
|
|
6566
|
+
const data = JSON.parse(
|
|
6567
|
+
typeof event.data === "string" ? event.data : new TextDecoder("utf-8").decode(event.data)
|
|
6568
|
+
);
|
|
6569
|
+
const messageHandler = new ZodMessageHandler2({
|
|
6570
|
+
schema: serverWebsocketMessages,
|
|
6571
|
+
messages: {
|
|
6572
|
+
SERVER_READY: async (payload) => {
|
|
6573
|
+
for (const worker of backgroundWorkerCoordinator.currentWorkers) {
|
|
6574
|
+
await sender.send("READY_FOR_TASKS", {
|
|
6575
|
+
backgroundWorkerId: worker.id,
|
|
6576
|
+
inProgressRuns: worker.worker.inProgressRuns
|
|
6577
|
+
});
|
|
6578
|
+
}
|
|
6579
|
+
},
|
|
6580
|
+
BACKGROUND_WORKER_MESSAGE: async (payload) => {
|
|
6581
|
+
await backgroundWorkerCoordinator.handleMessage(
|
|
6582
|
+
payload.backgroundWorkerId,
|
|
6583
|
+
payload.data
|
|
6584
|
+
);
|
|
6536
6585
|
}
|
|
6537
|
-
},
|
|
6538
|
-
BACKGROUND_WORKER_MESSAGE: async (payload) => {
|
|
6539
|
-
await backgroundWorkerCoordinator.handleMessage(
|
|
6540
|
-
payload.backgroundWorkerId,
|
|
6541
|
-
payload.data
|
|
6542
|
-
);
|
|
6543
6586
|
}
|
|
6587
|
+
});
|
|
6588
|
+
await messageHandler.handleMessage(data);
|
|
6589
|
+
} catch (error) {
|
|
6590
|
+
if (error instanceof Error) {
|
|
6591
|
+
logger.error("Error while handling websocket message", { error: error.message });
|
|
6592
|
+
} else {
|
|
6593
|
+
logger.error(
|
|
6594
|
+
"Unkown error while handling websocket message, use `-l debug` for additional output"
|
|
6595
|
+
);
|
|
6596
|
+
logger.debug("Error while handling websocket message", { error });
|
|
6544
6597
|
}
|
|
6545
|
-
}
|
|
6546
|
-
await messageHandler.handleMessage(data);
|
|
6598
|
+
}
|
|
6547
6599
|
});
|
|
6548
6600
|
let ctx;
|
|
6549
6601
|
let firstBuild = true;
|