-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
docs: installation steps update #5091
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe InstallTab component updates checksum extraction logic in both PowerShell and Bash shell scripts. PowerShell extraction now uses whitespace splitting and field matching, while Bash extraction adds variable escaping and implements strict filename matching with awk and explicit string comparison. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs-starlight/src/components/InstallTab.astro(2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs-starlight/**/*.astro
⚙️ CodeRabbit configuration file
Review the Astro code in the
docs-starlightdirectory for quality and correctness. Make sure that the Astro code follows best practices and is easy to understand, maintain, and follows best practices. When possible, suggest improvements to the Astro code to make it better.
Files:
docs-starlight/src/components/InstallTab.astro
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: base_tests / Test (macos)
- GitHub Check: base_tests / Test (ubuntu)
| Invoke-WebRequest -Uri "$baseUrl/SHA256SUMS" -OutFile "SHA256SUMS" -UseBasicParsing | ||
| $actualChecksum = (Get-FileHash -Algorithm SHA256 $binaryName).Hash.ToLower() | ||
| $expectedChecksum = (Get-Content "SHA256SUMS" | Select-String -Pattern $binaryName).Line.Split()[0].ToLower() | ||
| $expectedChecksum = (Get-Content "SHA256SUMS" | ForEach-Object { $parts = $_ -split '\s+'; if ($parts[1] -eq $binaryName) { return $parts[0].ToLower() } } | Select-Object -First 1) |
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.
Critical: return aborts script before checksum check
Using return inside ForEach-Object exits the whole script once the match is found, so the checksum comparison (and subsequent success/error handling) never runs. Replace the return with emitting the value and let the pipeline handle selection.
- $expectedChecksum = (Get-Content "SHA256SUMS" | ForEach-Object { $parts = $_ -split '\s+'; if ($parts[1] -eq $binaryName) { return $parts[0].ToLower() } } | Select-Object -First 1)
+ $expectedChecksum = Get-Content "SHA256SUMS" |
+ ForEach-Object {
+ $parts = $_ -split '\s+'
+ if ($parts.Length -ge 2 -and $parts[1] -eq $binaryName) {
+ $parts[0].ToLower()
+ }
+ } |
+ Select-Object -First 1📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| $expectedChecksum = (Get-Content "SHA256SUMS" | ForEach-Object { $parts = $_ -split '\s+'; if ($parts[1] -eq $binaryName) { return $parts[0].ToLower() } } | Select-Object -First 1) | |
| $expectedChecksum = Get-Content "SHA256SUMS" | | |
| ForEach-Object { | |
| $parts = $_ -split '\s+' | |
| if ($parts.Length -ge 2 -and $parts[1] -eq $binaryName) { | |
| $parts[0].ToLower() | |
| } | |
| } | | |
| Select-Object -First 1 |
🤖 Prompt for AI Agents
In docs-starlight/src/components/InstallTab.astro around line 24, the
ForEach-Object block uses "return" which causes the entire script to exit when a
match is found; instead emit the checksum value into the pipeline (e.g., replace
"return $parts[0].ToLower()" with emitting the value via "$parts[0].ToLower()"
or "Write-Output $parts[0].ToLower()") so Select-Object can pick the first match
and the subsequent checksum comparison and success/error handling still run.
Description
TODOs
Read the Gruntwork contribution guidelines.
Release Notes (draft)
Added / Removed / Updated [X].
Migration Guide
Summary by CodeRabbit