Repository navigation
Show each IP Intelligence value's weighting in the examples - #148
Draft
jwrosewell wants to merge 4 commits into
Draft
jwrosewell wants to merge 4 commits into
jwrosewell wants to merge 4 commits into
Conversation
# Conflicts: # AGENTS.md
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
Every IP Intelligence property is a list of weighted values, and no Java example shows a weighting. The examples print their values through the shared
PropertyHelper, whoseunwrapValuekeeps each weighted value's value and drops its weighting (PropertyHelperlines 67 to 84 at rc b33daa0f, line 76). So a developer running the Getting Started example sees "Japan" and never learns that the answer carries a weighting, or how to read it.What the specification says
ip-intelligence-specification/required-examples.md at 706de1f0, "Weighted Values", line 107:
The section's example prints each value followed by its weighting.
What changed
PropertyHelper.unwrapValuewrites each weighted value followed by its weighting, read withIWeightedValue.getWeighting()and written to two decimal places in the root locale, for exampleJapan (weighting 1.00), orTokyo (weighting 0.75), Osaka (weighting 0.25)where there are two answers. Values that are not weighted are written as before. Every IP Intelligence console and web example that prints through the helper now shows the weightings.examples/ip-intelligenceis not among the packagesci/packages.jsonpublishes, so this change publishes nothing.Tests
Written first (commit 281779b), in
PropertyHelperTest.testWeightedValuesShowTheirWeighting. One value with a raw weighting of 65535 is writtenJapan (weighting 1.00), and two with raw weightings of 49151 and 16384 are writtenTokyo (weighting 0.75), Osaka (weighting 0.25).The runs build the IP Intelligence examples'
sharedmodule against the published packages, on Java 17, and runPropertyHelperTest.rcb33daa0 (281779b with the workflow, 56729f0): run 43618736428.PropertyHelperTestran 5 with 1 failure, the new test, "expected:<Japan[ (weighting 1.00)]> but was:<Japan[]>".The head adds only the AGENTS.md sentence (0eb562f) after b9eabc3.
Build
Run 43621670785 built 0eb562f merged with
rc(b33daa0) 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.PropertyHelperTestpassed 5 of 5 in the IP Intelligence examples in all nine jobs. Each of its tenSetting 'PullRequestSha'lines names 0eb562f, 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.
Base branch
rc81e3d4a is merged into the head with a merge commit, db2907a5. It conflicted in one hunk of AGENTS.md alone, where #162 rewrote the IP Intelligence part of "Correct output" to say that every line the Lite file cannot answer readsneeds the Enterprise data file. The resolution keeps #162's text and puts this draft's sentence, that each value is followed by its weighting as inJapan (weighting 1.00), in front of it.PropertyHelper.javaandPropertyHelperTest.javamerged with no conflict and their diff againstrcis the same as at 0eb562f, so the code and the test the approval of 0eb562f covered are unchanged, and only the place of the AGENTS.md sentence is new.The full build above ran on 0eb562f. This draft changes only the IP Intelligence examples and AGENTS.md, no published package, so under the decisions of 12 and 13 November its new head needs its quick checks rather than a full build of its own.
What remains
Nothing for this change.