Skip to content
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

Merged
merged 4 commits into from
Jan 17, 2025

Conversation

savageops
Copy link
Contributor

Relates to

Issue: Build failures on Windows platform

Risks

Low - Changes are isolated to build scripts and type definitions. No runtime behavior is affected.

  • Windows build script changes only affect local development on Windows

Background

What does this PR do?

  1. Fixes Windows compatibility in the client package build process
    • Adds Windows-compatible version.cmd script
    • Updates package.json to use the correct script path format

What kind of change is this?

  • Bug fixes (non-breaking change which fixes an issue)
    • Windows build compatibility

Documentation changes needed?

Yes - Added detailed documentation in CHANGELOG.md including:

  • Description of fixes
  • Development guidelines for cross-platform compatibility

Testing

Where should a reviewer start?

  1. Review the Windows compatibility changes:
    • client/version.cmd
    • client/package.json extract-version script to version.cmd

Detailed testing steps

  1. Test Windows Build Script:
cd client
pnpm run extract-version
# Verify src/info.json is created with correct version
  1. Test Full Build on Windows:
pnpm install
pnpm run build
# Verify all packages build successfully

Screenshots

Before

Build errors:

client:build: ERROR: command finished with error: command (D:\DESKTOP\Documents\GitHub\AGENTWOOD-ELIZA-FULL\client) exited (1)
'.' is not recognized as an internal or external command, operable program or batch file.

After

Successful build:

Tasks:    35 successful, 35 total
Cached:    0 cached, 35 total
Time:    48.703s

Deploy Notes

No special deployment steps required. Changes only affect local development environment and build process.

Database changes

None - Build script changes only

savageops and others added 2 commits January 17, 2025 15:33
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:
@wtfsayo wtfsayo changed the title Create version.cmd: Windows support feat: create version.cmd for windows support Jan 17, 2025
Copy link
Contributor

coderabbitai bot commented Jan 17, 2025

📝 Walkthrough

Walkthrough

A new batch script version.cmd has been introduced in the client directory to extract version information from a lerna.json file. The script performs version extraction by searching for the "version" key, validates its existence, and generates an info.json file in the src directory with the extracted version details. If any errors occur during the process, the script will exit with an error status.

Changes

File Change Summary
client/version.cmd New batch script added to extract version from lerna.json and create info.json with version information

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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:

  1. Making the error message more descriptive
  2. 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

📥 Commits

Reviewing files that changed from the base of the PR and between 94ee57b and 046ccaa.

📒 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:

  1. The JSON format changes
  2. Multiple "version" keys exist
  3. The value contains special characters

wtfsayo and others added 2 commits January 17, 2025 23:33
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@wtfsayo wtfsayo enabled auto-merge (squash) January 17, 2025 18:31
@wtfsayo wtfsayo self-requested a review January 17, 2025 18:40
@wtfsayo wtfsayo merged commit 24729ee into elizaOS:develop Jan 17, 2025
6 of 7 checks passed
@savageops savageops deleted the develop branch January 19, 2025 13:16
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.

2 participants