From ed98bb57c06fcb54bef529ed341d915bf33dfc34 Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 28 Mar 2026 15:35:53 -0400 Subject: [PATCH 1/3] fix: categorize release notes into New Features / Bug Fixes, drop chores Co-Authored-By: Claude Sonnet 4.6 --- .gitea/workflows/release.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index e3eee39..3f4f336 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -79,7 +79,29 @@ jobs: - name: Create Gitea release run: | - python3 -c "import json,os; v=os.environ['VERSION']; img=os.environ['IMAGE']; notes=open('/tmp/release_notes.txt').read(); open('/tmp/release_body.json','w').write(json.dumps({'tag_name':'v'+v,'name':'Catalyst v'+v,'body':'### Changes\n\n'+notes+'\n\n### Image\n\n'+img+':'+v,'draft':False,'prerelease':False}))" + cat > /tmp/make_release.py << 'PYEOF' + import json, os + v = os.environ['VERSION'] + img = os.environ['IMAGE'] + raw = open('/tmp/release_notes.txt').read().strip() + feats, fixes = [], [] + for line in raw.splitlines(): + msg = line.lstrip('- ').strip() + if msg.startswith('feat:'): + feats.append('- ' + msg[5:].strip()) + elif msg.startswith('fix:'): + fixes.append('- ' + msg[4:].strip()) + sections = [] + if feats: + sections.append('### New Features\n\n' + '\n'.join(feats)) + if fixes: + sections.append('### Bug Fixes\n\n' + '\n'.join(fixes)) + notes = '\n\n'.join(sections) or '_No changes_' + body = notes + '\n\n### Image\n\n' + img + ':' + v + payload = {'tag_name': 'v'+v, 'name': 'Catalyst v'+v, 'body': body, 'draft': False, 'prerelease': False} + open('/tmp/release_body.json', 'w').write(json.dumps(payload)) + PYEOF + python3 /tmp/make_release.py curl -sf -X POST \ -H "Authorization: token ${{ secrets.TOKEN }}" \ -H "Content-Type: application/json" \ From d17f364fc57c2cbc847a0165ad069fc8e4cd7101 Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 28 Mar 2026 15:37:45 -0400 Subject: [PATCH 2/3] fix: clear instance history on delete and import deleteInstance now removes history rows for that vmid before removing the instance. importInstances clears all history before replacing instances. Prevents stale history appearing when a vmid is reused. Co-Authored-By: Claude Sonnet 4.6 --- server/db.js | 4 +++- tests/db.test.js | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/server/db.js b/server/db.js index bf0e99e..1eaf6ab 100644 --- a/server/db.js +++ b/server/db.js @@ -151,11 +151,13 @@ export function updateInstance(vmid, data) { } export function deleteInstance(vmid) { - return db.prepare('DELETE FROM instances WHERE vmid = ?').run(vmid); + db.prepare('DELETE FROM instance_history WHERE vmid = ?').run(vmid); + db.prepare('DELETE FROM instances WHERE vmid = ?').run(vmid); } export function importInstances(rows) { db.exec('BEGIN'); + db.exec('DELETE FROM instance_history'); db.exec('DELETE FROM instances'); const insert = db.prepare(` INSERT INTO instances diff --git a/tests/db.test.js b/tests/db.test.js index de5cef4..ee64d3a 100644 --- a/tests/db.test.js +++ b/tests/db.test.js @@ -164,6 +164,19 @@ describe('deleteInstance', () => { expect(getInstance(1)).toBeNull(); expect(getInstance(2)).not.toBeNull(); }); + + it('clears history for the deleted instance', () => { + createInstance({ ...base, name: 'a', vmid: 1 }); + deleteInstance(1); + expect(getInstanceHistory(1)).toHaveLength(0); + }); + + it('does not clear history for other instances', () => { + createInstance({ ...base, name: 'a', vmid: 1 }); + createInstance({ ...base, name: 'b', vmid: 2 }); + deleteInstance(1); + expect(getInstanceHistory(2).length).toBeGreaterThan(0); + }); }); // ── importInstances ─────────────────────────────────────────────────────────── @@ -183,6 +196,12 @@ describe('importInstances', () => { importInstances([]); expect(getInstances()).toEqual([]); }); + + it('clears history for all replaced instances', () => { + createInstance({ ...base, name: 'old', vmid: 1 }); + importInstances([{ ...base, name: 'new', vmid: 2 }]); + expect(getInstanceHistory(1)).toHaveLength(0); + }); }); // ── instance history ───────────────────────────────────────────────────────── From e796b4f4003d95be3948833e6213825973f5c9cc Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 28 Mar 2026 15:40:16 -0400 Subject: [PATCH 3/3] chore: release v1.3.1 Co-Authored-By: Claude Sonnet 4.6 --- js/version.js | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/version.js b/js/version.js index 538443c..cfcbe6a 100644 --- a/js/version.js +++ b/js/version.js @@ -1 +1 @@ -const VERSION = "1.3.0"; +const VERSION = "1.3.1"; diff --git a/package.json b/package.json index d04ccba..0862dbb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "catalyst", - "version": "1.3.0", + "version": "1.3.1", "type": "module", "scripts": { "start": "node server/server.js",