Skip to content

Conversation

@denis256
Copy link
Member

@denis256 denis256 commented Nov 12, 2025

Description

  • updated installation steps to handle updated checksum file
image

TODOs

Read the Gruntwork contribution guidelines.

  • I authored this code entirely myself
  • I am submitting code based on open source software (e.g. MIT, MPL-2.0, Apache)]
  • I am adding or upgrading a dependency or adapted code and confirm it has a compatible open source license
  • Update the docs.
  • Run the relevant tests successfully, including pre-commit checks.
  • Include release notes. If this PR is backward incompatible, include a migration guide.

Release Notes (draft)

Added / Removed / Updated [X].

Migration Guide

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of checksum verification during installation across different shells by enhancing parsing logic and variable handling to ensure accurate validation of downloaded binaries.

@vercel
Copy link

vercel bot commented Nov 12, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
terragrunt-docs Ready Ready Preview Comment Nov 12, 2025 1:52pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 12, 2025

📝 Walkthrough

Walkthrough

The 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

Cohort / File(s) Change Summary
Shell checksum extraction refinement
docs-starlight/src/components/InstallTab.astro
Updated PowerShell checksum extraction to split lines by whitespace and match on the second field. Updated Bash logic to escape runtime variables and use awk with strict filename matching via the -v parameter followed by quoted string comparison.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Shell script parsing logic requires careful verification of correctness and edge cases
  • Variable escaping changes need validation to ensure proper runtime behavior
  • Checksum matching logic changes are security-relevant and warrant thorough examination

Suggested reviewers

  • yhakbar

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete despite marking all TODOs as done; the Release Notes section contains only a placeholder '[X]' with no actual content, and the Migration Guide is empty despite claiming completion. Fill in the Release Notes with a concrete one-line description and add relevant migration guide information if applicable, rather than leaving placeholders.
Title check ❓ Inconclusive The title 'docs: installation steps update' is vague and overly broad, using generic phrasing that doesn't convey the specific technical change (checksum file handling updates). Consider a more specific title like 'docs: update checksum extraction for installation steps' to better reflect the actual changes made.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch install-docs-update

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@denis256 denis256 changed the title chore: updated installation steps docs: installation steps update Nov 12, 2025
@denis256 denis256 marked this pull request as ready for review November 12, 2025 13:56
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

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83ef549 and a33b2cf.

📒 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-starlight directory 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

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.

Suggested change
$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.

@denis256 denis256 merged commit 5c08330 into main Nov 12, 2025
50 checks passed
@denis256 denis256 deleted the install-docs-update branch November 12, 2025 14:54
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