Skip to content

Clean up device detection port leftovers, fix CI Lite data file, auto-detect native toolset#126

Merged
Automation51D merged 4 commits into
mainfrom
feature/dd-port-cleanup
Jun 16, 2026
Merged

Clean up device detection port leftovers, fix CI Lite data file, auto-detect native toolset#126
Automation51D merged 4 commits into
mainfrom
feature/dd-port-cleanup

Conversation

@jwrosewell

Copy link
Copy Markdown
Contributor

Three concern-separated commits, reviewable one at a time.

28bb5ba Remove device detection leftovers from the port

Cleans up naming and comments copied unchanged from the device-detection-java codebase. Internal identifiers are renamed to IP Intelligence terms (for example deviceMap to propertyMap, DEVICE_LIST_KEY to PROFILE_LIST_KEY, the UserAgentGenerator test helper to IpAddressGenerator), and javadoc, log messages and README wording now describe IP Intelligence. Dead test code from the port is removed. Public API names with device detection heritage that are part of the IP Intelligence cloud specification are left unchanged.

c98e1c3 Link the CI Lite data file under the name tests look for

ci/fetch-assets.ps1 symlinked the fetched Lite asset under its blob name 51Degrees-LiteIpiV41.ipi, but the FileUtils test helper searches for the unpacked name 51Degrees-LiteV41.ipi, so tests could never find it. The symlink now uses the name the helper expects.

The -Assets entry keeps the blob name because the shared common-ci steps/fetch-assets.ps1 resolves assets through a fixed switch. The stale-blob URL behind that switch is fixed separately in common-ci#209. Until that merges, CI fetches a non-loadable Lite file, which is harmless here because the Enterprise file is found first.

e8e4884 Auto-detect the Windows toolset and SDK for the native build

The native build forced platform toolset v142 and Windows SDK 10.0.18362.0, so newer Visual Studio users had to pass -DplatformToolsetVersion and -DwindowsSDKVersion overrides. The pom default for both is now auto, and PreBuild.bat omits the corresponding CMake flag for an auto or empty value, so CMake selects the installed Visual Studio's latest toolset and SDK. This builds with v143 on the VS 2022 runner and v145 on a VS 2026 machine with no override. Explicit overrides still apply when set, and PreBuild.sh already let CMake choose.

Verification

The on-premise test suite was run locally with the native build compiled by the auto-detected toolset (CMake selected VS 2026) against the current 4.5 Lite data file: 22 run, 0 failures, 0 errors, 2 skipped. This PRs own CI will confirm the build on the VS 2022 runner with toolset v143.

Cleans up naming and comments copied unchanged from the
device-detection-java codebase. Internal identifiers are renamed to
IP Intelligence terms (deviceMap to propertyMap and DEVICE_LIST_KEY
to PROFILE_LIST_KEY in the cloud engine and MultiIPIDataCloud, the
UserAgentGenerator test helper to IpAddressGenerator) and javadoc,
log messages and README wording now describe IP Intelligence rather
than device detection.

Deletes dead test code from the port. Builder.java duplicated the
existing BuilderTests.java, MetaDataTests.java in the shared module
was an unreferenced helper without tests, and
ClientHintsExampleTestBase only applied to User-Agent Client Hints.

Public API names with device detection heritage, such as
HardwareProfileCloudEngine and the TAC evidence constant, are part
of the IP Intelligence cloud specification and are unchanged.
ci/fetch-assets.ps1 symlinked the fetched Lite asset under its blob
name 51Degrees-LiteIpiV41.ipi, but the FileUtils test helper searches
for the unpacked name 51Degrees-LiteV41.ipi, the same name the data
repo scripts produce, so tests could never find the fetched file.

The -Assets entry keeps the blob name because the shared common-ci
steps/fetch-assets.ps1 resolves assets through a fixed switch over
known names and errors on anything else. That switch is also where
the stale Lite blob URL lives, common-ci needs the equivalent of
ip-intelligence-data PR #31 to fetch the current 4.5 build published
as 51Degrees-IPIV4LiteIpiV41.ipi.gz.
The on-premise native build forced platform toolset v142 and Windows
SDK 10.0.18362.0 by default, so anyone on a newer Visual Studio had to
pass -DplatformToolsetVersion and -DwindowsSDKVersion overrides and CI
was pinned to an old toolset.

