Repository navigation
End every Device Detection and IP Intelligence example with a Find out more section - #133
Merged
Merged
Conversation
Adds FindOutMore to the Device Detection and IP Intelligence examples' shared modules, with its own tests, and checks that each on-premise console example run with no settings ends with the section and that every console example with a main method writes it.
Each Device Detection and IP Intelligence console example now ends its output with the section, after the link to the contact page where it gives one, including the examples that stop early on a free data file. The section lists the product, pricing and documentation pages, tagged with the example, and the repositories behind it. OfflineProcessing writes it as YAML comments so its output stays a valid YAML stream, and the examples whose writer closes standard output write it before that.
Adds the HTML form of the section to FindOutMore, with its own test, and checks the page of each Device Detection and IP Intelligence web example that serves HTML.
The Device Detection pages add it after the contact-us banner, and the IP Intelligence on-premise, mixed, cloud and cloud mixed pages through a placeholder in their templates.
The Device Detection cloud web example's options file named the cloud service over plain HTTP. The IP Intelligence on-premise and mixed web examples' options files fell back to the Enterprise data file, which a fresh clone never has, and now fall back to the free Lite file.
CompareOnPrem and MetricsOnPrem return when their fourth argument names no performance profile. The no-settings tests now run each with one, and the check's Javadoc says what it checks, the section after the last contact link and closed by its rule, as log lines may follow it.
jwrosewell
marked this pull request as ready for review
November 15, 2026 02:32
This was referenced Nov 15, 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
Three gaps in the Device Detection and IP Intelligence examples, found in the audit of the examples on 13 November.
rcwere the repository's README, a Javadoc line and the 51Did creator context page. The 51Degrees rule for examples is that every example ends with a clearly separated "Find out more" section that gives the person running it links to follow up, being the relevant repositories as plain addresses and 51degrees.com pages tagged with the campaign convention that common-ci'sscripts/utm-lint.ps1checks.51Degrees-Cloud.xmlline 28 at 30e48867 defaultedEndPointtohttp://cloud.51degrees.com/api/v4.51Degrees-OnPrem.xmlline 32 and51Degrees-Mixed.xmlline 39 at 30e4886).The specification says for Device Detection, in required-examples.md lines 91 to 93 at c8128ca4, "Examples MUST run out of the box with the free data files. Given no arguments or settings, an example uses the Lite Data File", and the IP Intelligence page names the free file,
51Degrees-LiteV41.ipi, in lines 73 and 74.What changed and why
Line numbers are at e8b4ea4, and the files they name are the same at this head, 2e9b7f7.
FindOutMore, in the shared module of each product (Device Detection and IP Intelligence), writes the section between two rules. It lists the product page, the pricing page and the documentation on 51degrees.com, each tagged withutm_source=code,utm_medium=example,utm_campaign=51degrees-java, the example asutm_contentandfind-out-moreasutm_term, then the repositories. An on-premise example lists this repository, 51degrees-cxx and the data repository, and a cloud example this repository alone.linkrefuses a tag that is not a lower case slug, so a tag cannot break the convention.htmlgives the same section for a web page.mainmethod, 13 for Device Detection and 13 for IP Intelligence, writes the section after its results and after the contact page link where it gives one, although a log line can still follow it, including the examples that stop early on a free data file, and IP Intelligence'sCompareOnPremandMetricsOnPremwhen their fourth argument names no performance profile (2e9b7f70).OfflineProcessingwrites it as YAML comments (Device Detection line 250, IP Intelligence line 281), so its output stays a valid YAML stream, and the examples whose writer closes standard output write it before that.HtmlContentHelperlines 316 to 319, after the contact page banner, and the IP Intelligence on-premise, mixed, cloud and cloud mixed pages through a${FIND_OUT_MORE}placeholder in their templates. The IP Intelligencegetting-started.apiexample answers JSON only, so it has no page to end.https://cloud.51degrees.com/api/v4(line 28).cxx/data/ip-intelligence/51Degrees-LiteV41.ipi(on-premise line 32, mixed line 39).Every change is under the root
examplesfolder, whose modules are not published packages, so under the version per package change (#63) it releases no package.Tests
Tests first, each commit pair a test then its change.
FindOutMoreTestin each shared module has five tests (four from the console test commit and the HTML form from the web pages test commit), for the section's layout with its tagged links then the repositories, the cloud list of one repository, the YAML comment form, the HTML form, andlinkrefusing a tag that is not a slug.FindOutMoreCoverageTestin each console module reads every source file undersrc/main/javaand fails on any class with amainmethod that does not callFindOutMore.write, so a new example cannot leave it out.ExamplesWithoutSettingsTestin each console module now also checks the output of each example it runs with no settings. The section must come after the last link to the contact page and close with its rule. Log lines can follow the section, so the check does not ask that nothing comes after it. The IP Intelligence one also runsCompareOnPremandMetricsOnPremwith a performance profile name that is not one.CloudOptionsFileTest(Device Detection cloud web) checks the default endpoint is HTTPS, andOptionsFileTest(IP Intelligence on-premise and mixed web) checks the default data file is the Lite file.Each red and green ran on
ubuntu-lateston a throwaway branch holding the commit and a temporary workflow that runs the example modules' tests against the published 4.5.130 packages, each example finding or downloading its free file.FindOutMoreCoverageTestfailed in both products, andExamplesWithoutSettingsTestfailed every example it runs, 6 of 6 for Device Detection and 9 of 9 for IP Intelligence, because none wrote the section.FindOutMoreTestpassed its four tests at that commit.GettingStartedWebOnPremTestfailed in both products, with the console tests passing. The cloud page tests need a resource key, which the temporary workflow did not give, so they ran in the full build.CloudOptionsFileTest.defaultEndPoint_Httpsfailed, andOptionsFileTest.defaultDataFile_FreeLiteFilefailed in both IP Intelligence modules with "expected:<...51Degrees-[Lite]V41.ipi> but was:<...51Degrees-[EnterpriseIpi]V41.ipi>".ExamplesWithoutSettingsTest, 6 of 6 and 9 of 9.GettingStartedWebMixedTestskipped its one test, which needs the cloud.ExamplesWithoutSettingsTest. In IP Intelligencecompare_UnknownProfileandmetrics_UnknownProfilefailed with "The output should have the 'Find out more' section after the link to the contact page", and the other 9 passed. Device Detection passed 6 of 6.Full build
Run 43585242486 built 2e9b7f7 merged with
rc(ceab088) on nine configurations, Ubuntu x64 with Java 8, 11, 17 and 21, Ubuntu arm64 with Java 17, and Windows with Java 8, 11, 17 and 21, and every job passed.ExamplesWithoutSettingsTestpassed 6 of 6 for Device Detection and 11 of 11 for IP Intelligence in all nine jobs, and the cloud page tests that the throwaway runs could not run (GettingStartedWebCloudTestfor each product, and the IP IntelligenceGettingStartedWebCloudMixedTestandGettingStartedWebMixedTest) ran with the build's resource key and passed in all nine jobs, none skipped. Each of its tenSetting 'PullRequestSha'lines names 2e9b7f7, and its Configure job printed "Left out 6 macOS entries". The build of the earlier head, e8b4ea4, was run 43559426033, also green.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.
Base branch
rc(6e03a25), which was merged in at e8b4ea4 with a merge commit and no conflict, bringing #127, #128 and #130. A trial merge withrcat 1c99b72, which has since taken #27, #124, #43, #63, #83 and #115, was clean on 14 November at 12:00 UTC.What remains