Skip to content

Conversation

@myftija
Copy link
Member

@myftija myftija commented Oct 31, 2025

Adds a useful message when the trigger.config.ts file isn't detected by
loadConfig() in various cli commands. Previously this would fail with
a misleading validation message, e.g., when users would run a command from the
wrong directory.

This will get rid of the dreaded Error: The "maxDuration" trigger.config option is now required, and must be at least 5 seconds. error reports which in almost all cases was actually a failure to detect the config file.

@changeset-bot
Copy link

changeset-bot bot commented Oct 31, 2025

🦋 Changeset detected

Latest commit: 1c31d98

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 23 packages
Name Type
trigger.dev Patch
d3-chat Patch
references-d3-openai-agents Patch
references-nextjs-realtime Patch
@trigger.dev/build Patch
@trigger.dev/core Patch
@trigger.dev/python Patch
@trigger.dev/react-hooks Patch
@trigger.dev/redis-worker Patch
@trigger.dev/rsc Patch
@trigger.dev/schema-to-json Patch
@trigger.dev/sdk Patch
@trigger.dev/database Patch
@trigger.dev/otlp-importer Patch
@internal/cache Patch
@internal/clickhouse Patch
@internal/redis Patch
@internal/replication Patch
@internal/run-engine Patch
@internal/schedule-engine Patch
@internal/testcontainers Patch
@internal/tracing Patch
@internal/zod-worker Patch

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 31, 2025

Walkthrough

A fallback error branch was added to resolveConfig in the CLI config module: if the config file is missing or set to the default "trigger.config", the function now throws an OutroCommandError with a user-facing message advising to run in the project directory, pass --config, or initialize a project. OutroCommandError was imported to support this path. A new changeset file .changeset/warm-eagles-itch.md was added documenting the patch release and the corrected CLI error message.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • One primary source file modified plus a changelog file
  • Small, focused error-handling addition and one import
  • No public API/signature changes

Areas to review:

  • Confirm the config-missing/default condition is correctly detected
  • Verify the OutroCommandError import resolves and usage aligns with existing error patterns
  • Check the user-facing error message for clarity and accuracy

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description provides clear context about the change and explains the problem it solves, but it does not follow the required template structure specified in the repository. The template requires specific sections including a checklist with items about following the contributing guide and testing the code, a dedicated "Testing" section, a "Changelog" section, and an issue reference with "Closes #". The provided description is written as freeform text and lacks these critical structural elements, particularly the checklist and testing documentation sections that are important for proper PR review. The description should be updated to follow the required template structure. Please add the checklist items confirming you followed the contributing guide and tested the code, provide a dedicated "Testing" section describing the steps taken to verify the fix works as intended, include the issue reference at the top with "Closes #", and organize the content using the template's section headings. While the content quality regarding the change itself is good, adhering to the template ensures consistency and helps reviewers verify that proper testing and process steps were followed.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title "fix(cli): show a useful error message when config file is missing" directly and clearly summarizes the main change in the changeset. The title accurately reflects the primary modification—adding improved error handling in resolveConfig to display a user-friendly message when the config file is missing. The title follows conventional commit format with the "fix(cli)" prefix and is concise without unnecessary noise, making it easy for teammates reviewing the git history to understand the change at a glance.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cli-config-file-not-found-error

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
.changeset/warm-eagles-itch.md (1)

5-5: Clarify the parenthetical phrase to avoid confusion.

The phrase ("maxDuration" is now required) is ambiguous and may mislead readers into thinking maxDuration became a required option. Consider rephrasing to make clear that this refers to the old error message that users would encounter, not a new requirement.

For example:

-Fixed misleading error message in the CLI when config file is missing ("maxDuration" is now required). A useful error message is now shown, including a hint about the `--config` flag.
+Fixed misleading error message in the CLI when config file is missing (previously surfaced as "maxDuration is now required"). A useful error message is now shown, including a hint about the `--config` flag.
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b223a5e and 665977b.

📒 Files selected for processing (1)
  • .changeset/warm-eagles-itch.md (1 hunks)
⏰ 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). (20)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (5, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (8, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (1, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (3, 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 (7, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (3, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (5, 8)
  • GitHub Check: units / internal / 🧪 Unit Tests: Internal (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (2, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (6, 8)
  • GitHub Check: units / webapp / 🧪 Unit Tests: Webapp (4, 8)
  • GitHub Check: units / packages / 🧪 Unit Tests: Packages (1, 1)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
  • GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
  • GitHub Check: typecheck / typecheck

@myftija myftija force-pushed the cli-config-file-not-found-error branch from 665977b to 1c31d98 Compare October 31, 2025 15:24
@myftija myftija merged commit 27376df into main Oct 31, 2025
30 checks passed
@myftija myftija deleted the cli-config-file-not-found-error branch October 31, 2025 15:34
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.

3 participants