Repository navigation
Run every example on the free data files, and show what needs the Enterprise data file - #32
Merged
Merged
Conversation
On the free Lite data file, which a fresh clone downloads, the getting started example showed only the properties Lite has, and the web page showed HardwareVendor, HardwareName and DeviceType as "Unknown (the property 'hardwarevendor' is not in the results, so the current resource key does not include it)", a message written for the cloud service. Getting started, offline processing and both web pages now show each property only the Enterprise data file has as needing the Enterprise data file, with a link to ask for a copy. Metadata, match metrics and performance end with what the Enterprise data file adds and the same link when they run on the Lite file. Without a licence key the data file update example threw "No license key available" with a stack trace. It now shows the Lite data file it would start from, says that an update needs a licence key, gives the link and finishes. The automatic update examples link to the contact page for a licence key, in place of pricing. The shared helpers gain a check of whether the data file has a property, read from the data file's own list rather than the engine's, the text and notes the examples write, and a check of whether the data file is Lite. The data file age warning added 30 to the published date as text rather than adding 30 days, so it showed for a data file published four days earlier, and it now links to the contact page. The free-file warning in the data file log is removed, as each example now says what the Enterprise data file adds in its own output. The file search recursed through every folder up to the root of the disk and overflowed the stack when the file was not there. It now keeps a list of the folders still to search and skips any it cannot read. Downloading a missing data file uses PowerShell 7 when it is on the path, and otherwise Windows PowerShell without the module path it would inherit from PowerShell 7. Inside GitHub Actions the examples no longer send their download source, so the data repository's script names the build and test runs are not counted as people using the examples.
On the free Lite data file, which a fresh clone downloads, getting started and offline processing printed "Unknown (Property iprangestart not found in ip)" for every property only the Enterprise data file has, and the web pages did the same. They now show each one as needing the Enterprise data file and give a link to ask for a copy. The web pages also show their contact message, which they showed only for the tier 'Lite', a tier no IP Intelligence data file has. Metadata and performance say what the Enterprise data file adds. Compare, metrics and suspicious looked for the Enterprise data file, and the mixed example for a fuller Device Detection data file, before the Lite ones, and each overflowed the stack searching the disk for a file that was not there. They now use the Lite data files by default. Compare, metrics, suspicious and translation need properties only the Enterprise data file has, so with a free data file each says which, gives the link and stops, where suspicious printed false and 0 as if they were answers and translation listed every country alphabetically under most probable first. The translation test returns early when the example stops. The performance example downloads the free ASN data file when it finds no data file, rather than the Lite file, and reads AsnName when the data file has no RegisteredName. Without a licence key the data file update example threw "No license key available". It now shows the ASN data file, says that an update needs a licence key, gives the link and finishes. Its check that stops an Enterprise data file being downloaded over a free one compared the tier with 'Lite', and now checks for the Enterprise properties. The automatic update examples link to the contact page for a licence key. The shared helpers change as the Device Detection ones do, and gain a check of whether the data file is free and a stop for an example that needs properties only the Enterprise data file has.
CI puts the Enterprise IP Intelligence data file under the Lite file's name, and a fuller Device Detection data file under the Lite name in the tests folder, so nothing tested the free files a fresh clone uses. Each package gains a test that runs every on-premise console example in its own process, from its own folder, with the data file and licence key settings removed, and checks that it finishes, shows what needs the Enterprise data file and gives the link to ask for a copy. The web examples are checked in the test process on the free files. The Device Detection examples find the Lite data file themselves, in cxx/data/device-detection, where CI links the Lite asset. The IP Intelligence examples are given the free Lite data file, which CI now fetches as the 51Degrees-LiteIpiV41.ipi asset and links into cxx/data/ip-intelligence, and the performance and update examples find the ASN data file themselves. Without an IP Intelligence key the Lite asset is also linked under the Lite name, so it is not downloaded twice. The tests run with the integration tests, which run every test under examples.
The comment on NEEDS_ENTERPRISE said every property the examples ask for is in the Enterprise data file, which nothing in the examples checks. The web page test gave the wrong reason for removing usage sharing, which is removed so that the test sends nothing to 51Degrees.
This was referenced Nov 5, 2026
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
Every example must run out of the box with the free data files, and show the properties that only the Enterprise data file has, with a link to ask for a copy where they are not available. The rule is going into the required examples pages of the specification in specifications#79. The same change was merged into Go's rc in 51degrees-go#55, and is a draft for .NET in 51degrees-dotnet#74, Java in 51degrees-java#48, Python in 51degrees-python#43 and PHP in 51degrees-php#35.
A run on a GitHub runner on 5 November showed where Node stood (run 42063810109, from rc at ed5b502). It built both native modules as the readmes say and ran each on-premise example from its own folder with no settings.
Change
Device Detection, in
device-detection/fiftyone.devicedetection.onpremise/examples/onpremise:exampleUtils.jsgainsNEEDS_ENTERPRISE("needs the Enterprise data file"),hasProperty,getEnterpriseValue,getEnterpriseNote,isLiteDataFileandgetEnterpriseOffer.hasPropertyreads the data file's own property list from the native engine, rather than the engine's properties, which are only those it was built to give.#comment line at the top of its YAML output.IP Intelligence, in
ip-intelligence/fiftyone.ipintelligence.onpremise/examples/onpremise:exampleUtils.jsgains the same helpers, withisFreeDataFile, which tells the free files apart from the Enterprise data file by their having no IpRangeStart, andlacksEnterpriseProperties, which says which properties an example needs and where to ask for a copy when the data file has none of them.isFreeDataFile.Both packages:
examples-51degrees-nodeas the download source, so the data repository's script names the build and test runs are not counted as people using the examples.run_examples.mdand the package readmes say the examples need no settings and what they show on the free files. The IP Intelligence readme lists the on-premise examples.Tests:
examplesWithoutSettings.test.jsin each package'sexamples/onpremisefolder runs every on-premise console example in its own process, from its own folder, with the data file and licence key settings removed, and checks that it finishes, shows what needs the Enterprise data file and gives the link. It also requests each web page in the test process on the free files.cxx/data/device-detection, where CI links the Lite asset. The IP Intelligence examples are given the free Lite file, whichci/fetch-assets.ps1now fetches as the51Degrees-LiteIpiV41.ipiasset and links intocxx/data/ip-intelligence. Without an IP Intelligence key the asset is also linked under the Lite name, so it is not downloaded twice.Each contact link is
https://51degrees.com/contact-uswithutm_source=code,utm_medium=example,utm_campaign=51degrees-node, the example's file asutm_content, andutm_term=enterprise-data-file(orlicence-keyfor the update examples).Not changed
/documentation/4.5/_device_detection__hash.html, and so cannot be followed from console output. It is left as it is.Checks
51Degrees.hash, a file CI links in and that run did not have. It passed in the full build.location/tests/geoLocationCloud.test.js, whose "No evidence error message" test timed out after 5 seconds waiting for the cloud service, and the other legs were cancelled. This change does not touch the location package, and that test passed on the second attempt.rcbefore this branch is deleted, or GitHub closes it.Release note
The on-premise examples now run on the free data files with no settings, show the properties only the Enterprise data file has as needing it, with a link to ask for a copy, and no longer stop with an error when that file or a licence key is missing. The IP Intelligence performance example downloads the free ASN file rather than the Lite file when it finds no data file, and the compare, metrics, suspicious and translation examples say what they need and stop on a free data file.