fix: CodeRabbit auto-fixes for PR #2 - #3
Conversation
Fixed 2 file(s) based on 3 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
|
Important Review skippedThis PR was authored by the user configured for CodeRabbit reviews. CodeRabbit does not review PRs authored by this user. It's recommended to use a dedicated user account to post CodeRabbit review feedback. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tools/code-intel-platform.psm1 (1)
160-164: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAppending unconditionally will accumulate duplicate lines for the same var over repeated runs.
Switching to
Add-Contentfixes the prior bug whereSet-Contentwiped out previously-persisted variables for other names. However, since there's no check for an existing$env:$Name = ...line, callingSet-CodeIntelUserEnvagain for the same$Name(e.g., re-running the installer) appends a new line rather than replacing the old one. Correctness is preserved (last line wins on dot-source) butenv.ps1grows unbounded with stale duplicate entries.♻️ Suggested fix: remove any prior assignment for the same name before appending
$envFile = Join-Path $configDir "env.ps1" $escaped = $Value.Replace("'", "''") - "`$env:$Name = '$escaped'" | Add-Content -LiteralPath $envFile -Encoding UTF8 + if (Test-Path -LiteralPath $envFile) { + $existing = Get-Content -LiteralPath $envFile | Where-Object { $_ -notmatch "^\`$env:$Name\s*=" } + Set-Content -LiteralPath $envFile -Value $existing -Encoding UTF8 + } + "`$env:$Name = '$escaped'" | Add-Content -LiteralPath $envFile -Encoding UTF8🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tools/code-intel-platform.psm1` around lines 160 - 164, Set-CodeIntelUserEnv currently appends a new assignment every time, so repeated runs create duplicate stale entries in env.ps1. Update the Set-CodeIntelUserEnv flow around $configDir, $envFile, and the final Add-Content write so it first removes any existing `$env:$Name = ...` line for the same variable name before appending the new value. Keep the existing Add-Content behavior for preserving other variables, but ensure the env.ps1 file stays deduplicated per $Name.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tools/code-intel-platform.psm1`:
- Around line 160-164: Set-CodeIntelUserEnv currently appends a new assignment
every time, so repeated runs create duplicate stale entries in env.ps1. Update
the Set-CodeIntelUserEnv flow around $configDir, $envFile, and the final
Add-Content write so it first removes any existing `$env:$Name = ...` line for
the same variable name before appending the new value. Keep the existing
Add-Content behavior for preserving other variables, but ensure the env.ps1 file
stays deduplicated per $Name.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1a5d685a-49f1-43b7-a591-ff93696de030
📒 Files selected for processing (2)
install-code-intel-pipeline.ps1tools/code-intel-platform.psm1
c1e3155 to
6b6f0cb
Compare
|
Superseded: PR #2 was rebased onto main's current architecture (per ADR 0005, the Ponytail-vendoring commits were dropped) and merged directly. This branch's history no longer applies; closing as superseded. |
This stacked PR contains CodeRabbit auto-fixes for #2.
Files modified:
install-code-intel-pipeline.ps1tools/code-intel-platform.psm1