Skip to content

refactor: use shared extheartbeat instead of local heartbeat package#54

Merged
joshiste merged 1 commit into
mainfrom
refactor/use-extheartbeat
Jul 1, 2026
Merged

refactor: use shared extheartbeat instead of local heartbeat package#54
joshiste merged 1 commit into
mainfrom
refactor/use-extheartbeat

Conversation

@joshiste

@joshiste joshiste commented Jul 1, 2026

Copy link
Copy Markdown
Member

What

Switches preflight_kit_sdk to the shared extheartbeat watchdog from extension-kit (extension-kit#150, released v1.10.7) and deletes the local preflight_kit_sdk/v2/heartbeat package.

It was a byte-identical copy of action-kit's heartbeat monitor — the same concurrency bug had to be fixed in both (preflight-kit#52, action-kit#457). Sharing one implementation stops it diverging again. extension-kit was already a dependency, so no new module coupling. Companion to action-kit#458.

The re-Start monitor-leak fix from #52 (Swap-and-Stop the previous monitor) is preserved.

API impact

None. The local heartbeat package was SDK-internal (imported only by preflight_sdk.go, not by extensions). Clean removal, agreed.

Verification

  • extension-kit bumped to v1.10.7; local heartbeat package removed.
  • go build ./..., go vet ./..., go test -race ./... pass (module go/preflight_kit_sdk); existing stop/heartbeat/leak tests still pass.

Switch preflight_kit_sdk to extension-kit's extheartbeat watchdog (v1.10.7)
and delete the local heartbeat package — it was a byte-identical copy of
action-kit's, so sharing one implementation stops it diverging again. The
re-Start monitor leak fix from #52 is preserved (Swap-and-Stop). No API
impact: the local heartbeat package was SDK-internal.
@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Claude finished @joshiste's task in 2m 54s —— View job


Claude's Task List

  • Check for previously unresolved review threads from Claude on this PR (none found)
  • Gather context (diff, changed files)
  • Review new changes for bugs, security, concurrency, performance
  • Post final review feedback

Review

This is a clean, mechanical refactor — no functional/behavioral concerns.

  • go/preflight_kit_sdk/preflight_sdk.go: heartbeat.Notify/heartbeat.Monitor calls are swapped 1:1 for extheartbeat.Notify/extheartbeat.Monitor in monitorHeartbeatWithCallback, recordHeartbeat, and stopMonitorHeartbeat. The Swap-and-Stop logic from fix: prevent data races and panics in SDK stop/heartbeat handling #52 (preventing monitor leaks on repeated Start) and the LoadAndDelete-based idempotent stop are preserved verbatim.
  • The local heartbeat package (and its test file) is fully removed; git grep confirms no remaining references to preflight_kit_sdk/v2/heartbeat anywhere in the repo.
  • go.mod/go.sum are bumped consistently to extension-kit v1.10.7 (hash and go.mod hash both updated).
  • CHANGELOG.md entry accurately describes the change.
  • No API surface change, matching the PR description — the old package was SDK-internal.
  • CI (ci workflow: build/vet/test) passed on this commit, confirming the swap compiles and existing heartbeat/stop/leak tests still pass.

No bugs, security issues, or concurrency issues found in the diff itself.

@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@joshiste joshiste merged commit b23a1c8 into main Jul 1, 2026
6 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant