Skip to content

Update setup.ps1 - #349

Merged
AngeloTadeucci merged 1 commit into
MS2Community:masterfrom
mouzedrift:setup-update
Mar 7, 2025
Merged

Update setup.ps1#349
AngeloTadeucci merged 1 commit into
MS2Community:masterfrom
mouzedrift:setup-update

Conversation

@mouzedrift

@mouzedrift mouzedrift commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

this change removes the no longer needed navmesh step and adds new steps to download dotnet-ef as well as the customized server files

Summary by CodeRabbit

  • New Features
    • The setup now automatically installs a required tool and downloads updated server files, enhancing the installation experience.
  • Chores
    • The interactive confirmation step has been removed, streamlining the process for a more direct, automated setup.

@coderabbitai

coderabbitai Bot commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes simplify the setup process in the setup.ps1 script. A new command installs the dotnet-ef tool globally after the .NET version check and before creating the .env file. The script now bypasses all interactive prompts and logic related to navmesh generation, executing the dotnet run command directly instead. Finally, it downloads customized server files from specified GitHub URLs using Invoke-WebRequest after running the dotnet run command.

Changes

File Change Summary
setup.ps1 • Added command to install dotnet-ef globally after the .NET version check.
• Removed all navmesh generation prompts and conditional logic.
• Added steps to download customized server files from GitHub using Invoke-WebRequest following the dotnet run command.

Sequence Diagram(s)

sequenceDiagram
    participant S as setup.ps1
    participant NET as .NET Checker
    participant EF as dotnet-ef Installer
    participant RUN as Dotnet Runner
    participant GH as GitHub Server Files
    S->>NET: Check .NET version
    NET-->>S: Version validated
    S->>EF: Install dotnet-ef tool globally
    S->>S: Create .env file
    S->>RUN: Execute "dotnet run" (navmesh prompts removed)
    S->>GH: Download customized server files via Invoke-WebRequest
Loading

Suggested reviewers

  • Zintixx

Poem

I'm a bunny coding with glee,
Hopping through changes so merrily.
No more prompts to slow my pace,
Just smooth commands in this setup race.
With GitHub files and dotnet tools in sight,
My little paws code all through the night!
🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 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.
  • @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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 (3)
setup.ps1 (3)

41-42: Improve error handling for dotnet-ef tool installation

The script installs the dotnet-ef tool globally without checking if it's already installed, which could lead to error messages if the tool exists. Consider adding a check before installation and providing user feedback.

- dotnet tool install --global dotnet-ef
+ Write-Host "Installing dotnet-ef tool..." -ForegroundColor Blue
+ dotnet tool install --global dotnet-ef --verbosity quiet 2>$null || Write-Host "dotnet-ef is already installed." -ForegroundColor Green

142-143: Add comments explaining the dotnet run step

Now that the navmesh generation step has been removed, the purpose of this dotnet run command may not be clear to future maintainers. Consider adding a comment explaining what this command does.

# Run ingest
- dotnet run
+ # Run ingest (processes game files without navmesh generation)
+ Write-Host "Processing game files..." -ForegroundColor Blue
+ dotnet run
+ Write-Host "Processing complete!" -ForegroundColor Green

147-154: Verify file integrity after download

The script downloads server files but doesn't verify if the downloads were successful or if the files are valid. Consider adding a basic file size check to ensure the downloads completed properly.

+ # Add after the download loop
+ Write-Host "Verifying downloaded files..." -ForegroundColor Blue
+ $allFilesValid = $true
+ foreach ($file in $files) {
+     $filePath = Join-Path $dataPath $file.Name
+     if (Test-Path $filePath) {
+         $fileSize = (Get-Item $filePath).Length
+         if ($fileSize -lt 1024) { # Files should be at least 1KB
+             Write-Host "Warning: $($file.Name) seems too small ($fileSize bytes). It may be incomplete." -ForegroundColor Yellow
+             $allFilesValid = $false
+         }
+     } else {
+         Write-Host "Error: $($file.Name) was not downloaded successfully." -ForegroundColor Red
+         $allFilesValid = $false
+     }
+ }
+ 
+ if ($allFilesValid) {
+     Write-Host "All server files were downloaded successfully!" -ForegroundColor Green
+ } else {
+     Write-Host "Some server files may be missing or incomplete. The setup may not work correctly." -ForegroundColor Yellow
+ }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd483d5 and 5ae0542.

📒 Files selected for processing (1)
  • setup.ps1 (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build

Comment thread setup.ps1
@AngeloTadeucci
AngeloTadeucci merged commit aa35d2d into MS2Community:master Mar 7, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Mar 24, 2025
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.

3 participants