Repository navigation
End every example with Find out more - #103
Merged
Merged
Conversation
A test in each product folder reads every example's source and fails for each one that lacks the section, a link to this API's folder in the repository, or a 51degrees.com link tagged with the example's file. It also fails when a file is added to an examples folder without being listed. The device detection and IP Intelligence tests run each cloud console example with no resource key and check what it prints ends with the section. The no-settings tests of both on-premise packages now check that each console example ends with the section and that each web page has it after its results, and the location examples test checks the section follows the lines each example prints.
The source checks now collect, for each example, one line for each thing the section lacks, and compare that list with an empty one. A failure names the missing heading, the missing link to this API's folder or the wrongly tagged link, rather than printing the whole file, which for the IP Intelligence metrics example holds NUL characters that the test result file cannot carry.
Every console example now prints a "Find out more" section at each of its clean ends: after its results, and where it stops early for want of a resource key, a data file or a licence key. The section is a rule of 79 equals signs, the heading, then one line per link, being this API's folder in the repository, the engine repository for an on-premise example, the Pipeline API folder, and 51degrees.com pages tagged with the example's file. Each example holds its own links, so a person reading one example sees all of it. Every web example ends its page with the same links: the six pug pages that had none, the location web example, the two custom flow element pages and, on the console, the local cloud API example. The IP Intelligence cloud mixed page now gives this API's own folder, and the 51Did creator context page tags its links with the file's full path below the pipeline folder, as every other example does. The update data file examples now return, from run, a promise that settles when the example has finished, so that the section prints after "Finished example" rather than before the update completes.
The pipeline example tests, which now run each example in its own process, check that each console example's output ends with the Find out more section, with the Pipeline API folder and a tagged 51degrees.com link, and that each star sign page has the section after its content. The simple flow element test checks the star sign is the only line before the section.
jwrosewell
marked this pull request as ready for review
November 14, 2026 08:25
This was referenced Nov 14, 2026
Draft
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
This draft closes two gaps from the audit of the deferred work and the examples, DX-node-26 and DX-node-27. On
rcat 758fea8 the examples did not end with a "Find out more" section, which is the part of an example that gives the person running it somewhere to go next.gettingStarted.jslines 157 to 161).gettingstarted-web/index.puganduseragentclienthints-web/index.pug, Device Detection on-premiseuseragentclienthints-web/index.pug, IP Intelligence cloudgettingstarted-web/index.pug, IP Intelligence on-premisegettingstarted-web/index.pug,mixed/gettingstarted-web/index.pugandmixed/gettingstarted-api/gettingStarted.js,location/examples/webIntegration.js,pipeline/fiftyone.pipeline.core/examples/customFlowElements/clientSideEvidenceFlowElement.jsandpipeline/fiftyone.pipeline.engines/examples/onPremiseFlowElement.js.Three pages already ended with the section. Two of them did not follow the pattern the others use.
index.puglines 149 to 170) is the model this draft copies.index.puglines 140 to 151) gave the Device Detection folder but not the IP Intelligence folder it belongs to.page.htmllines 142 to 152) tagged its links withutm_content=fiftyone.pipeline.did-creator-context-web-page.html, which leavesexamplesout of the file's path, where every other example in the repository names its file by its full path below the product folder.What the specification and the rules say
The specification's examples pages at c8128ca4 do not mention a "Find out more" section. What they say about the links an example writes, and about how an example ends, is this.
utm_source=code,utm_medium=example, the language repository's name asutm_campaignand the example's file asutm_content, so that an enquiry can be traced to the example that prompted it."The section itself comes from 51Degrees' rule for examples, which is that every demo and example ends with a clearly separated "Find out more" section, giving the relevant engine repositories as bare addresses and 51degrees.com pages tagged with exactly five parameters in this order:
utm_source,utm_medium,utm_campaign(the repository's name), thenutm_contentandutm_termas lowercase slugs, with the term at most 60 characters. common-ci'sscripts/utm-lint.ps1checks those tags. The rules for this work add that the section prints at every clean end of an example, including an early end with no resource key, no data file, or a paid file or licence key needed, and that this applies to every example, including those that use no 51Degrees data. Each link to 51degrees.com in a section carriesutm_contentnaming the example's file, as the specification asks of the contact link, and autm_termstartingfind-out-more.What changed
FIND_OUT_MOREconstant with its own links, so a person reading one example sees all of it, and prints it at every clean end. The section is a blank line, a rule of 79 equals signs, the headingFind out more:, then one line per link, each a tab, a label and an address. Where an example's main block callsrun, it now prints the section oncerunhas finished without an error, which covers an early return insiderunas well as the normal end. Where an example stops early in its main block, for want of a resource key, a data file or a licence key, it prints the section after its message. The performance examples print it at the end of theirFinishProcessinghandler, the automatic update examples after their message with no licence key and just before they stop themselves, and the pipeline examples at the end of their last callback. The layout follows the Python draft for the same work, 51degrees-python#127.mixed/gettingstarted-api/gettingStarted.js) serves JSON, so it prints the section on the console once it is listening, or when it cannot start for want of a data file.utm_content=fiftyone.pipeline.did-examples-creator-context-web-page.html.runreturned once it had built the pipeline, while the two updates carried on, so a section printed whenrunsettled would have come before "Finished example".runnow returns a promise that settles once the example has finished, and the main block prints the section then. No test callsrunwith a key.Nothing else changes in what an example does with no key or no data file. Five kinds of end stop with an error and a non-zero exit status, so they are not clean ends and print no section. They are the cloud web examples, which throw at start-up with no resource key (DX-node-30), the on-premise web examples, the match metrics and performance examples and the automatic update examples when their data file is missing, which throw, and the 51Did creator context demo, which exits with status 1 with no resource key (DX-node-30).
Tests
Tests first, in 23bef0b and 7695853, then the change in aeb5548. 0e574c6 merges
rcat 076bc17, which brought #104's tests that run the pipeline examples, and 1fd34e7 adds the section to what those tests check.findOutMore.test.jsin each product folder, beingdevice-detection/fiftyone.devicedetection/tests,ip-intelligence/fiftyone.ipintelligence/tests,location/testsandpipeline/fiftyone.pipeline.core/tests. Each reads every example's source and fails for each one that lacks the heading, the link to this API's folder, or a 51degrees.com link taggedutm_source=code&utm_medium=example&utm_campaign=51degrees-node&utm_content=<the file's path below the product folder>&utm_term=find-out-more..., naming what is missing. Each also fails when a.js,.pugor.htmlfile in an examples folder is listed neither as an example nor as a helper, so a new example cannot be added without the section. The Device Detection and IP Intelligence tests also run each cloud console example in its own process with no resource key, which ends it before it calls the cloud service, and check that what it prints ends with the section.metrics.jsexample holds NUL characters that the test result file cannot carry (the red full build below could not read its result files). The checks are the same.examplesWithoutSettings.test.jsfiles check that every console example they run ends with the section, and that each web page they fetch has it after its results.location/examples/examples.test.jschecks that the section follows the lines each location example prints, with or without a resource key.fiftyone.pipeline.core/examples/examples.test.js,fiftyone.pipeline.engines/tests/engines.examples.test.js,fiftyone.pipeline.did/tests/fodIdExample.test.jsandfiftyone.pipeline.engines.fiftyone/tests/usageSharingExample.test.js, check that each console example's output ends with the section and that each star sign page has it after its content. The simple flow element test, which expected the example to print onlylibra, now expectslibraas the only line before the section.How it was verified
location/examples/examples.test.json Ubuntu with Node.js 24, no resource key, with the tests onlyrc758fea8)npm run lint0 errors (189 warnings, as on the red run), and the link lint "clean for campaign '51degrees-node'". The configurator example with no resource key printed its message, then the section.cxx/data/get-data-files.sh, then the four new tests,location/examples/examples.test.jsand bothexamplesWithoutSettings.test.js, on Ubuntu with Node.js 24, with the tests onlyrcat 05:22 while this build waited for runners. It expected the simple flow element example to print onlylibra, so it met the new section. That is why 0e574c6 and 1fd34e7 exist.rc076bc17 and no example changedrcat 076bc17Setting 'PullRequestSha'lines (Configure and the six Build and Test jobs) name 1fd34e7. In each of the six jobs (Ubuntu and Ubuntu ARM with Node.js 22 and 24, Windows with Node.js 22 and 24) the unit tests reported 2 skipped and 1447 passed, and the integration tests 4 skipped and 138 passed. The four newfindOutMore.test.js, bothexamplesWithoutSettings.test.js,location/examples/examples.test.jsand the four pipeline example tests are among the suites that passed in each job. The Selenium contract passed, 9 of 9 twice.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.
Two earlier runs of the pipeline throwaway branches, 43564050754 and 43564059590, ran the wrong workflow file and are not evidence of anything. Every throwaway branch is deleted.
Package files
No package code changes, only examples and tests. The Device Detection and IP Intelligence packages list their files (
*.jsandtypes, withbuildfor on-premise), which leaves outexamplesandtests, as #95 found withnpm pack --dry-run, and since #106fiftyone.pipeline.corelists*.js,typesand its one template.fiftyone.geolocation,fiftyone.pipeline.engines,fiftyone.pipeline.engines.fiftyoneandfiftyone.pipeline.didhave nofileslist, so their packages carry theirexamplesandtestsfolders and this change reaches them.Merge order
This head contains
rcat 076bc17.git merge-treeof this head with the heads of #87 (74a087a), #37 (b239089) and #98 (a8fb0e4) reports no conflict. #87 changes the configuration page address in several of the same examples, with at least one unchanged line between its lines and this draft's. In the six automatic update examples this draft addsconsole.log(FIND_OUT_MORE);directly aboveprocess.exit(1);, so a draft that changes that line will conflict with this one there, and the resolution keeps both lines.What remains