Repository navigation
Test that a header no element reads reaches the usage sharing message - #127
Merged
Merged
Conversation
… through the web integration
jwrosewell
marked this pull request as ready for review
November 14, 2026 04:02
This was referenced Nov 14, 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
The Usage Sharing Element accepts no Evidence. It finds the values to share in the web request, which the web integration adds to Evidence as
server.http-requeston every request (WebRequestEvidenceServiceCore.javaline 73, with every value recorded at line 150). A header that no element reads is therefore not in Evidence at all, and reaches the usage sharing message only through that web request.The tests in
UsageSharingEvidenceTestscheck that the web request is added and what it holds, but each builds the Usage Sharing Element with a share percentage of 0, so none of them sends anything. No test sent a header that no element reads through the web integration and found it in the message that is sent. A change that left the web request out, or left it empty, would have stopped every such header being shared with every test still passing.What the specification says
The Accepted Evidence and Shared Evidence sections of the usage sharing element specification, at 6570727d on the specifications
mainbranch, say how the element finds its values. Shared Evidence says "A value from the web request is given the key it would have as Evidence, for exampleheader.user-agentfor its User-Agent header", thatheader.cookieis never shared, "This holds for the Cookie header of theserver.http-requestview as well as for Evidence", and that "Theserver.http-requestvalue itself is never shared, only the values read from" it.What changed
One test,
UsageSharingEvidenceTests.UnreadHeader_ReachesTheUsageSharingMessage, and nothing in any package's main code.com.sun.net.httpserver, keeps the body of each request it gets.header.x-test.WebRequestEvidenceServiceCore.Default.addEvidenceFromRequestadds a request carryingX-Test: shared, a User-Agent and a Cookie header, as the servlet filter and the Spring interceptor do, and the FlowData is processed.X-Testand the User-Agent must be in it with their values, and the Cookie header must not.The wait is an upper bound and not a time limit on the work. The message arrived in about 0.1 seconds in the green run below.
Tests
recordcall at line 150, with a temporary workflow that runsUsageSharingEvidenceTestsonubuntu-latestwith the runner's Java and Maven. The new test failed with "The header no element reads was not shared. expected: but was:", and so did the two tests that read the web request, 3 of 6.rcas it is. 6 of 6 passed.Full build
Run 43520552583 built 328bc86 merged with
rc(30e4886) 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. Each of its tenSetting 'PullRequestSha'lines names 328bc86, 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.
What remains
Nothing in this change. The release plan of #63 counts a change under
src/testas no release, so this releases nothing on its own.