Skip to content

fix: handle empty server command input properly - #73

Merged
SakshiKoli-CS merged 1 commit into
developmentfrom
cl-2125
Nov 18, 2025
Merged

fix: handle empty server command input properly#73
SakshiKoli-CS merged 1 commit into
developmentfrom
cl-2125

Conversation

@Harshi-Shah-CS

Copy link
Copy Markdown
Contributor

fix: handle empty server command input properly

@Harshi-Shah-CS
Harshi-Shah-CS requested a review from a team as a code ownerNovember 18, 2025 12:15
dhruvparekh12
dhruvparekh12 previously approved these changes Nov 18, 2025
Comment threadAGENTS.md Outdated

CopilotAI left a comment

Copy link
Copy Markdown

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 fixes the handling of empty server command input by properly validating user input and conditionally including the serverCommand field in project creation requests. Instead of always setting a default value ('npm run start'), the code now only includes serverCommand when it has a non-empty value.

Key Changes

  • Modified server command handling to use conditional spread operator, only including serverCommand in GraphQL mutations when it's non-empty after trimming
  • Refactored server command prompt logic to check for empty input and only set config.serverCommand when a valid value is provided
  • Added comprehensive test coverage for server command scenarios including empty input, whitespace handling, framework support checks, and flag-based configuration

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 8 comments.

Show a summary per file
FileDescription
src/adapters/github.tsUpdated createNewProject to conditionally include serverCommand using spread operator; refactored prepareForNewProjectCreation to validate and conditionally set serverCommand from user input
src/adapters/file-upload.tsApplied same serverCommand handling logic as github adapter - conditional inclusion in mutation and validated assignment from user input
src/adapters/github.test.tsAdded test suite covering server command prompt behavior across different scenarios: framework support, empty input, provided flags, and missing framework
src/adapters/file-upload.test.tsAdded comprehensive test suite for file upload adapter mirroring github adapter test coverage for server command handling
AGENTS.mdAdded testing guideline to use only jest for writing test cases and reference existing unit tests

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadAGENTS.md Outdated
Comment threadsrc/adapters/github.ts Outdated
Comment threadsrc/adapters/file-upload.ts Outdated
Comment threadsrc/adapters/github.ts Outdated
Comment threadsrc/adapters/file-upload.ts Outdated
Comment threadsrc/adapters/github.ts Outdated
Comment threadsrc/adapters/github.ts Outdated
Comment threadsrc/adapters/file-upload.ts Outdated
dhruvparekh12
dhruvparekh12 previously approved these changes Nov 18, 2025
Comment threadAGENTS.md Outdated
tejas-contentstack
tejas-contentstack previously approved these changes Nov 18, 2025
@SakshiKoli-CS
SakshiKoli-CS merged commit 61dfabf into developmentNov 18, 2025
6 of 7 checks passed
@SakshiKoli-CS
SakshiKoli-CS deleted the cl-2125 branch November 18, 2025 19:54
Sign up for freeto 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.

7 participants

@Harshi-Shah-CS@venky0195@dhruvparekh12@tejas-contentstack@AryanBansal-launch@SakshiKoli-CS