Repository navigation
Make the data update examples check for a key first, use the ASN file, read _51DEGREES_LICENSE_KEY and end with status 0 - #101
Merged
Conversation
…for IP Intelligence, status 0, the licence key name, and two messages
…IP Intelligence updates, end with status 0, read _51DEGREES_LICENSE_KEY first, and fix two example messages
…ic update tests load
# Conflicts: # device-detection/fiftyone.devicedetection.onpremise/examples/onpremise/automaticupdates/dataFileSystemWatcher.js # device-detection/fiftyone.devicedetection.onpremise/examples/onpremise/automaticupdates/updateOnStartUp.js # device-detection/fiftyone.devicedetection.onpremise/examples/onpremise/automaticupdates/updatePollingInterval.js # ip-intelligence/fiftyone.ipintelligence.onpremise/examples/onpremise/automaticupdates/dataFileSystemWatcher.js # ip-intelligence/fiftyone.ipintelligence.onpremise/examples/onpremise/automaticupdates/updateOnStartUp.js # ip-intelligence/fiftyone.ipintelligence.onpremise/examples/onpremise/automaticupdates/updatePollingInterval.js
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
Five faults in the examples that update a data file, and in two example messages, all at 758fea81.
dataFileSystemWatcher.jsline 59, and only then checks for the key at line 74. A file the data submodule links to is downloaded when it is missing, so a fresh clone with no key downloads a data file only to be told a key is needed. The three IP Intelligence examples also default to the Lite data file (line 52), about 230 MB to download.process.exit(1), for example Device DetectiondataFileSystemWatcher.jsline 113, so a run that did what it should reports failure._51DEGREES_LICENSE_KEY. Both read the key fromLicenseKey, thenLICENSEKEY, with no deprecation message, and their message tells a person to setLicenseKey(Device Detectionupdatedatafile.jslines 173, 202 and 210, and the same lines in the IP Intelligence one). The automatic update examples beside them read_51DEGREES_LICENSE_KEY, which common-ci's list gives as "A licence key, for data file updates and for 51Did requests that need one" (environment-variables.mdline 28 at common-ci 39564dad).metaData.jslines 120 and 125)./documentation/4.5/_device_detection__hash.html#DeviceDetection_Hash_DataSetProductionwith no host (matchMetrics.jslines 113 and 114).What the specification says
The IP Intelligence examples page,
required-examples.mdlines 84 to 87 at c8128ca4:The Device Detection examples page,
required-examples.mdlines 115 to 117 at c8128ca4:On names, James Rosewell's rule of about 16:55 UTC on 12 November is that every environment variable name a package, a test, an example or a CI script reads is public, so a patch release never removes or renames one. When a name changes to its
_51DEGREES_form, the old name is still read for at least one release, only when the new name is unset or empty, with a deprecation message naming the new one.What changed
51Degrees-IPIV4AsnIpiV41.ipi. The Device Detection ones keep the Lite data file, the only free one.process.exit(0)once they have shown how updates are set up._51DEGREES_LICENSE_KEYfirst, through a newgetLicenseKey(), which they export for the test.LicenseKeyand thenLICENSEKEYare still read, only when_51DEGREES_LICENSE_KEYis unset or empty, with a deprecation message printed once. The message for a missing key names_51DEGREES_LICENSE_KEY.DeviceDetection_Hash_DataSetProductionwere checked to exist.Tests
Written first, in commit c573b699.
automaticUpdates.test.jsin bothautomaticupdatesfolders runs each of the six examples in its own process, from its own folder, as a person runs it. A small file loaded first with--requirereplaces the data file lookup with one that prints the name asked for and gives an empty file, and the Pipeline builder with one that prints the data file it was given and builds nothing, so the examples run with no data file, no network and no working key. With no key an example must say it needs one and look for no data file. With a key it must look for and build on the ASN data file (IP Intelligence) or the Lite data file (Device Detection), and end with status 0.ci/tests/deprecatedVariableNames.test.jschecks both update data file examples'getLicenseKey()in the way it already checks every other helper that reads a variable. The old name is read when the new one is unset or empty, the deprecation is said once and names the new name, the new name wins when both are set, and nothing is read or said when neither is.metaDataWithoutKey.test.jsruns the cloud metadata example with no resource key and checks the message.matchMetrics.test.jsnow reads what the example writes on the Lite data file, where it read nothing, and checks the link.Red, the full build of the test commit (run 43554589557). All 7
Setting 'PullRequestSha'lines, Configure's and the six jobs', are c573b69, and each of the six jobs failed the 8 new update data file tests in its unit tests, so its integration tests did not run there.Red for the integration tests on one Ubuntu runner with Node.js 24 and the native modules built (run 43559600824). With the tests as they now are on
rc's examples, all 12 automatic update checks and the metadata check failed, 13 of 13, and so did the match metrics check on the Lite data file.Green on the same runner at cc710ab (run 43559593333), where 13 of 13 passed, and the match metrics check on the Lite data file passed.
Two later commits change only the automatic update tests. 967a053 shows what an example wrote to its error output when it fails, and cc710ab3 writes a newline escape into the stand-ins file, where a real newline had made that file a syntax error, so that every example ended with status 1 in the first red and green runs alike (43557576924 and 43557583119). The throwaway workflows of these runs are not part of this draft.
The merge of rc
de89bd4c merges
rcat 7539a0b, which holds #103. #103 added the Find out more section to the same six automatic update examples, beside the lines this draft changes, and the six conflicts are resolved keeping both. Each example prints the section before it ends withprocess.exit(0), and in the three IP Intelligence ones #103'sFIND_OUT_MORElist sits above this draft's comment about the ASN data file. The campaign tag lint passes.Full build
Run 43576016634 on
tmp/pr-matrix-101-c, started bytools/pr-matrix.pywithout macOS. All 7Setting 'PullRequestSha'lines give this head, de89bd4, and Configure printed "Left out 2 macOS entries". Each of the six Build and Test jobs, Ubuntu, Ubuntu ARM and Windows on Node.js 22 and 24, passed 1,489 unit tests with 2 skipped and 163 integration tests with 4 skipped, the new tests and #103's Find out more checks among them, so the automatic update examples also ran and ended with status 0 on Windows. The build of the head before the merge, cc710ab, run 43560348516, passed as well.macOS 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.
What remains
LicenseKeyandLICENSEKEYas names of their own for the Java and Node.js update examples (environment-variables.mdlines 98 and 99 at 39564dad). For Node.js they are now deprecated names of_51DEGREES_LICENSE_KEY, which line 28 should list. That change belongs to common-ci, as common-ci#331.