Skip to content

fix: correct profile name typo and init logic (#2542)#3221

Closed
deepshekhardas wants to merge 2 commits intotriggerdotdev:mainfrom
deepshekhardas:fix/cli-profile-flag-2542
Closed

fix: correct profile name typo and init logic (#2542)#3221
deepshekhardas wants to merge 2 commits intotriggerdotdev:mainfrom
deepshekhardas:fix/cli-profile-flag-2542

Conversation

@deepshekhardas
Copy link
Copy Markdown

Corrects DEFFAULT_PROFILE typo and fixes Suggester logic for profile flag.

deepshekhardas added 2 commits March 2, 2026 13:37
The CommonCommandOptions Zod schema used .default(readAuthConfigCurrentProfileName())
which evaluates the default profile at module load time. When a user passes
--profile <name>, the Zod schema already has the default value set and ignores
the CLI argument.

Changed to .optional().transform(v => v ?? readAuthConfigCurrentProfileName())
so the fallback is evaluated lazily at parse time, only when no --profile
flag is provided.

Fixes triggerdotdev#2542
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 15, 2026

⚠️ No Changeset found

Latest commit: 28d5ed4

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 @deepshekhardas, 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 Mar 15, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 15, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 600a5ade-f2a9-4b2c-9c47-3d3225e9d25e

📥 Commits

Reviewing files that changed from the base of the PR and between 7672e8d and 28d5ed4.

📒 Files selected for processing (4)
  • packages/cli-v3/src/cli/common.ts
  • packages/cli-v3/src/commands/init.ts
  • packages/cli-v3/src/utilities/configFiles.ts
  • packages/cli-v3/src/utilities/initialBanner.ts

Walkthrough

This pull request corrects a typo in a constant name from DEFFAULT_PROFILE to DEFAULT_PROFILE across multiple files and updates related code accordingly. It also modifies the profile option in the CLI to be optional with a transform that falls back to the current profile name when undefined, rather than requiring a default value at parse time. Additionally, the init command now conditionally displays the profile flag in the dev server startup message only when using a non-default profile.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Tip

CodeRabbit can use oxc to improve the quality of JavaScript and TypeScript code reviews.

Add a configuration file to your project to customize how CodeRabbit runs oxc.

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Devin Review found 2 potential issues.

View 1 additional finding in Devin Review.

Open in Devin Review

Comment on lines +260 to +261
`npx trigger.dev@${cliTag} dev${options.profile && options.profile !== "default" ? ` --profile ${options.profile}` : ""
}`
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.

🟡 Hardcoded "default" string instead of using DEFAULT_PROFILE constant

The new profile comparison on line 260 uses a hardcoded string "default" instead of importing and using the DEFAULT_PROFILE constant from packages/cli-v3/src/utilities/configFiles.ts:14. Every other comparison against the default profile name in the codebase uses the DEFAULT_PROFILE constant (e.g., packages/cli-v3/src/utilities/initialBanner.ts:18, packages/cli-v3/src/utilities/configFiles.ts:159). If the constant value were ever updated, this comparison would silently become inconsistent.

Prompt for agents
In packages/cli-v3/src/commands/init.ts, import DEFAULT_PROFILE from ../utilities/configFiles.js (add it to the existing import on line 42-44), then replace the hardcoded string "default" on line 260 with the DEFAULT_PROFILE constant:

Line 260 should change from:
  options.profile && options.profile !== "default" ? ...
to:
  options.profile && options.profile !== DEFAULT_PROFILE ? ...
Open in Devin Review

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

Comment on lines +16 to +19
profile: z
.string()
.optional()
.transform((v) => v ?? readAuthConfigCurrentProfileName()),
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.

🚩 Zod schema lazy evaluation partially defeated by eager Commander default

The Zod schema change at packages/cli-v3/src/cli/common.ts:16-19 defers the call to readAuthConfigCurrentProfileName() until parse time. However, the Commander option definition at packages/cli-v3/src/cli/common.ts:26 still eagerly calls readAuthConfigCurrentProfileName() during command configuration. When commands go through the normal Commander flow, Commander fills in the default before Zod parses the options, so the Zod transform's v ?? readAuthConfigCurrentProfileName() never triggers (since v is already a string from Commander). The lazy evaluation only benefits non-Commander code paths (e.g., direct calls to initCommand or other wrappers). This may or may not be the intended scope of the fix.

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.

1 participant