Skip to content

Commit 3136574

Browse files
fix(desktop): unblock Linux deb/rpm CI and Windows selftest hang (#97)
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> ## Problem `desktop-v1.0.1` workflow run [33196314686](https://github.com/DeepSQLAI/deepsql/actions/runs/33196314686): | Job | Result | Root cause | |-----|--------|------------| | **Linux** | Failed | `.deb` build: `Please specify project homepage` (electron-builder FpmTarget) | | **Windows** | Cancelled after ~6h | `selftest:tunnel` passed but process never exited — `fs.rmSync` threw `ENOTEMPTY` on temp dir before `app.exit()` | | **macOS** | Success | — | | **Release attach** | Skipped | Blocked by Linux failure | ## Fix 1. **`desktop/package.json`** — add `homepage` + `repository` (required for `.deb`/`.rpm` metadata); bump to **1.0.2** 2. **`desktop/scripts/tunnel-selftest.js`** — await server close, retry temp cleanup, `.catch()` → `app.exit(1)` so CI never hangs 3. **`.github/workflows/desktop-release.yml`** — `apt-get install rpm` on ubuntu-latest (needed for `.rpm` target) ## Verification Local (Linux runner equivalent): - `npm test` — 4/4 pass - `xvfb-run npm run selftest:tunnel` — 14/14 checks, clean exit - `electron-builder --linux` — AppImage + deb (amd64/arm64) + rpm built for v1.0.2 ## After merge Push tag to trigger installers: ```bash git tag -a desktop-v1.0.2 -m "DeepSQL Desktop v1.0.2" git push origin desktop-v1.0.2 ``` <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-8ce91e70-c67b-48c6-84b3-05bb9d06231a?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a>&nbsp;<a href="https://cursor.com/background-agent?bcId=bc-8ce91e70-c67b-48c6-84b3-05bb9d06231a&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a>&nbsp;</div> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
1 parent cca0d1a commit 3136574

4 files changed

Lines changed: 37 additions & 5 deletions

File tree

.github/workflows/desktop-release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ jobs:
5858
run: ${{ matrix.os == 'ubuntu-latest' && 'xvfb-run --auto-servernum npm run selftest:tunnel' || 'npm run selftest:tunnel' }}
5959
shell: bash
6060

61+
- name: Install Linux packaging tools
62+
if: matrix.os == 'ubuntu-latest'
63+
# electron-builder's rpm target shells out to rpmbuild; ubuntu-latest
64+
# runners do not ship it by default.
65+
run: sudo apt-get update && sudo apt-get install -y rpm
66+
6167
- name: Build installers
6268
working-directory: desktop
6369
env:

desktop/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# DeepSQL Desktop
22

3-
**Version 1.0.0** — first public Desktop cut (ships with DeepSQL product `v1.3.0`).
3+
**Version 1.0.2** — first public Desktop cut (ships with DeepSQL product `v1.3.0`).
44

55
A cross-platform desktop client for a self-hosted DeepSQL server. It connects to
66
the VM (or bare metal) running the DeepSQL stack either **directly over TLS** or

desktop/package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
{
22
"name": "deepsql-desktop",
33
"productName": "DeepSQL",
4-
"version": "1.0.0",
4+
"version": "1.0.2",
55
"private": true,
66
"description": "DeepSQL desktop client \u2014 connect to a self-hosted DeepSQL VM over TLS or an SSH tunnel.",
7+
"homepage": "https://github.com/DeepSQLAI/deepsql",
8+
"repository": {
9+
"type": "git",
10+
"url": "https://github.com/DeepSQLAI/deepsql.git",
11+
"directory": "desktop"
12+
},
713
"license": "Apache-2.0",
814
"author": {
915
"name": "DeepSQL",

desktop/scripts/tunnel-selftest.js

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,23 @@ app.whenReady().then(async () => {
224224
check('missing key file is reported clearly', keyError?.code === 'key-unreadable', keyError?.code);
225225

226226
// ── 5. Teardown ────────────────────────────────────────────────────────
227-
sshServer.close();
228-
upstream.close();
229-
fs.rmSync(tmpDir, { recursive: true, force: true });
227+
await closeServer(sshServer);
228+
await closeServer(upstream);
229+
try {
230+
// Windows can still have Electron file handles open on userData when we
231+
// rmSync synchronously; retry briefly so CI doesn't hang after the checks
232+
// pass (observed as ENOTEMPTY + no exit on windows-latest).
233+
fs.rmSync(tmpDir, { recursive: true, force: true, maxRetries: 5, retryDelay: 200 });
234+
} catch (err) {
235+
process.stderr.write(`WARN: temp cleanup: ${err.message}\n`);
236+
}
230237

231238
const failed = results.filter((r) => !r.ok).length;
232239
process.stdout.write(`\n${results.length - failed}/${results.length} checks passed\n`);
233240
app.exit(failed === 0 ? 0 : 1);
241+
}).catch((err) => {
242+
process.stderr.write(`${err?.stack || err}\n`);
243+
app.exit(1);
234244
});
235245

236246
function makeProfile({ keyPath, sshPort, upstreamPort }) {
@@ -291,6 +301,16 @@ function listen(server, port, host) {
291301
});
292302
}
293303

304+
function closeServer(server) {
305+
return new Promise((resolve) => {
306+
if (!server || !server.listening) {
307+
resolve();
308+
return;
309+
}
310+
server.close(() => resolve());
311+
});
312+
}
313+
294314
function portIsFree(port) {
295315
return new Promise((resolve) => {
296316
const socket = net.connect(port, '127.0.0.1');

0 commit comments

Comments
 (0)