Skip to content

Hand the web request to the pipeline in the IP Intelligence web examples - #119

Merged
jwrosewell merged 2 commits into
rcfrom
fix/ipi-web-request
Nov 13, 2026
Merged

jwrosewell merged 2 commits into
rcfrom
fix/ipi-web-request

Conversation

@jwrosewell

@jwrosewell jwrosewell commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The Usage Sharing Element accepts no Evidence, and shares what it finds in the web request that the web integration adds as server.http-request, together with the Evidence given to the Pipeline (found_evidence in share_usage.py lines 432 to 458 at 5b5a833). webevidence in pipeline/fiftyone_pipeline_core/src/fiftyone_pipeline_core/web.py line 139 adds it for every request it reads.

Every web example in this repository calls webevidence apart from the two IP Intelligence ones, which add only the Evidence their engine reads (query.client-ip, and on-premise header.accept-language and query.translation). Both build a Pipeline with usage sharing on, the default, so usage sharing in those two examples shares no other header of the request.

What the specification says

web-integration.md, Populating Evidence, lines 65 to 68, "Whichever approach it takes, the web integration MUST also add the web request itself to Evidence under the key server.http-request, whether or not any Flow Element accepts that key. The value is a read-only view of the request with these named parts, and the web integration adds it on every request."

usage-sharing-element.md, Accepted Evidence, lines 18 to 27, says the element shares what it finds in two places, "every Evidence value in the Flow Data" and every header other than Cookie, cookie, query string parameter and session value of the web request "when the web integration supplies the request as server.http-request", and "This is how a header that no other Flow Element accepts is still shared."

An example that builds its Evidence by hand is its own web integration, so it hands over the request as the Device Detection, location and pipeline web examples already do through webevidence.

What changed

  • cloud/gettingstarted_web/app.py and onpremise/gettingstarted_web/app.py in fiftyone_ipintelligence_examples hand the whole request to the Pipeline with flowdata.evidence.add_from_dict(webevidence(request)) before they add their own Evidence, as the Device Detection, location and pipeline web examples do. The Evidence they add after it is unchanged, and webevidence also adds every query parameter as query.<name> (web.py line 98). The IP Intelligence on-premise specification, "Choosing the IP address" lines 151 to 166, uses the query keys first in the data file's order, "for example true-client-ip-51d, then client-ip-51d, then client-ip". So a request whose URL also carries true-client-ip-51d or client-ip-51d is now looked up by that address, as the specification says. A request with no other client IP query parameter is looked up by the same address as before.
  • test_web_examples_hand_over_request.py is new. It reads both examples' source and fails if a function that makes Flow Data does not call webevidence. It reads the source, so it needs no data file and no network.

The examples package is tested but never published, so the release plan releases nothing for this change.

How it was verified

Both test runs are temporary branches holding a workflow that installs the pipeline packages from the checkout into a virtual environment of the runner's own Python (3.12.3 on Ubuntu, 3.12.10 on Windows) and runs the new test with pytest, on ubuntu-latest and windows-latest.

  • Red, rc at 5b5a8332 with the new test alone, commit 7e6b128, run 43519111679, failed on both with 2 failed, 1 passed. The two failures are the two examples' index routes, each with 'webevidence' not found among the names the route calls.
  • Green, this head c94716cc, run 43519136020, passed on both with 1 passed, 2 subtests passed.
  • Full build, run 43519232453, started by tools/pr-matrix.py on tmp/pr-matrix-119, finished with success. Configure printed "Left out 5 macOS entries", and the 11 Setting 'PullRequestSha' lines (Configure and the ten Build and Test jobs, Python 3.10 to 3.14 on Ubuntu and Windows) all give c94716c. 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.
  • Quick checks passed on this head, being run 43519184829 (environment variable names), run 43519185040 (only rc into main) and run 43519184688 (UTM link lint).

The head is 2 commits on rc at 5b5a833 and merges with today's rc without conflict.

What remains

Nothing in this draft. The last release into main was #114, merged at 06:22 UTC on 13 November.

@jwrosewell
jwrosewell marked this pull request as ready for review November 13, 2026 23:46
@jwrosewell
jwrosewell merged commit 175ca4a into rc Nov 13, 2026
3 checks passed
@jwrosewell
jwrosewell deleted the fix/ipi-web-request branch November 13, 2026 23:46
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.

1 participant