Fix improve handling of Launch deployment file upload size errors , avoid duplicate env-var prompt & duplicate choice list and upgrade packages#139
Conversation
fix: improve handling of Launch deployment file upload size errors
fix: bump lodash to v4.18.1
chore: bump @contentstack/cli-command and cli-utilities
fix: avoid duplicate env-var prompt & duplicate choice list
chore: bump @contentstack/cli-command and cli-utilities
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
There was a problem hiding this comment.
Pull request overview
This PR improves the CLI Launch experience by detecting Launch deployment file-upload size related GraphQL errors and surfacing a clearer user-facing message, while also addressing prompt/choice duplication behavior and upgrading dependencies.
Changes:
- Add a utility to extract Launch deployment error codes from GraphQL errors and detect file-size related failures.
- Update deployment/project-creation error handling to show a targeted file-size guidance message (and log raw errors at debug).
- Bump CLI dependencies (including lodash) and add a stdin max-listeners adjustment to reduce listener warning noise during interactive flows.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/util/deployment-errors.ts | New helper to collect GraphQL error codes and detect file-size related deployment failures; defines user-facing guidance message. |
| src/util/deployment-errors.test.ts | Unit tests for error-code collection and file-size error detection. |
| src/base-command.ts | Adjusts process.stdin max listeners for TTY sessions during command initialization. |
| src/adapters/base-class.ts | Uses the new detection to print a file-size specific message in deployment + project-creation error flows; removes an incorrect checkbox default. |
| src/adapters/base-class.test.ts | Adds tests covering new deployment error-handling behavior. |
| package.json | Version bump and dependency upgrades (cli-command, cli-utilities, lodash) plus overrides update. |
| package-lock.json | Lockfile updates reflecting dependency upgrades. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,54 @@ | |||
| export const FILE_UPLOAD_SIZE_LIMIT_USER_MESSAGE = | |||
| 'Please use a file over the size of 1KB and under the size of 100MB.'; | |||
There was a problem hiding this comment.
The user-facing guidance string is a bit awkward/ambiguous (“use a file over the size of 1KB…”). Consider rephrasing to something clearer like “Please upload a file between 1KB and 100MB.” so it’s easier to understand and doesn’t imply strict exclusivity. (Update the unit test assertion accordingly.)
| 'Please use a file over the size of 1KB and under the size of 100MB.'; | |
| 'Please upload a file between 1KB and 100MB.'; |
fix: improve handling of Launch deployment file upload size errors
fix: bump lodash to 4.18.1
chore: bump @contentstack/cli-command and cli-utilities
fix: avoid duplicate env-var prompt & duplicate choice list
chore: upgrade @contentstack/cli-command and cli-utilities version