Skip to content

fix(semble): encode Windows archive extraction command - #1168

Merged
edelauna merged 1 commit into
mainfrom
fix/semble-windows-archive-extraction
Aug 6, 2026
Merged

fix(semble): encode Windows archive extraction command#1168
edelauna merged 1 commit into
mainfrom
fix/semble-windows-archive-extraction

Conversation

@navedmerchant

@navedmerchant navedmerchant commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fix Semble upgrades on Windows by passing ZIP extraction through PowerShell -EncodedCommand
  • safely quote archive and destination paths, including spaces and apostrophes
  • use the same reliable invocation for single-file ZIP extraction
  • add regression coverage and update affected managed-binary tests

Closes #1167

Validation

  • 59 focused tests passed; 1 platform-dependent test skipped
  • repository-wide lint passed in the pre-commit hook
  • repository-wide type checking passed in the pre-push hook

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of ZIP archive extraction on Windows.
    • Enhanced handling of file and folder paths containing spaces, special characters, or other characters requiring escaping.
    • Improved extraction of archives containing a single file.
  • Tests
    • Expanded coverage for Windows archive extraction scenarios and path handling.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c6ea7832-2951-4d67-96e4-b43dc1afce72

📥 Commits

Reviewing files that changed from the base of the PR and between 16d5946 and 3de030a.

📒 Files selected for processing (4)
  • src/services/code-index/semble/__tests__/semble-downloader.spec.ts
  • src/services/destructive-command-guard/__tests__/manager.spec.ts
  • src/services/managed-binary/__tests__/archive.spec.ts
  • src/services/managed-binary/archive.ts

📝 Walkthrough

Walkthrough

Windows ZIP extraction now runs quoted PowerShell scripts through -EncodedCommand. The scripts use UTF-16LE Base64 encoding and embed archive, destination, and file paths. Tests decode the commands and validate path escaping and extraction behavior.

Changes

Windows ZIP extraction

Layer / File(s) Summary
Encoded PowerShell extraction
src/services/managed-binary/archive.ts
Adds PowerShell quoting and UTF-16LE Base64 encoding. ZIP extraction embeds quoted paths and runs through a shared noninteractive PowerShell wrapper.
Extraction behavior validation
src/services/managed-binary/__tests__/archive.spec.ts, src/services/destructive-command-guard/__tests__/manager.spec.ts, src/services/code-index/semble/__tests__/semble-downloader.spec.ts
Updates Windows extraction assertions and mocks to decode encoded commands. Tests cover apostrophes, literal paths, embedded assignments, and single-file extraction.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested labels: awaiting-review

Suggested reviewers: edelauna

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the main change: encoding the Windows archive extraction command for Semble.
Description check ✅ Passed The description identifies the issue, summarizes the implementation, and provides validation results, although it omits the template checklist.
Linked Issues check ✅ Passed The changes address issue #1167 by using encoded PowerShell commands, safely handling paths, and covering both ZIP extraction flows.
Out of Scope Changes check ✅ Passed All changes are focused on the linked Windows ZIP extraction defect, related regression tests, and affected test updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/semble-windows-archive-extraction

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/services/code-index/semble/__tests__/semble-downloader.spec.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

src/services/destructive-command-guard/__tests__/manager.spec.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

src/services/managed-binary/__tests__/archive.spec.ts

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

  • 1 others

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.

@codecov

codecov Bot commented Aug 6, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions github-actions Bot added the awaiting-review PR changes are ready and waiting for maintainer re-review label Aug 6, 2026
@edelauna
edelauna added this pull request to the merge queue Aug 6, 2026
Merged via the queue into main with commit 19f306e Aug 6, 2026
16 checks passed
@edelauna
edelauna deleted the fix/semble-windows-archive-extraction branch August 6, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR changes are ready and waiting for maintainer re-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Windows Semble upgrade fails during archive extraction

2 participants