Skip to content

Conversation

@Harshi-Shah-CS
Copy link
Contributor

fix: handle empty server command input properly

@Harshi-Shah-CS Harshi-Shah-CS requested a review from a team as a code owner November 18, 2025 12:15
dhruvparekh12
dhruvparekh12 previously approved these changes Nov 18, 2025
Copy link

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 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
File Description
src/adapters/github.ts Updated createNewProject to conditionally include serverCommand using spread operator; refactored prepareForNewProjectCreation to validate and conditionally set serverCommand from user input
src/adapters/file-upload.ts Applied same serverCommand handling logic as github adapter - conditional inclusion in mutation and validated assignment from user input
src/adapters/github.test.ts Added test suite covering server command prompt behavior across different scenarios: framework support, empty input, provided flags, and missing framework
src/adapters/file-upload.test.ts Added comprehensive test suite for file upload adapter mirroring github adapter test coverage for server command handling
AGENTS.md Added 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.

dhruvparekh12
dhruvparekh12 previously approved these changes Nov 18, 2025
@SakshiKoli-CS SakshiKoli-CS merged commit 61dfabf into development Nov 18, 2025
6 of 7 checks passed
@SakshiKoli-CS SakshiKoli-CS deleted the cl-2125 branch November 18, 2025 19:54
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.

7 participants