Repository navigation
Make the data update follow the specification - #79
Draft
jwrosewell wants to merge 7 commits into
Draft
jwrosewell wants to merge 7 commits into
jwrosewell wants to merge 7 commits into
Conversation
…nce key check The tests read the messages and levels from the Logging section of the data update specification, check that update on start-up works with auto update off and that the file system watcher follows the auto update switch, and that an engine whose update URL is the Distributor's is refused without a licence key. Tests that built an engine with the defaults now switch auto update off or give a key, as the specification's defaults table says.
Send the data file's last modified time as If-Modified-Since when the file has no publication date. Register the data file with the update service when update on start-up or auto update is on, and let the auto update switch govern the file system watcher. Log the actions and errors with the messages and levels in the Logging section of the data update specification. Refuse to build with update on start-up or auto update on, the Distributor's URL and no licence key, naming the option to turn off.
The Logging section of the data update specification makes a failed download a warning, with the error detail from the server.
This was referenced Nov 9, 2026
The builder gives the data file its engine's type name, taken from the builder's own name, and the update service logs it until the engine is set.
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.
The problem
pipeline/Gaps-vs-spec.mdlists where the Java pipeline differed from the specification. Checked against the code onrcand against the data update page, four data update items are still true:DataUpdateServiceDefaultsent the epoch asIf-Modified-Sincewhen the data file had no published date.OnPremiseAspectEngineBuilderBase.preCreateEngineregistered the data file with the update service only when auto update was on, soupdateOnStartupwithautoUpdateoff did nothing.The same checks found D2, D4 and the programmatic update already met, and D5, D7 and D9 not required by the text, so those are not touched. The usage sharing items (U1 to U5) wait for the record format decision and are not touched either.
What changes
Each change cites the specification sentence it follows.
If-Modified-Sinceis the data file's published date, or its last modified time on disk when it has none. Update polling: "If the data file does not have a publication date then the file system last modified date/time can be used instead." An in-memory data file with no date still sends nothing.Engine 'No Engine'. The builder now gives the data file its engine's type name, taken from the builder's own name (DeviceDetectionHashEngineBuildergivesDeviceDetectionHashEngine), and the update service logs it until the engine is set.AspectEngineDataFileDefaultgainsgetEngineTypeNameandsetEngineTypeName.PipelineConfigurationExceptionwhen auto update or update on start-up is on, the update URL is the Distributor's and no licence key is set. The message namessetAutoUpdate(false)orsetDataUpdateOnStartup(false), whichever is on. Defaults: the licence key is "required before the Engine builds with autoUpdate or updateOnStartup on ... The build fails with a configuration error that names the option to turn off." A key is not required when the URL is not the Distributor's, which is how an update source that serves the file without one is configured.OnPremiseAspectEngineBuilderBasegains a protectedisLicenseKeyRequiredthat returns false, andFiftyOneOnPremiseAspectEngineBuilderBasereturns true for the Distributor's URL.Behaviour that changes for callers
setAutoUpdate(false), as the specification's defaults say. The tests that built with the defaults now do this or give a key, and the examples already did.setDataUpdateOnStartup(true)now works withsetAutoUpdate(false).isLicenseKeyRequired.Other open drafts
No open draft changes a file this draft changes. The drafts #78, #63 and #77 are left alone.
How it was checked
Tests were written first and fail on
rc.DataUpdateServiceLoggingTestsis new. It reads each message and level from the specification and checksIf-Modified-Sincefor a data file with and without a published date.DataUpdateServiceTestsnow expects no file system watcher when auto update is off, and a warning, not an error, for a failed connection or a 429.FiftyOneDegreesOnPremiseAspectEngineBuilderBaseTestschecks registration with update on start-up alone, and the licence key refusal and its exceptions.rcwithoutsetEngineTypeNameSetting 'PullRequestSha'line is 98f3a9a, the head.ExamplesWithoutSettingsTestfor Device Detection (6 tests) and IP Intelligence (9 tests) passes, so the examples still run out of the box with the free Lite file after the licence key checkmacOS was left out of this draft's full build under the 9 November decision. The rc head is built with macOS before it merges into main.
Every exit path of
downloadFile,checkForUpdateFromUrl,updatedFileAvailableandupdateFromMemorywas read after the change. The new temporary file path check returnsAUTO_UPDATE_REFRESH_FAILEDwhere a missing path used to throw aNullPointerExceptionout of the timer thread.What remains
pipeline/Gaps-vs-spec.mdfile is not edited here. Its removal is for whoever closes the list.