Skip to content

Fix update check for catalog protocol deps#3982

Closed
RitwijParmar wants to merge 1 commit into
triggerdotdev:mainfrom
RitwijParmar:codex/trigger-catalog-version-update-check
Closed

Fix update check for catalog protocol deps#3982
RitwijParmar wants to merge 1 commit into
triggerdotdev:mainfrom
RitwijParmar:codex/trigger-catalog-version-update-check

Conversation

@RitwijParmar

Copy link
Copy Markdown

Summary

  • fixes the embedded update check crash when @trigger.dev packages use unresolved package-manager protocol specs like catalog:
  • keeps resolving installed package versions first, so catalog/workspace users still get checks when node_modules can provide the real version
  • skips unresolved package-manager protocol specs instead of passing them to semver
  • guards downgrade detection so a future non-semver specifier cannot throw Invalid comparator
  • adds regression coverage for catalog:, workspace:, file:, link:, normal semver mismatch, and downgrade detection

Fixes #3905

Checks

  • bunx prettier@3.5.3 --check packages/cli-v3/src/commands/update.ts packages/cli-v3/src/commands/update.test.ts
  • git diff --check

I tried bunx vitest run packages/cli-v3/src/commands/update.test.ts, but the local runner failed before tests started because the temporary Rolldown native binding was rejected by macOS code signing. I could not use pnpm here because the shell has no pnpm binary and the bundled pnpm entrypoint hung on --version.

@changeset-bot

changeset-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e6ca6fc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

Hi @RitwijParmar, thanks for your interest in contributing!

This project requires that pull request authors are vouched, and you are not in the list of vouched users.

This PR will be closed automatically. See https://github.com/triggerdotdev/trigger.dev/blob/main/CONTRIBUTING.md for more details.

@github-actions github-actions Bot closed this Jun 17, 2026
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8f61c8e9-0a1c-4593-94be-ce9a22b921bc

📥 Commits

Reviewing files that changed from the base of the PR and between d34b699 and e6ca6fc.

📒 Files selected for processing (2)
  • packages/cli-v3/src/commands/update.test.ts
  • packages/cli-v3/src/commands/update.ts

Walkthrough

The update.ts command gains a packageManagerProtocolFilter regex that matches specifiers beginning with protocols like catalog:, workspace:, file:, link:, etc. The Dependency type and getVersionMismatches function are now exported. getVersionMismatches adds an explicit guard to skip downgrade checks when the installed specifier is not a valid semver range, logging a debug message in that case. getTriggerDependencies drops the previous hard-coded workspace-prefix skip and replaces it with a unified flow: use the resolved local version when available, skip via the protocol filter when unresolved, or fall back to the raw specifier. A new Vitest file adds three tests covering these code paths.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

Open in Devin Review

Comment on lines +350 to +364
if ($version) {
deps.push({ type, name, version: $version });
continue;
}

if (packageManagerProtocolFilter.test(version)) {
logger.debug("Skipping unresolved package-manager dependency specifier", {
type,
name,
version,
});
continue;
}

deps.push({ type, name, version });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Behavioral change: workspace: deps are no longer unconditionally skipped

The old code at the removed lines unconditionally skipped any dependency whose version started with "workspace". The new code at update.ts:350-364 only skips protocol-prefixed versions when tryResolveTriggerPackageVersion returns undefined. In a real monorepo where workspace-linked @trigger.dev/* packages are installed in node_modules, nodeResolve.sync will resolve them successfully, so the resolved version will be used for mismatch comparison. If a mismatch is detected and the user confirms an update, mutatePackageJsonWithUpdatedPackages at update.ts:421 would overwrite the workspace:* specifier with a pinned version (e.g., "4.5.0"), silently breaking the monorepo's workspace linking. This is mitigated by the fact that (a) it requires explicit user confirmation, (b) end users rarely have workspace: deps for trigger.dev packages, and (c) in CI (!hasTTY) the command exits before any mutation. Still, monorepo users who do use workspace protocol for trigger.dev packages could be surprised by this change.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: CLI crashes with "Invalid comparator: catalog:" when @trigger.dev/* deps use workspace catalogs (bun/pnpm catalog: protocol)

1 participant