-
-
Notifications
You must be signed in to change notification settings - Fork 891
fix(mcp): don't require a trigger.config.ts file to be present when installing rules #2453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 5c2979a The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Walkthrough
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/cli-v3/src/commands/install-rules.ts (2)
148-153: Type mismatch:InstallRulesResultdoesn’t match actual shapeDownstream uses
result.installations, but the type here declaresconfigPath. Align the type to the returned object fromperformInstallForTarget.-type InstallRulesResult = { - configPath: string; - targetName: (typeof targets)[number]; -}; +type InstallRulesInstallation = { option: RulesManifestVersionOption; location: string }; +type InstallRulesResult = { + targetName: (typeof targets)[number]; + installations: Array<InstallRulesInstallation>; +};Optionally, type the accumulator in
installRules():const results: InstallRulesResult[] = [];
405-409: EscapesectionNamein the replacement regex
option.namemay contain regex metacharacters, which will break the pattern or match unintended regions.- const pattern = new RegExp( - `<!-- TRIGGER.DEV ${sectionName} START -->.*?<!-- TRIGGER.DEV ${sectionName} END -->`, - "gs" - ); + const pattern = new RegExp( + `<!-- TRIGGER.DEV ${escapeRegExp(sectionName)} START -->.*?<!-- TRIGGER.DEV ${escapeRegExp(sectionName)} END -->`, + "gs" + );Add helper:
function escapeRegExp(s: string) { return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); }
🧹 Nitpick comments (6)
packages/cli-v3/src/commands/install-rules.ts (6)
251-255: Nit:?? undefinedis redundantPassing
configdirectly is equivalent and clearer.- opts, - config ?? undefined + opts, + config
341-342: Prefix unusedconfigto satisfy lintersIt’s optional and unused; prefixing avoids no-unused-vars warnings without removing future flexibility.
- config?: ResolvedConfig + _config?: ResolvedConfig
356-357: Same: unusedconfigparam- config?: ResolvedConfig + _config?: ResolvedConfig
374-375: Same: unusedconfigparam- config?: ResolvedConfig + _config?: ResolvedConfig
501-502: Same: unusedconfigparam- config?: ResolvedConfig + _config?: ResolvedConfig
2-2: Use a type-only import forResolvedConfigPrevents bundlers from trying to include runtime code for a type-only dependency.
-import { ResolvedConfig } from "@trigger.dev/core/v3/build"; +import type { ResolvedConfig } from "@trigger.dev/core/v3/build";
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
.changeset/strong-taxis-clap.md(1 hunks)packages/cli-v3/src/commands/install-rules.ts(9 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
**/*.{ts,tsx}: Always prefer using isomorphic code like fetch, ReadableStream, etc. instead of Node.js specific code
For TypeScript, we usually use types over interfaces
Avoid enums
No default exports, use function declarations
Files:
packages/cli-v3/src/commands/install-rules.ts
🧠 Learnings (2)
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to trigger.config.ts : Provide a valid Trigger.dev configuration using defineConfig with project ref and dirs (e.g., ["./trigger"]; tests/specs auto-excluded)
Applied to files:
.changeset/strong-taxis-clap.md
📚 Learning: 2025-08-18T10:07:17.368Z
Learnt from: CR
PR: triggerdotdev/trigger.dev#0
File: .cursor/rules/writing-tasks.mdc:0-0
Timestamp: 2025-08-18T10:07:17.368Z
Learning: Applies to trigger.config.ts : Declare build options and extensions (external, jsx, conditions, extensions) via the build block in trigger.config.ts rather than custom scripts
Applied to files:
.changeset/strong-taxis-clap.md
🧬 Code graph analysis (1)
packages/cli-v3/src/commands/install-rules.ts (2)
packages/cli-v3/src/config.ts (1)
loadConfig(33-47)packages/cli-v3/src/rules/manifest.ts (2)
currentVersion(61-63)ManifestVersion(42-45)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (23)
- GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
- GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 8)
- GitHub Check: units / internal / 🧪 Unit Tests: Internal (8, 8)
- GitHub Check: units / internal / 🧪 Unit Tests: Internal (7, 8)
- GitHub Check: units / internal / 🧪 Unit Tests: Internal (6, 8)
- GitHub Check: units / internal / 🧪 Unit Tests: Internal (4, 8)
- GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
- GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
- GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
- GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (7, 8)
- GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
- GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
- GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
- GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
- GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
- GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
- GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
- GitHub Check: typecheck / typecheck
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
- GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
- GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
.changeset/strong-taxis-clap.md (1)
1-5: LGTM: clear patch noteAccurately describes the behavioral change (config no longer required during rule install).
packages/cli-v3/src/commands/install-rules.ts (2)
305-307: Approve safe parameter reorder
RG search located only internal call sites ininstall-rules.ts, confirming no external dependencies on the old signature.
28-28: ConfirmtryCatchimport and signature
@trigger.dev/core/utilsexports the asynctryCatch<T, E = Error>(promise: Promise<T> | undefined)function (packages/core/src/utils.ts), which accepts a Promise directly (not a thunk); usingtryCatch(loadConfig(...))here is correct.
No description provided.