Skip to content

Commit a6651a1

Browse files
committed
fix(vscode): cockpit stale build detection
v0.4.2 The build-status file watchers (pnpm-lock.yaml, requirements.txt, .git/HEAD, etc.) called refreshStatus() directly, which only updated the status bar's local snapshot. The cockpit reads state.buildStatus from the sidebar's state cache and kept showing the pre-change snapshot — most visibly, a fresh pnpm-lock.yaml flipped the status bar to "1 stale" while the cockpit's Builds row still said "all up to date". Mirror the onDidEndTaskProcess pattern: file-watcher events now call onBuildComplete (= refreshAll) when available, so the state cache, cockpit, and status bar pick up the new BuildStatus in step. AI-Generated: true Change-Id: Ia1d9751e6f515ceb2ae7c53dda4eb1cc90248aba
1 parent 367a127 commit a6651a1

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

.ide/vscode/changelog/v0.4.2.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## v0.4.2
2+
3+
- **fix**: cockpit stale build detection

.ide/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "cmk-vscode",
33
"displayName": "CMK Dev Tools for VS Code",
44
"description": "Build commands and helpers for Checkmk development",
5-
"version": "0.4.1",
5+
"version": "0.4.2",
66
"publisher": "checkmk",
77
"engines": {
88
"vscode": "^1.85.0"

.ide/vscode/src/build/buildStatus.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,14 @@ export function createStatusBar(
189189
const watcher = vscode.workspace.createFileSystemWatcher(
190190
new vscode.RelativePattern(wsPath, pattern)
191191
)
192+
const refresh = (): void => (onBuildComplete ? onBuildComplete() : refreshStatus())
192193
const handler = delay
193194
? () =>
194195
setTimeout(() => {
195-
refreshStatus()
196+
refresh()
196197
if (branchSwitch) void notifyBranchSwitch()
197198
}, delay)
198-
: () => refreshStatus()
199+
: () => refresh()
199200
if (events.includes('change')) watcher.onDidChange(handler)
200201
if (events.includes('create')) watcher.onDidCreate(handler)
201202
if (events.includes('delete')) watcher.onDidDelete(handler)

0 commit comments

Comments
 (0)