Skip to content

Fix the one-click installer finding no assets in any release - #6

Merged
mourier merged 1 commit into
mainfrom
fix/installer-release-asset-parsing
Sep 21, 2026
Merged

mourier merged 1 commit into
mainfrom
fix/installer-release-asset-parsing

Conversation

@mourier

@mourier mourier commented Sep 21, 2026 •

Copy link
Copy Markdown
Owner

The one-click installer has never been able to install any release. It fails with Release vX.Y.Z has no SqlPilot ZIP asset attached. while the release plainly has the ZIP.

Cause

GitHubReleaseClient.ExtractAssets found the "assets" array with a non-greedy regex that ended at the first ]. Every release built by the workflow is uploaded by github-actions[bot], and that bracket sits inside a string a few hundred characters into the first asset object — so the array body was cut off mid-object, the brace matcher found zero complete objects, and InstallEngine had nothing to download. Reproduced against the live v1.0.0 and v1.1.1 payloads. GitHubReleaseClient.cs is byte-identical to the v1.1.1 tag, so every shipped installer has this defect.

The self-update banner kept working because it only reads scalar fields.

Fix

Scan the array with a depth counter that skips over string literals instead of regex-matching it. Verified end to end: the real installer now downloads the v1.0.0 payload and installs into SSMS 18, 20 and 22.

Tests

New tests/SqlPilot.Installer.Tests (xUnit, FluentAssertions pinned <8.0 like the core tests) covering the github-actions[bot] case, URL/size extraction, picking the .zip over the .vsix that sorts first in v1.1.1, empty assets, and not reading past the end of the array. With the old algorithm restored, 4 of the 5 fail — the one that passes is the empty-assets case, which genuinely worked before. Added to SqlPilot.sln so CI builds it.

Summary by CodeRabbit

  • Bug Fixes

    • Improved installer release-asset detection so downloads continue to work when release metadata contains bracket characters in uploader details.
    • Ensured the installer selects the correct application package and preserves its download information.
  • Tests

    • Added automated coverage for release-asset parsing, package selection, empty asset lists, and unrelated metadata.
  • Documentation

    • Updated the architecture overview to include the installer test project.

ExtractAssets ended the "assets" array at the first "]" in the payload. Every
release built by the workflow is uploaded by "github-actions[bot]", and that
bracket sits inside a string a few hundred characters into the first asset, so
the array body was truncated mid-object, no asset survived the brace matcher,
and the installer refused every release with "has no SqlPilot ZIP asset
attached". Verified against the live v1.0.0 and v1.1.1 payloads.

Scan the array with a depth counter that skips over string literals instead of
regex-matching it. Confirmed end to end: the installer now downloads and
installs into SSMS 18, 20 and 22.

The self-update banner was unaffected because it only reads scalars.

Adds tests/SqlPilot.Installer.Tests to cover the parsing directly -- a silent
failure there means the installer downloads nothing, which is how this shipped.
@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b2a8a9d9-e005-4f63-9a9f-3dbee1b6c66f

📥 Commits

Reviewing files that changed from the base of the PR and between 348c0be and 7b6f2e7.

📒 Files selected for processing (6)
  • SqlPilot.sln
  • docs/ARCHITECTURE.md
  • src/SqlPilot.Installer/Services/GitHubReleaseClient.cs
  • src/SqlPilot.Installer/SqlPilot.Installer.csproj
  • tests/SqlPilot.Installer.Tests/GitHubReleaseAssetTests.cs
  • tests/SqlPilot.Installer.Tests/SqlPilot.Installer.Tests.csproj

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The installer now scans GitHub release asset arrays without stopping at ] characters inside strings. A new xUnit project tests parsing behavior and is registered in the solution and architecture documentation.

Changes

Installer asset parsing

Layer / File(s) Summary
Asset array scanning
src/SqlPilot.Installer/Services/GitHubReleaseClient.cs
ExtractAssets now uses character-by-character scanning with string, escape, and brace-depth tracking.
Parser test coverage
src/SqlPilot.Installer/SqlPilot.Installer.csproj, tests/SqlPilot.Installer.Tests/*
The test project targets net472, references the installer, accesses its internal parser, and verifies asset extraction and selection cases.
Project registration and documentation
SqlPilot.sln, docs/ARCHITECTURE.md
The installer test project is registered for Debug and Release configurations and listed under the tests solution folder and architecture documentation.

Priority: ⚪ Not assessed

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

Change: Bug fix

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (4 skipped: 4… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing the one-click installer so it can find release assets.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@mourier
mourier merged commit 3df4d73 into main Sep 21, 2026
2 checks passed
@mourier
mourier deleted the fix/installer-release-asset-parsing branch September 21, 2026 15:19
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.

1 participant