Add unit tests and context-based watcher cancellation for loopcheck removal#34
Merged
Merged
Conversation
Co-authored-by: powerkimhub <[email protected]>
Co-authored-by: powerkimhub <[email protected]>
Copilot
AI
changed the title
[WIP] Fix issue #1 by analyzing, planning, and implementing code changes
Replace busy-wait config polling with fsnotify event-driven watcher
Mar 20, 2026
Co-authored-by: powerkimhub <[email protected]>
Copilot
AI
changed the title
Replace busy-wait config polling with fsnotify event-driven watcher
Remove Mar 20, 2026
loopcheck config option — file watcher always active
…dConfig helper Co-authored-by: powerkimhub <[email protected]>
Copilot
AI
changed the title
Remove
Remove Mar 20, 2026
loopcheck config option — file watcher always activeloopcheck config option; watcher is always-on
Copilot
AI
changed the title
Remove
Add unit tests and context-based watcher cancellation for loopcheck removal
Mar 20, 2026
loopcheck config option; watcher is always-on
powerkimhub
approved these changes
Mar 20, 2026
Copilot stopped work on behalf of
powerkimhub due to an error
March 20, 2026 02:28
Copilot stopped work on behalf of
powerkimhub due to an error
March 20, 2026 02:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No
*_test.gofiles existed to validate the removal ofloopcheckand the switch to an always-on fsnotify watcher.Tests added (
cblogger_test.go)TestNewCBLOGCONFIG_Defaults— confirmsLOOPCHECKfield is absent from the struct (would be a compile error if reintroduced)TestGetConfigInfos_WithoutLoopcheck— config YAML withoutloopcheckkey parses correctlyTestGetConfigInfos_OldConfigWithLoopcheck— old YAML withloopcheck: trueloads without error; unknown field is silently ignored by yaml.v3TestDynamicLevelChange— end-to-end: writes a config file, starts the logger, overwritesloglevel, and asserts the watcher picks up the change within 3 sProduction fixes (surfaced during testing)
Goroutine leak / nil-pointer panic —
levelSetupWatcherran forever with no shutdown path; resetting globals in tests caused a panic when the dangling goroutine calledSetLevelon a nil logger.setup()now creates acontext.WithCanceland storeswatcherCancellevelSetupWatcheracceptsctx context.Contextand exits onctx.Done()reloadConfig()helper extracted to remove the duplicatedGetConfigInfos+SetLevelpair across Rename/Remove and Write/Create branchesTest run results
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.