-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create version.cmd for windows support #2442
Conversation
Initial Error Investigation - Encountered build error in client package - Error indicated `version.sh` script couldn't be executed on Windows. Windows Script Compatibility Fix - Examined original `version.sh` shell script functionality - Created equivalent `version.cmd` batch script for Windows - Updated script to use Windows-compatible commands:
📝 WalkthroughWalkthroughA new batch script Changes
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
client/version.cmd (2)
4-9
: Enhance error message and verify path assumption.The relative path assumes the script is run from the client directory. Consider:
- Making the error message more descriptive
- Adding the full path in the error message
- echo Error: %LERNA_FILE% does not exist. + echo Error: lerna.json not found at '%cd%\%LERNA_FILE%'. Ensure you're running from the client directory.
15-18
: Add version format validation.Consider validating that the extracted version follows semantic versioning format.
+if not "!VERSION!"==!VERSION:^0-9.=! ( + echo Error: Invalid version format "!VERSION!". Expected semantic versioning (e.g., 1.2.3) + exit /b 1 +)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
client/version.cmd
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: integration-tests
- GitHub Check: smoke-tests
🔇 Additional comments (2)
client/version.cmd (2)
1-2
: LGTM! Proper batch script initialization.
11-13
: Improve JSON parsing reliability.The current parsing method might break if:
- The JSON format changes
- Multiple "version" keys exist
- The value contains special characters
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Relates to
Issue: Build failures on Windows platform
Risks
Low - Changes are isolated to build scripts and type definitions. No runtime behavior is affected.
Background
What does this PR do?
version.cmd
scriptWhat kind of change is this?
Documentation changes needed?
Yes - Added detailed documentation in CHANGELOG.md including:
Testing
Where should a reviewer start?
client/version.cmd
client/package.json
extract-version script toversion.cmd
Detailed testing steps
cd client pnpm run extract-version # Verify src/info.json is created with correct version
Screenshots
Before
Build errors:
After
Successful build:
Deploy Notes
No special deployment steps required. Changes only affect local development environment and build process.
Database changes
None - Build script changes only