Skip to content

Fix improve handling of Launch deployment file upload size errors , avoid duplicate env-var prompt & duplicate choice list and upgrade packages#139

Merged
Harshi-Shah-CS merged 10 commits intostagingfrom
development
Apr 21, 2026
Merged

Fix improve handling of Launch deployment file upload size errors , avoid duplicate env-var prompt & duplicate choice list and upgrade packages#139
Harshi-Shah-CS merged 10 commits intostagingfrom
development

Conversation

@Harshi-Shah-CS
Copy link
Copy Markdown
Contributor

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

@Harshi-Shah-CS Harshi-Shah-CS requested review from a team as code owners April 21, 2026 09:07
@github-actions
Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 0 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

✅ BUILD PASSED - All security checks passed

@Harshi-Shah-CS Harshi-Shah-CS merged commit 3365ab3 into staging Apr 21, 2026
8 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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.';
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

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

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.)

Suggested change
'Please use a file over the size of 1KB and under the size of 100MB.';
'Please upload a file between 1KB and 100MB.';

Copilot uses AI. Check for mistakes.
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.

6 participants