Skip to content

Commit 0ab9ba3

Browse files
ajitpratap0Ajit Pratap Singhclaude
authored
feat: VS Code Marketplace publishing with bundled binaries (#362)
* ci: add GitHub Actions workflow for VSCode extension publishing Cross-compiles gosqlx for 5 platforms (linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64), packages platform-specific VSIXs, and publishes atomically to VS Code Marketplace on tag push. Runs in parallel with existing release.yml (GoReleaser). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(vscode): add getBinaryPath() with bundled binary resolution Resolves binary using fallback chain: user setting → bundled → PATH. Updates startLanguageServer and analyzeCommand to use new resolver. Supports platform-specific binary bundling for Marketplace publishing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * docs(vscode): add 1.10.1 changelog entry for Marketplace publishing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(vscode): bump version to 1.10.1, default to bundled binary Change executablePath default from 'gosqlx' to '' (empty = use bundled). Backward compatible: falls back to PATH lookup if no bundled binary found. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore(vscode): update ignore files for binary bundling Include bin/ in VSIX package, exclude from git. Exclude out/test/ from published VSIX. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: bump version to 1.10.1 for VS Code Marketplace publishing Updates version across all Go source files, docs, and configuration. Adds CHANGELOG entry for v1.10.1 with VS Code Marketplace details. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(vscode): upgrade vsce to v3 and remove broken minimatch override The minimatch@10 override caused vsce@2 to fail with "(0 , minimatch_1.default) is not a function". Upgrading to @vscode/vsce@3.7.1 resolves the issue and removes the need for the minimatch override entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * refactor(vscode): clean up getBinaryPath() return type and platform handling - Return type simplified from Promise<string | undefined> to Promise<string> since the function always returns a value (PATH fallback is guaranteed) - Remove redundant || 'gosqlx' at call sites - Use fs.constants.F_OK on Windows (no Unix execute bits) - Remove redundant empty string check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): publish each VSIX individually and add safety checks - Loop over vsix files instead of glob expansion (vsce may not handle multiple --packagePath args from shell glob correctly) - Add VSCE_PAT presence check before publish step - Add semver format validation for tag-derived version - Remove empty overrides block from package.json Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(ci): add job timeouts and improve binary resolution logging Add timeout-minutes to build (15m) and publish (10m) jobs to prevent hangs. Log when bundled binary check fails for easier debugging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test(vscode): add unit tests for getBinaryPath() binary resolution Extract getBinaryPath() into utils/binaryResolver.ts for testability. Tests cover: user setting priority, bundled binary detection, PATH fallback, Windows .exe handling, and platform-specific checks. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: trim whitespace in user binary path and document VSCE_PAT scope - Trim whitespace from executablePath setting to handle accidental spaces - Add VSCE_PAT documentation comment to workflow with setup instructions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat(vscode): add caching, telemetry, force-PATH setting, and checksum validation 1. Cache: getBinaryPath() caches resolved path; invalidated on config change and server restart via clearBinaryPathCache(). 2. Telemetry: Records binarySource (user-setting/bundled/path-lookup) and checksumValid on each resolution for tracking usage patterns. 3. Force PATH setting: New gosqlx.forcePathLookup boolean setting skips bundled binary, useful for development with locally built binaries. 4. Checksum validation: Bundled binary verified against .sha256 sidecar file generated during CI build. Warns on mismatch, skips gracefully if sidecar is missing. Includes 30+ new tests covering all four features. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Ajit Pratap Singh <ajitpratapsingh@Ajits-Mac-mini-2655.local> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent fd62d1a commit 0ab9ba3

19 files changed

Lines changed: 2297 additions & 357 deletions

