Repository navigation
Run the file system watcher on its own setting - #110
Merged
Merged
Conversation
testTheWatcherRunsOnItsOwnSetting registers a data file in three cases, being the watcher on with automatic updates on, the watcher on with them off, and the watcher off with them on. A watcher is created, logged and loads a replaced file exactly when the watcher's own setting is on. The five watcher tests in FileSystemWatcherTests no longer turn automatic updates on through register_watched, which existed only to get a watcher, and testFileSystemWatcherIsLogged no longer sets auto_update. testNoFileSystemWatcherWithoutAutomaticUpdates, which held the watcher to the automatic update setting, is removed.
register_data_file creates the watcher when file_system_watcher is on, whether or not auto_update is, as it did on main. Watching a file downloads nothing, so it needs no licence key, and the on-premise engines, which turn auto_update off without a key, keep watching the data file. Polling, the update on start-up and the licence key handling are unchanged.
This was referenced Nov 12, 2026
Merged
jwrosewell
marked this pull request as ready for review
November 12, 2026 21:29
Merged
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.
Problem
The file system watcher stopped running with automatic updates off, so a deployment with no License Key that replaces its Data File on disk is no longer watched, where the published package watched the file.
main, the update service creates the watcher on the watcher's own setting, withif data_file.file_system_watcher:atdatafile_update_service.pyline 272 on 0b4081a.rcas 8b0b624, made itif data_file.auto_update and data_file.file_system_watcher:, under the comment "The watcher is an automatic update, so it only runs with automatic updates on." (lines 492 to 494 at 8b0b624, and lines 548 to 550 atrc126d373, which this draft starts from).auto_updateoff when no License Key is given and leavefile_system_watcheras it was set, then make a data file for the watcher alone (devicedetection_onpremise.pylines 254 to 263 andipintelligence_onpremise.pylines 199 to 208 at 126d373). Onrcthat data file is never watched.The rule
James Rosewell decided at about 11:40 UTC on 12 November 2026 that the file system watcher runs on its own setting and needs no License Key. The License Key is needed only for the two things that download, which are polling and the update on start-up. Watching a file downloads nothing, so a deployment that brings its own Data File can watch it with automatic updates off.
What the specification says
The specification says otherwise today, and is to change to follow the rule. This is its master switch section, at data-updates.md lines 97 to 105 on the specifications
rc48e28393.Lines 178 to 181 say the same of Automatic update from File. #69 followed those lines. The change to them, so that the watcher runs on its own setting and a License Key is needed only for polling and the update on start-up, is not drafted yet. The specification's message for a watcher, "Creating file system watcher" (line 449), is unchanged and is still logged whenever a watcher is created.
What changed
The tests come first, in 17ba64d6, and the fix after them, in 67045f72.
file_system_watcheralone.register_data_filereadsif data_file.file_system_watcher:again, asmaindoes, under a comment saying the watcher runs on its own setting whether or not automatic updates are on, and needs no licence key because it downloads nothing (lines 545 to 548). Nothing about polling, the update on start-up or the License Key changes.check_next_updatestill runs only withupdate_on_startorauto_updateon, and the engines still turn both off without a key.testTheWatcherRunsOnItsOwnSettingregisters a data file in three cases, being the watcher on with automatic updates on, the watcher on with them off, and the watcher off with them on. In each case a watcher is created, "Creating file system watcher" is logged and a replaced file is loaded exactly when the watcher's own setting is on.FileSystemWatcherTestsa helper,register_watched, that setauto_updateand left out the update checks it scheduled, only to get a watcher. The helper is gone, and the five tests that used it register the data file directly, as they did onmain.testFileSystemWatcherIsLoggedintest_datafile_update_http.pyno longer setsauto_update.testNoFileSystemWatcherWithoutAutomaticUpdates, which held the watcher to the automatic update setting, is removed, because its case is the second case of the new test with the opposite answer.Runs
Setting 'PullRequestSha' to '17ba64d6...', and Configure printed "Left out 5 macOS entries". The engines unit tests in that job ended "7 failed, 59 passed". The new test failed on its second case,SUBFAILED[watcher on, automatic updates off] tests/test_datafile_update_service.py::FileSystemWatcherTests::testTheWatcherRunsOnItsOwnSetting, withAssertionError: 1 != 0 : watcher on, automatic updates offat line 145, meaning no watcher was created. Its other two cases passed. The other six failures are the tests that lostauto_update. The fiveFileSystemWatcherTestsfound no watcher check pending (IndexError: pop from empty listandlist index out of range), andtestFileSystemWatcherIsLoggedfailed with('info', 'Creating file system watcher') not found in []. The other nine Build and Test jobs were cancelled when that job failed.Setting 'PullRequestSha'lines are all 67045f7, and Configure printed "Left out 5 macOS entries". The engines unit tests on Ubuntu Python 3.14 ended "65 passed".rcmoved after the build. Every job mergedrcat about 20:44 UTC, when it was 126d373 ("Already up to date"). #91 and #92 then merged at 21:10 as 625ee4e and ddbd95d. They changejsonbundler.pyand two of its tests only, and this draft touches none of those files.The same change in Go
51degrees-go#110, at head e53aa8fc, made the same change in Go. Its
TestTheWatcherRunsOnItsOwnSettinghas the same three cases, three of its tests lost the automatic update setting they had been given only to get a watcher, and itsRegistercreates the watcher onFileSystemWatcherEnabledalone.What remains
autoUpdate. A draft in specifications to say the watcher runs on its own setting, and that a License Key is needed only for polling and the update on start-up, is not written yet.rcintomainrelease draft, needs this draft inrcso that the release keeps the watcher of the published package.