Repository navigation
Build and run the examples from a fresh clone on the runner's own JDK - #137
Merged
Merged
Conversation
A workflow clones the repository with its submodules, builds each product's console examples against the packages on Maven Central as AGENTS.md says, with the JDK and Maven the runner has, and runs the getting started example from the repository root with no settings. It checks the example exits 0, downloads its free data file, and prints results.
…classes PMD 7.7.0, which maven-pmd-plugin 3.26.0 runs, cannot read the class files of Java 25, so building the examples on a JDK 25 runner failed in the resource check. maven-pmd-plugin 3.28.0 runs PMD 7.17.0.
The pitfall said CI never runs the console example jars, which the new workflow now does on the runner's own JDK against the published packages.
The pitfall sits under Pitfalls, so 'this section' read as the pitfalls. It now links Run the examples.
Every job of the workflow let its example download the free data file, so a run fetched the 455 MB IP Intelligence Lite file two or three times. The Ubuntu job now tests the download and saves the file in the cache, keyed by the file's link, and the Windows and macOS jobs restore it and fail if their example downloads it again. The run step moves to ci/run-fresh-clone-example.ps1 so both jobs share it.
This was referenced Nov 15, 2026
jwrosewell
marked this pull request as ready for review
November 15, 2026 04:32
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 against the examples rule, that every example builds and runs both from a fresh clone and against the published packages, found in the audit of the examples on 13 November.
ci/fetch-assets.ps1puts every data file in place before any test, so no run ever took the path where an example finds only the.linkfor its free data file and downloads it, and nothing ran the examples the way AGENTS.md tells a person to.devprofile (ci/run-integration-tests.ps1lines 29 to 33), and Publish tests them against the versions it has just built.Building the examples the way AGENTS.md says, on the JDK the runner has, showed a third gap.
ubuntu-latestran theubuntu-26.04image, whose default JDK is 25.0.5. The examples' resource check runs PMD 7.7.0, through maven-pmd-plugin 3.26.0, which cannot read Java 25 class files ("Unsupported class file major version 69") and fails the build with aStackOverflowError, somvn -pl console -am package -DskipTestsstops before it makes a jar. Java 25 is the current long-term release, so anyone who clones the repository with it today cannot build an example.What changed and why
.github/workflows/examples-fresh-clone.ymlchecks the repository out with its submodules, asgit clone --recurse-submodulesdoes, prints the runner's own Java and Maven, and for each product builds the console examples in its examples folder withmvn -pl console -am package -DskipTests, exactly as AGENTS.md says. Without thedevprofile the examples use the packages published on Maven Central (device-detection.versionandip-intelligence.versionare 4.5.130 in the examples' poms). It then runsGettingStartedOnPremfrom the repository root with no arguments or settings, and fails unless it exits 0, logs that its free data file "is missing, so it is being downloaded", and printsResults:. It runs on Ubuntu, Windows and macOS on each push tomainandrc, daily at 04:30 UTC and by hand, and on Ubuntu and Windows for a pull request that changesexamples,cxxor the workflow, because the organisation's macOS runners are shared. It sets up no JDK, so it builds with whatever the runner has, as the 13 November policy on toolchains asks.examples/device-detection/pom.xmlandexamples/ip-intelligence/pom.xml), which runs PMD 7.17.0 (its pom'spmdVersion), so the resource check reads Java 25 classes. The examples are not published packages, so nothing is released for it.fail-on-cache-miss, and fail if their example downloads it again (examples-fresh-clone.yml). The run step moves toci/run-fresh-clone-example.ps1, which both jobs share, with-ExpectDownloadsaying which of the two each job checks, andci/README.mdand AGENTS.md say so.Tests
The new workflow is the test. It ran first on a throwaway branch holding
rcand the workflow alone, then on one holding both commits, each with the branch added to the workflow's push trigger so it ran with the full matrix.pmd:3.26.0:checkIn the red run the Ubuntu builds stopped with
StackOverflowErrorand "Unsupported class file major version 69" in the first module's resource check, and on Windows and macOS each example logged its free file as "is missing, so it is being downloaded", saved it (51Degrees-LiteV4.1.hash, and51Degrees-LiteV41.ipiat 455 MB) and printed its results. In the green run all six did the same, and on Ubuntu the resource check ran aspmd:3.28.0:checkon JDK 25.0.5. The pushes ran macOS onmacos-latest, which was the macOS 26 arm64 image, so the Intel image was not tried.The pull request's own run of the workflow on 118b2d3, 43586613934, passed on Ubuntu and Windows.
The download once a run, d8ffbf4. Red 43666775032 ran the head with the cache restore taken out of the Windows job, on a throwaway branch, for Device Detection. The Ubuntu job downloaded its file and passed, and the Windows job's example logged "'51Degrees-LiteV4.1.hash' is missing, so it is being downloaded", and the step failed with "The example downloaded its data file, which should have come from the cache." Green is the pull request's own run of the workflow on d8ffbf4, 43666745115, where both Ubuntu jobs downloaded and passed and both Windows jobs took the file from the cache and passed.
Before that, two throwaway runs built the examples on
ubuntu-latestwith its default JDK 25.0.5, with no other change. Run 43583839259 onrcfailed both products inpmd:3.26.0:check(StackOverflowError, "Unsupported class file major version 69"), and run 43583848187 with maven-pmd-plugin 3.28.0 built both.Full build
Run 43586620228 built 118b2d3 merged with
rc(1c99b72) 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. In each of the nine the examples' resource check ran aspmd:3.28.0:checkand passed, so maven-pmd-plugin 3.28.0 also runs on Java 8. Each of its tenSetting 'PullRequestSha'lines names 118b2d3, and its Configure job printed "Left out 6 macOS entries". 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, and this workflow runs on macOS on each push torc.The head, d8ffbf4, adds two commits to 118b2d3. c2de14e6 changes wording in AGENTS.md, and d8ffbf4 changes this workflow, the script it runs,
ci/README.mdand AGENTS.md. Neither changes package or example code, so this build stands, under James Rosewell's decision of 11:35 UTC on 12 November that a change to CI scripts and their notes needs no full build of its own. Every quick check on d8ffbf4 passed, being the fresh clone workflow's four jobs, the CI script tests on Ubuntu and Windows, the environment variable names check, the UTM link lint and the rc into main check.Base branch
rcat ceab088. The full build merged 118b2d3 withrcat 1c99b72, and a trial merge of the head withrcat 2eebbff is clean.What remains
pipeline,device-detection,ip-intelligenceandlocation) also use maven-pmd-plugin 3.26.0, so they do not build on Java 25 either. The test jobs choose Java 8, 11, 17 and 21, but the nightly's package build uses the runner's default JDK, so main's nightly stops there. #140 moves the four trees to 3.28.0 and fixes the two other places a Java 25 build stops. It changes different files from this draft, so the two merge in either order.ExamplesWithoutSettingsTest, against the data files CI provides.