fix: handle empty server command input properly#73
Merged
SakshiKoli-CS merged 1 commit intodevelopmentfrom Nov 18, 2025
Merged
Conversation
dhruvparekh12
previously approved these changes
Nov 18, 2025
12ab693 to
2ff1f9c
Compare
There was a problem hiding this comment.
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.
2dad60d to
f549b9a
Compare
dhruvparekh12
previously approved these changes
Nov 18, 2025
tejas-contentstack
previously approved these changes
Nov 18, 2025
f549b9a to
c703cd2
Compare
93a1222
c703cd2 to
93a1222
Compare
venky0195
approved these changes
Nov 18, 2025
AryanBansal-launch
approved these changes
Nov 18, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: handle empty server command input properly