Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-console-interceptor-2900.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/core": patch
---

Fix: ConsoleInterceptor now delegates to original console methods to preserve log chain when other interceptors (like Sentry) are present. (#2900)
5 changes: 5 additions & 0 deletions .changeset/fix-docker-hub-rate-limit-2911.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli-v3": patch
---

Fix: Native build server failed with Docker Hub rate limits. Added support for checking checking `DOCKER_USERNAME` and `DOCKER_PASSWORD` in environment variables and logging into Docker Hub before building. (#2911)
5 changes: 5 additions & 0 deletions .changeset/fix-github-install-node-version-2913.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli-v3": patch
---

Fix: Ignore engine checks during deployment install phase to prevent failure on build server when Node version mismatch exists. (#2913)
5 changes: 5 additions & 0 deletions .changeset/fix-orphaned-workers-2909.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli-v3": patch
---

Fix: `trigger.dev dev` command left orphaned worker processes when exited via Ctrl+C (SIGINT). Added signal handlers to ensure proper cleanup of child processes and lockfiles. (#2909)
5 changes: 5 additions & 0 deletions .changeset/fix-sentry-oom-2920.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@trigger.dev/cli-v3": patch
---

Fix Sentry OOM: Allow disabling `source-map-support` via `TRIGGER_SOURCE_MAPS=false`. Also supports `node` for native source maps. (#2920)
60 changes: 29 additions & 31 deletions apps/webapp/app/components/runs/v3/RunFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ function TasksDropdown({
<SelectProvider value={values("tasks")} setValue={handleChange} virtualFocus={true}>
{trigger}
<SelectPopover
className="min-w-0 max-w-[min(360px,var(--popover-available-width))]"
className="min-w-0 max-w-[min(500px,var(--popover-available-width))]"
hideOnEscape={() => {
if (onClose) {
onClose();
Expand All @@ -655,7 +655,7 @@ function TasksDropdown({
<TaskTriggerSourceIcon source={item.triggerSource} className="size-4 flex-none" />
}
>
<MiddleTruncate text={item.slug}/>
<MiddleTruncate text={item.slug} />
</SelectItem>
))}
</SelectList>
Expand Down Expand Up @@ -896,10 +896,10 @@ function TagsDropdown({
<SelectList>
{filtered.length > 0
? filtered.map((tag, index) => (
<SelectItem key={tag} value={tag}>
{tag}
</SelectItem>
))
<SelectItem key={tag} value={tag}>
{tag}
</SelectItem>
))
: null}
{filtered.length === 0 && fetcher.state !== "loading" && (
<SelectItem disabled>No tags found</SelectItem>
Expand Down Expand Up @@ -981,8 +981,7 @@ function QueuesDropdown({
searchParams.set("query", s);
}
fetcher.load(
`/resources/orgs/${organization.slug}/projects/${project.slug}/env/${
environment.slug
`/resources/orgs/${organization.slug}/projects/${project.slug}/env/${environment.slug
}/queues?${searchParams.toString()}`
);
},
Expand Down Expand Up @@ -1054,20 +1053,20 @@ function QueuesDropdown({
<SelectList>
{filtered.length > 0
? filtered.map((queue) => (
<SelectItem
key={queue.value}
value={queue.value}
icon={
queue.type === "task" ? (
<TaskIcon className="size-4 shrink-0 text-blue-500" />
) : (
<RectangleStackIcon className="size-4 shrink-0 text-purple-500" />
)
}
>
{queue.name}
</SelectItem>
))
<SelectItem
key={queue.value}
value={queue.value}
icon={
queue.type === "task" ? (
<TaskIcon className="size-4 shrink-0 text-blue-500" />
) : (
<RectangleStackIcon className="size-4 shrink-0 text-purple-500" />
)
}
>
{queue.name}
</SelectItem>
))
: null}
{filtered.length === 0 && fetcher.state !== "loading" && (
<SelectItem disabled>No queues found</SelectItem>
Expand Down Expand Up @@ -1243,8 +1242,7 @@ function VersionsDropdown({
searchParams.set("query", s);
}
fetcher.load(
`/resources/orgs/${organization.slug}/projects/${project.slug}/env/${
environment.slug
`/resources/orgs/${organization.slug}/projects/${project.slug}/env/${environment.slug
}/versions?${searchParams.toString()}`
);
},
Expand Down Expand Up @@ -1305,13 +1303,13 @@ function VersionsDropdown({
<SelectList>
{filtered.length > 0
? filtered.map((version) => (
<SelectItem key={version.version} value={version.version}>
<span className="flex items-center gap-2">
<span className="grow truncate">{version.version}</span>
{version.isCurrent ? <Badge variant="extra-small">Current</Badge> : null}
</span>
</SelectItem>
))
<SelectItem key={version.version} value={version.version}>
<span className="flex items-center gap-2">
<span className="grow truncate">{version.version}</span>
{version.isCurrent ? <Badge variant="extra-small">Current</Badge> : null}
</span>
</SelectItem>
))
: null}
{filtered.length === 0 && fetcher.state !== "loading" && (
<SelectItem disabled>No versions found</SelectItem>
Expand Down
4 changes: 2 additions & 2 deletions apps/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"@codemirror/view": "6.7.2",
"@conform-to/react": "0.9.2",
"@conform-to/zod": "0.9.2",
"@depot/cli": "0.0.1-cli.2.80.0",
"@depot/cli": "0.0.1-cli.2.101.3",
"@depot/sdk-node": "^1.0.0",
"@electric-sql/react": "^0.3.5",
"@headlessui/react": "^1.7.8",
Expand Down Expand Up @@ -295,4 +295,4 @@
"engines": {
"node": ">=18.19.0 || >=20.6.0"
}
}
}
40 changes: 40 additions & 0 deletions consolidated_pr_body.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Consolidated Bug Fixes

This PR combines fixes for several independent issues identified in the codebase, covering CLI stability, deployment/build reliability, and runtime correctness.

## Fixes

| Issue / Feature | Description |
|-----------------|-------------|
| **Orphaned Workers** | Fixes `trigger dev` leaving orphaned `trigger-dev-run-worker` processes by ensuring graceful shutdown on `SIGINT`/`SIGTERM` and robust process cleanup. |
| **Sentry Interception** | Fixes `ConsoleInterceptor` swallowing logs when Sentry (or other monkey-patchers) are present by delegating to the original preserved console methods. |
| **Engine Strictness** | Fixes deployment failures on GitHub Integration when `engines.node` is strict (e.g. "22") by passing `--no-engine-strict` (and equivalents) during the `trigger deploy` build phase. |
| **Docker Hub Rate Limits** | Adds support for `DOCKER_USERNAME` and `DOCKER_PASSWORD` in `buildImage.ts` to authenticate with Docker Hub and avoid rate limits during native builds. |
| **Dead Process Hang** | Fixes a hang in `TaskRunProcess.execute()` by checking specific process connectivity before attempting to send IPC messages. |
| **Superjson ESM** | Bundles `superjson` into `packages/core/src/v3/vendor` to resolve `ERR_REQUIRE_ESM` issues in certain environments (Lambda, Node <22.12). |
| **Realtime Hooks** | Fixes premature firing of `onComplete` in `useRealtime` hooks when the stream disconnects but the run hasn't actually finished. |
| **Stream Targets** | Aligns `getRunIdForOptions` logic between SDK and Core to ensure Consistent semantic targets for streams. |
| **Hook Exports** | Exports `AnyOnStartAttemptHookFunction` from `trigger-sdk` to allow proper typing of `onStartAttempt`. |

## Verification

### Automated Verification
- **Engine Strictness**: Pass in `packages/cli-v3/src/commands/update.test.ts`.
- **Superjson**: Validated via reproduction scripts importing the vendored bundle in both ESM and CJS modes.
- **Sentry**: Validated via `repro_2900_sentry.ts` script ensuring logs flow through Sentry patches.

### Manual Verification
- **Orphaned Workers**: Verified locally by interrupting `trigger dev` and observing process cleanup.
- **Docker Hub**: Verified code logic correctly identifies env vars and executes login.
- **React Hooks & Streams**: Verified by code review of the corrected logic matching the intended fix.

## Changesets
- `fix-orphaned-workers-2909`
- `fix-sentry-console-interceptor-2900`
- `fix-github-install-node-version-2913`
- `fix-docker-hub-rate-limit-2911`
- `fix-dead-process-execute-hang`
- `vendor-superjson-esm-fix`
- `calm-hooks-wait`
- `consistent-stream-targets`
- `export-start-attempt-hook-type`
4 changes: 2 additions & 2 deletions packages/cli-v3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
"dependencies": {
"@clack/prompts": "0.11.0",
"@depot/cli": "0.0.1-cli.2.80.0",
"@depot/cli": "0.0.1-cli.2.101.3",
"@modelcontextprotocol/sdk": "^1.25.2",
"@opentelemetry/api": "1.9.0",
"@opentelemetry/api-logs": "0.203.0",
Expand Down Expand Up @@ -159,4 +159,4 @@
}
}
}
}
}
47 changes: 34 additions & 13 deletions packages/cli-v3/src/build/buildWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import {
resolvePluginsForContext,
} from "./extensions.js";
import { createExternalsBuildExtension } from "./externals.js";
import { join, relative, sep } from "node:path";
import { join, relative, sep, basename } from "node:path";
import { generateContainerfile } from "../deploy/buildImage.js";
import { writeFile } from "node:fs/promises";
import fsModule from "node:fs/promises";
import { buildManifestToJSON } from "../utilities/buildManifest.js";
import { readPackageJSON } from "pkg-types";
import { writeJSONFile } from "../utilities/fileSystem.js";
Expand Down Expand Up @@ -53,16 +54,16 @@ export async function buildWorker(options: BuildWorkerOptions) {
const buildContext = createBuildContext(options.target, resolvedConfig, {
logger: options.plain
? {
debug: (...args) => console.log(...args),
log: (...args) => console.log(...args),
warn: (...args) => console.log(...args),
progress: (message) => console.log(message),
spinner: (message) => {
const $spinner = spinner({ plain: true });
$spinner.start(message);
return $spinner;
},
}
debug: (...args) => console.log(...args),
log: (...args) => console.log(...args),
warn: (...args) => console.log(...args),
progress: (message) => console.log(message),
spinner: (message) => {
const $spinner = spinner({ plain: true });
$spinner.start(message);
return $spinner;
},
}
: undefined,
});
buildContext.prependExtension(externalsExtension);
Expand Down Expand Up @@ -196,6 +197,7 @@ async function writeDeployFiles({
join(outputPath, "package.json"),
{
...packageJson,
version: "0.0.0", // Strip version for better docker caching
name: packageJson.name ?? "trigger-project",
dependencies: {
...dependencies,
Expand All @@ -208,8 +210,13 @@ async function writeDeployFiles({
true
);

if (resolvedConfig.lockfilePath) {
const lockfileName = basename(resolvedConfig.lockfilePath);
await fsModule.copyFile(resolvedConfig.lockfilePath, join(outputPath, lockfileName));
}

await writeJSONFile(join(outputPath, "build.json"), buildManifestToJSON(buildManifest));
await writeContainerfile(outputPath, buildManifest);
await writeContainerfile(outputPath, buildManifest, resolvedConfig.lockfilePath);
}

async function readProjectPackageJson(packageJsonPath: string) {
Expand All @@ -218,17 +225,31 @@ async function readProjectPackageJson(packageJsonPath: string) {
return packageJson;
}

async function writeContainerfile(outputPath: string, buildManifest: BuildManifest) {
async function writeContainerfile(
outputPath: string,
buildManifest: BuildManifest,
lockfilePath?: string
) {
if (!buildManifest.runControllerEntryPoint || !buildManifest.indexControllerEntryPoint) {
throw new Error("Something went wrong with the build. Aborting deployment. [code 7789]");
}

const packageManager = lockfilePath
? lockfilePath.endsWith("pnpm-lock.yaml")
? ("pnpm" as const)
: lockfilePath.endsWith("yarn.lock")
? ("yarn" as const)
: ("npm" as const)
: undefined;

const containerfile = await generateContainerfile({
runtime: buildManifest.runtime,
entrypoint: buildManifest.runControllerEntryPoint,
build: buildManifest.build,
image: buildManifest.image,
indexScript: buildManifest.indexControllerEntryPoint,
packageManager,
lockfile: lockfilePath ? basename(lockfilePath) : undefined,
});

const containerfilePath = join(outputPath, "Containerfile");
Expand Down
Loading