-
-
Notifications
You must be signed in to change notification settings - Fork 701
Give helpful hint if you pass a bad directory when deploying #2013
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: d3c10af The changes in this PR will be included in the next version bump. 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 |
WalkthroughA patch update was made to the deployment command in the CLI, introducing validation for the directory argument. When the deploy command is invoked with a directory, the code now checks if the specified directory exists and is indeed a directory. If common mistaken directory names are used (such as "staging" or "prod"), the user is advised to use the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant CLI
participant FileSystem
User->>CLI: Run deploy command with directory argument
CLI->>FileSystem: Check if directory exists and is a directory
alt Directory does not exist or is not a directory
alt Argument is "staging", "prod", etc.
CLI-->>User: Show error - use --env flag
else Argument is another invalid directory
CLI-->>User: Show error - directory not found at path
end
else Directory is valid
CLI->>User: Proceed with deployment
end
Suggested reviewers
Poem
✨ Finishing Touches
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. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
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: 0
🧹 Nitpick comments (1)
.changeset/wet-steaks-reflect.md (1)
1-6
: Add a comma in the changeset description for better readability.The description would be more readable with a comma after "deploy".
-If you pass a directory when calling deploy we validate it exists and give helpful hints +If you pass a directory when calling deploy, we validate it exists and give helpful hints🧰 Tools
🪛 LanguageTool
[uncategorized] ~5-~5: Possible missing comma found.
Context: ...- If you pass a directory when calling deploy we validate it exists and give helpful ...(AI_HYDRA_LEO_MISSING_COMMA)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.changeset/wet-steaks-reflect.md
(1 hunks)packages/cli-v3/src/commands/deploy.ts
(2 hunks)
🧰 Additional context used
🪛 LanguageTool
.changeset/wet-steaks-reflect.md
[uncategorized] ~5-~5: Possible missing comma found.
Context: ...- If you pass a directory when calling deploy we validate it exists and give helpful ...
(AI_HYDRA_LEO_MISSING_COMMA)
⏰ Context from checks skipped due to timeout of 90000ms (7)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - pnpm)
- GitHub Check: e2e / 🧪 CLI v3 tests (windows-latest - npm)
- GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - pnpm)
- GitHub Check: e2e / 🧪 CLI v3 tests (ubuntu-latest - npm)
- GitHub Check: typecheck / typecheck
- GitHub Check: units / 🧪 Unit Tests
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (3)
packages/cli-v3/src/commands/deploy.ts (3)
37-37
: Good addition of isDirectory import.The import of
isDirectory
is used appropriately for the new validation functionality.
172-174
: Good setup for path resolution.Properly resolving project paths relative to the current working directory is essential for correct directory validation.
175-189
: Excellent user experience improvement with clear error messages.The implementation provides helpful, specific guidance when users make common mistakes with environment deployment. The error messages clearly explain what the user should do instead, which greatly improves the user experience.
- For common environment names like "staging" and "prod", users are guided to use the
--env
flag- Special cases like "production" → "prod" and "stg" → "staging" are handled with specific instructions
- For any other invalid directory, a clear error message shows the resolved path that was checked
This validation prevents confusing deployment errors that would occur later in the process.
Closes #1990
If you pass in a directory that isn't found, we tell you it doesn't exist and where we looked.
If you pass in
prod
staging
stg
orproduction
we tell you how you should be running the command:--env prod
or--env staging
. Please note you don't need to passprod
it's the default.