Repository navigation
Warn on the web pages from the data file's published date, and test the Device Id row - #102
Merged
Merged
Conversation
…ate, and show the Device Id
…e, from its published date
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
Two gaps from the examples audit, both recorded under "Not changed" in #32.
gettingStarted.jslines 269 and 270 at 758fea81 passdataFilePublishedTime: new Date().getTime()anddataFileAgeWarning: DATA_FILE_AGE_WARNING(30), andindex.pugline 10 shows the warning whennew Date().getTime() > dataFilePublishedTime + dataFileAgeWarning. The IP Intelligence page (gettingStarted.jslines 229 and 230) and the mixed page (lines 177 and 178) do the same. The console examples already work this out from the engine's published date (exampleUtils.jsline 285).deviceidin lower case (gettingStarted.jsline 289), while the engine's own key isdeviceID.rcnow finds the key without regard to case, throughgetInternalIgnoringCaseinswigData.jslines 177 to 195, but no test reads the row.What the specification says
pipeline-specification/features/access-to-results.mdlines 10 and 11 at c8128ca4:So
deviceidmust find DeviceId, which it does onrc. The specification does not describe the examples' data file age warning, so the console examples' rule, a warning once the file is more than 30 days old, is the one the pages now follow.What changed
ExampleUtils.isDataFileOld(pipeline)is new in both on-premiseexampleUtils.jsfiles. It is true when the published date the engine gives is more thanDATA_FILE_AGE_WARNINGdays ago, for the Device Detection engine in that package, and for the IP Intelligence or the Device Detection engine in the IP Intelligence one, so the mixed page warns when either of its two files is old.dataFileOldfrom it, and their templates show the warning when it is true. The warning's text, which names the number of days, is unchanged.setPipelinereturns the Pipeline it built, so a test can ask about the same data file the page used.rcalready reads right.Tests
Written first, in commit 51c0b9a2. A new
dataFileAge.test.jsin each of the three web example folders checksisDataFileOldwith an engine whose file was published two days either side of the warning age, and that the page shows the warning exactly whenisDataFileOldsays the page's own Pipeline is old, so it holds whatever the age of the file CI fetches. The Device Detection one also checks that the Device Id row shows an id of four numbers.Red, the full build of the test commit (run 43555197471). All 7
Setting 'PullRequestSha'lines, Configure's and the six jobs', are 51c0b9a, and each of the six jobs failed exactly the 6 age tests, two for each page, with 133 other integration tests and 1,367 unit tests passing. The Device Id row test passed, asrcreads the row right.Green, in the full build of the fix below, where each of the six jobs passed the 6 age tests and the Device Id row test.
Full build
Run 43560480172 on
tmp/pr-matrix-102, started bytools/pr-matrix.pywithout macOS. All 7Setting 'PullRequestSha'lines give this head, 87ca1b3, 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,373 unit tests with 2 skipped and 140 integration tests with 4 skipped, the new page tests among them.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
Nothing in this repository for these two gaps.