Repository navigation
Simplify filesystem watcher event tracking and preserve queue semantics - #1250
Open
sylvesterkaczmarek wants to merge 1 commit into
Conversation
4 of 7 tasks
mmguero
force-pushed
the
contributor-prs
branch
from
October 29, 2026 18:01
af68573 to
c6160d8
Compare
Refresh the focused change onto contributor-prs at 7046399. `python -m pytest -q shared/tests/test_watch_common_file_events.py shared/tests/test_watch_common_read_events.py shared/tests/test_watch_moved_paths.py`: **40 passed**. Python compilation and Ruff pass. Preserved the newer upstream read-only-close cancellation and separate accounting for overlapping opens. Destinationless moves now retire tracked/staged source entries; four new regressions failed before the correction and pass afterward. Assertions in the topic tests now run outside dictionary contexts that could suppress assertion failures. No live Malcolm deployment was run.
sylvesterkaczmarek
force-pushed
the
fix/765-refactor-watchdog-file-event-tracking-20261016
branch
from
November 6, 2026 07:48
1c2679d to
e432af5
Compare
This branch has not been deployed
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.
Maintenance update on 6 November 2026
Refreshed onto
contributor-prsat7046399bafter the integration branch history changed. This PR now contains its 2-file topic change in one commit.python -m pytest -q shared/tests/test_watch_common_file_events.py shared/tests/test_watch_common_read_events.py shared/tests/test_watch_moved_paths.py: 40 passed. Python compilation and Ruff pass. Git whitespace checks pass.Preserved the newer upstream read-only-close cancellation and separate accounting for overlapping opens. Destinationless moves now retire tracked/staged source entries; four new regressions failed before the correction and pass afterward. Assertions in the topic tests now run outside dictionary contexts that could suppress assertion failures. No live Malcolm deployment was run.
Earlier validation counts and complexity measurements below record the original branch state. No fresh Radon score is claimed. ChatGPT assisted with this refresh, corrections and validation.
Description
Refactor the filesystem watcher event handler in
shared/bin/watch_common.pyto separate event history coalescing, staging/promotion, priority ordering, deletion, and move handling from event receipt. The originalFileOperationEventHandler.on_any_eventscored E (40) in Radon; the revised handler scores B (6). All extracted helpers score A or B. This reduces complexity without altering how watchers schedule completed PCAP and other upload files.openedormodifiedevent staged until a real content change or a close/create/move event promotes it.Related issue(s)
Refs #765, specifically the outstanding high-complexity
FileOperationEventHandler.on_any_evententry. This PR does not complete the broader Python complexity review.Type of change
How has this been tested?
16 focused tests passed on file create, open, modify, close, delete, and moved-event paths (including cross-directory moves, staging, unchanged sizes, coalescing, and missing destinations). The full
shared/testssuite passed: 647 tests passed, 6 skipped, 31 subtests passed with Python 3.12 and current upstream test dependencies. Python compilation, targeted Ruff checks andgit diff --checkpassed. The functionality was validated offline with real watchdog event classes and temporary files; no live Malcolm/Zeek deployment was exercised.Documentation
Was AI used in writing the code, tests, or description for this pull request?
ChatGPT assisted with the refactor, the regression tests and the PR description. The code was reviewed against the existing watcher semantics, and the stated offline regression and static checks were executed.
Additional context
Based on the current
contributor-prsbranch. Independent of existing open PRs and does not introduce dependencies.