File tree

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Publish VSCode Extension
2+
# Publishes platform-specific VSIXs to the VS Code Marketplace on tag push.
3+
# Runs in parallel with release.yml (GoReleaser).
4+
#
5+
# Required secret:
6+
# VSCE_PAT - Azure DevOps Personal Access Token with "Marketplace (Manage)" scope.
7+
# Create at: https://dev.azure.com → User Settings → Personal Access Tokens
8+
# Scope: "Marketplace (Manage)", Organization: "All accessible organizations"
9+
10+
on:
11+
push:
12+
tags:
13+
- 'v*'
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
build:
20+
name: Build VSIX (${{ matrix.target }})
21+
runs-on: ubuntu-latest
22+
timeout-minutes: 15
23+
strategy:
24+
matrix:
25+
include:
26+
- target: linux-x64
27+
goos: linux
28+
goarch: amd64
29+
binary: gosqlx
30+
- target: linux-arm64
31+
goos: linux
32+
goarch: arm64
33+
binary: gosqlx
34+
- target: darwin-x64
35+
goos: darwin
36+
goarch: amd64
37+
binary: gosqlx
38+
- target: darwin-arm64
39+
goos: darwin
40+
goarch: arm64
41+
binary: gosqlx
42+
- target: win32-x64
43+
goos: windows
44+
goarch: amd64
45+
binary: gosqlx.exe
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Setup Go
50+
uses: actions/setup-go@v5
51+
with:
52+
go-version: '1.24'
53+
54+
- name: Cross-compile binary
55+
env:
56+
GOOS: ${{ matrix.goos }}
57+
GOARCH: ${{ matrix.goarch }}
58+
run: |
59+
mkdir -p vscode-extension/bin
60+
go build -ldflags="-s -w" -o "vscode-extension/bin/${{ matrix.binary }}" ./cmd/gosqlx
61+
62+
- name: Generate binary checksum
63+
run: |
64+
sha256sum "vscode-extension/bin/${{ matrix.binary }}" | awk '{print $1}' > "vscode-extension/bin/${{ matrix.binary }}.sha256"
65+
66+
- name: Smoke test binary
67+
if: matrix.target == 'linux-x64'
68+
run: |
69+
chmod +x vscode-extension/bin/${{ matrix.binary }}
70+
./vscode-extension/bin/${{ matrix.binary }} version
71+
72+
- name: Setup Node
73+
uses: actions/setup-node@v4
74+
with:
75+
node-version: '20'
76+
77+
- name: Install dependencies
78+
working-directory: vscode-extension
79+
run: npm ci
80+
81+
- name: Patch version from tag
82+
working-directory: vscode-extension
83+
run: |
84+
VERSION="${GITHUB_REF_NAME#v}"
85+
if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
86+
echo "Tag '$GITHUB_REF_NAME' does not produce a valid semver: '$VERSION'"
87+
exit 1
88+
fi
89+
npm version "$VERSION" --no-git-tag-version
90+
91+
- name: Package VSIX
92+
working-directory: vscode-extension
93+
run: npx vsce package --target ${{ matrix.target }}
94+
95+
- name: Upload VSIX artifact
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: vsix-${{ matrix.target }}
99+
path: vscode-extension/*.vsix
100+
101+
publish:
102+
name: Publish to Marketplace
103+
needs: build
104+
runs-on: ubuntu-latest
105+
timeout-minutes: 10
106+
steps:
107+
- name: Setup Node
108+
uses: actions/setup-node@v4
109+
with:
110+
node-version: '20'
111+
112+
- name: Install vsce
113+
run: npm install -g @vscode/vsce
114+
115+
- name: Download all VSIX artifacts
116+
uses: actions/download-artifact@v4
117+
with:
118+
pattern: vsix-*
119+
merge-multiple: true
120+
path: vsix
121+
122+
- name: Verify VSCE_PAT is set
123+
run: |
124+
if [ -z "$VSCE_PAT" ]; then
125+
echo "Error: VSCE_PAT secret is not configured"
126+
exit 1
127+
fi
128+
env:
129+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
130+
131+
- name: Publish all platforms
132+
env:
133+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
134+
run: |
135+
for vsix in vsix/*.vsix; do
136+
echo "Publishing $vsix..."
137+
vsce publish --packagePath "$vsix"
138+
done

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to GoSQLX will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.10.1] - 2026-03-13 — VS Code Marketplace Publishing
9+
10+
### ✨ New Features
11+
- **VS Code Extension on Marketplace**: Extension now published with bundled platform-specific binaries
12+
- 5 platforms: linux-x64, linux-arm64, darwin-x64, darwin-arm64, win32-x64
13+
- Smart binary resolution: bundled → user setting → PATH fallback
14+
- Automated CI publishing on every GoSQLX release tag
15+
16+
---
17+
818
## [1.10.0] - 2026-03-13 — MCP Server
919

1020
### ✨ New Features

cmd/gosqlx/cmd/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@
341341
//
342342
// Version information:
343343
//
344-
// Version = "1.10.0" - Current CLI version
344+
// Version = "1.10.1" - Current CLI version
345345
//
346346
// # Dependencies
347347
//

cmd/gosqlx/cmd/root.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import (
2828
// This version tracks feature releases and compatibility.
2929
// Format: MAJOR.MINOR.PATCH (Semantic Versioning 2.0.0)
3030
//
31-
// Version 1.10.0 includes:
31+
// Version 1.10.1 includes:
3232
// - MCP Server: All GoSQLX SQL capabilities as Model Context Protocol tools over streamable HTTP
3333
// - 7 MCP tools: validate_sql, format_sql, parse_sql, extract_metadata, security_scan, lint_sql, analyze_sql
3434
// - Optional bearer token auth via GOSQLX_MCP_AUTH_TOKEN
3535
// - Go minimum bumped to 1.23.0 (required by mark3labs/mcp-go)
36-
var Version = "1.10.0"
36+
var Version = "1.10.1"
3737

3838
var (
3939
// verbose enables detailed output for debugging and troubleshooting.
@@ -121,7 +121,7 @@ Key features:
121121
• CI/CD integration with proper exit codes
122122
123123
Performance: 1.5M+ operations/second sustained, 1.97M peak. 100-1000x faster than competitors.`,
124-
Version: "1.10.0",
124+
Version: "1.10.1",
125125
}
126126

127127
// Execute adds all child commands to the root command and sets flags appropriately.

cmd/gosqlx/doc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//
2525
// # Version
2626
//
27-
// Current version: 1.10.0
27+
// Current version: 1.10.1
2828
//
2929
// # Architecture
3030
//

doc.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// zero-copy tokenization and comprehensive object pooling. It offers enterprise-grade SQL lexing,
1717
// parsing, and AST generation with support for multiple SQL dialects and advanced SQL features.
1818
//
19-
// GoSQLX v1.10.0 includes both a powerful Go SDK and a high-performance CLI tool for SQL processing,
19+
// GoSQLX v1.10.1 includes both a powerful Go SDK and a high-performance CLI tool for SQL processing,
2020
// validated for production deployment with race-free concurrent operation and extensive real-world testing.
2121
//
2222
// Production Status: VALIDATED FOR PRODUCTION DEPLOYMENT (v1.6.0+)
@@ -278,6 +278,7 @@
278278
//
279279
// # Version History
280280
//
281+
// v1.10.1: VS Code Marketplace publishing with bundled platform-specific binaries
281282
// v1.10.0: MCP Server — all SQL tools as Model Context Protocol tools over streamable HTTP
282283
// v1.9.0: SQLite PRAGMA, tautology detection, 19 post-UAT fixes
283284
// v1.8.0: Multi-dialect engine, query transforms, WASM playground, AST-to-SQL roundtrip

llms.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ recursive-descent parsing, and AST generation with comprehensive object pooling.
77
PostgreSQL, MySQL, SQL Server, Oracle, SQLite, and Snowflake dialects, and ships a full-featured
88
CLI tool (`gosqlx`) for validation, formatting, linting, and security analysis. Apache-2.0 licensed.
99

10-
Current stable version: v1.10.0 (2026-03-13)
10+
Current stable version: v1.10.1 (2026-03-13)
1111

1212
## Core API
1313

performance_baselines.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "1.10.0",
2+
"version": "1.10.1",
33
"updated": "2026-03-13",
44
"baselines": {
55
"SimpleSelect": {

pkg/gosqlx/gosqlx.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import (
2828
)
2929

3030
// Version is the current GoSQLX library version.
31-
const Version = "1.10.0"
31+
const Version = "1.10.1"
3232

3333
// Parse tokenizes and parses SQL in one call, returning an Abstract Syntax Tree (AST).
3434
//

pkg/mcp/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func New(cfg *Config) *Server {
3535
s := &Server{cfg: cfg}
3636
s.mcpSrv = mcpserver.NewMCPServer(
3737
"gosqlx-mcp",
38-
"1.10.0",
38+
"1.10.1",
3939
mcpserver.WithToolCapabilities(false),
4040
)
4141
s.registerTools()

0 commit comments

Comments
 (0)