The pom default for both is now "auto", and PreBuild.bat omits the
corresponding CMake flag for an "auto" or empty value. CMake then picks
the toolset and SDK from the installed Visual Studio, the latest each
version supports, so the build uses v143 on a VS 2022 runner and v145
on a VS 2026 machine with no override. Explicit overrides still apply
when the properties are set. PreBuild.sh already let CMake choose, so
it is unchanged.
@jwrosewell jwrosewell marked this pull request as draft June 14, 2026 18:53
@jwrosewell

Copy link
Copy Markdown
Contributor Author

Setting this to draft so it is not picked up by the overnight auto-merge over the weekend. This is a precaution after an unintended overnight merge last night; nothing here is believed to be broken. It will be marked ready for review when the team is back.

@Jamesr51d

Copy link
Copy Markdown
Contributor

Merge: fix/incorrect-ipi-nomenclaturefeature/dd-port-cleanup (PR 126)

Decisions

Naming convention: OnPremise everywhere.

The native SWIG layer is uniformly *IpiSwig (EngineIpiSwig, ResultsIpiSwig, ConfigIpiSwig) with no Hash engine, so the Hash suffix on the Java wrapper/data/test classes was a device-detection leftover. The Hash-suffixed types are retained as @Deprecated for backward compatibility. Genuine hashing (hashCode() overrides, HashMap/HashSet, the MetaDataHasher base interface) is left untouched.

Content conflicts

  • ci/README.md: IP_INTELLIGENCE_KEY + full distributor URL over DEVICE_DETECTION_KEY
  • MultiIPIDataCloud.java: getProfileList() rename (pick 4, also compile-required) + kept @deprecated javadoc
  • IPIntelligenceDataHashDefault.java: @Deprecated shim extends IPIntelligenceDataOnPremiseDefault
  • IPIntelligenceOnPremiseEngine.java: OnPremise type names (IPIntelligenceDataOnPremise, IPIData)
  • IPIntelligenceOnPremiseEngineBuilder.java: OnPremiseDataFactory + IPIntelligenceDataOnPremise
  • TestsBase.java (engine on-premise): WrapperOnPremise
  • ValueOnPremiseTests.java: registeredName test picked over Values_OnPremise_* name; deviceId helper no longer exists, so also compile-required
  • EngineTests.java: OnPremise method names - kept exact-string tier assertions (IPIV4Lite / IPIV4Enterprise)
  • EvidenceKeysTests.java: EvidenceKeys_OnPremise_*
  • TestProcessTests.java: Process_OnPremise_* + DataValidatorOnPremise
  • IPIntelligenceOnPremisePipelineBuilder.java: IPIntelligenceEngine field + on-premise comment
  • CloudRequestOriginTests.java: test IP 8.8.8.8 (pick 5)
  • IPIntelligenceTests.java: constant-based evidence keys EVIDENCE_QUERY_PREFIX + EVIDENCE_SEPERATOR

Flags

  1. EngineTests assertion: Did not apply the Enterprise assertion assertTrue(tier.equalsIgnoreCase("Enterprise")), since "IPIV4Enterprise".equalsIgnoreCase("Enterprise") is false and would fail against the real data file (the uncontested Lite line proves the tier carries the IPIV4 prefix). Kept verified exact-string assertEquals("IPIV4Enterprise", tier).
  2. Dead Enums.MatchMethods: the enum (PERFORMANCE / COMBINED / PREDICTIVE, i.e. DD Hash match methods) is still defined but has zero usages in either branch.

@Automation51D Automation51D merged commit aeb0eab into main Jun 16, 2026
1 check passed
@Automation51D Automation51D deleted the feature/dd-port-cleanup branch June 16, 2026 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants