Repository navigation
fix: make third-party lookups opt-in - #385
Conversation
The default pipeline of 0.4.0 routed by distance with provider dbip, which sends the public addresses of the hosts of task inputs to DB-IP and Nominatim without the admin choosing it. Distance routing can't locate inputs without a lookup service or a GeoIP database, so the default is random routing only; tes.routing.distance stays installed and is enabled explicitly in the config or the chart values. Document the opt-in, what leaves the deployment, and how to restore the behavior of 0.4.0 in the upgrade guide. Closes #384 Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Update the API flow description, the 0.4.0 upgrade bullet and the comment of the test helper that still named the old default. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Reviewer's GuideThe PR makes random routing the privacy-preserving default, leaving distance routing installed but explicitly opt-in, and aligns Helm configuration, documentation, upgrade guidance, and integration tests with that behavior. Reviewers should verify the default/overlay merge semantics, that no lookup path remains reachable without opt-in, and that the documented DB-IP and offline configurations correctly restore the intended routing behavior. Sequence diagram for privacy-preserving default routingsequenceDiagram
participant Client
participant Gateway
participant Random as generic.routing.random
participant TES
participant Lookup as Third-party lookup services
Client->>Gateway: POST /tasks
Gateway->>Random: route task
Random->>TES: forward task
TES-->>Gateway: task response
Gateway-->>Client: response
Note over Gateway,Lookup: No lookup request is made by default
Sequence diagram for opt-in distance routingsequenceDiagram
participant Client
participant Gateway
participant Distance as tes.routing.distance
participant Lookup as DB-IP and Nominatim
participant Random as generic.routing.random
participant TES
Client->>Gateway: POST /tasks
Gateway->>Distance: route task
Distance->>Lookup: locate input host addresses
Lookup-->>Distance: locations
Distance->>TES: forward to nearest instance
TES-->>Gateway: task response
Gateway-->>Client: response
alt lookup or distance routing fails
Distance->>Random: route fallback
Random->>TES: forward task
end
Flow diagram for opt-in task routingflowchart TD
Start[New task] --> Default[generic.routing.random]
Default --> TES[Select TES instance]
Start --> OptIn{Distance routing enabled?}
OptIn -->|No| Default
OptIn -->|Yes| Distance[tes.routing.distance]
Distance --> Fallback[generic.routing.random]
Fallback --> TES
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #385 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 2217 2217
=========================================
Hits 2217 2217 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="pro_tes/config.yaml" line_range="362" />
<code_context>
+ pipeline:
+ - id: route
+ alternatives:
+ - plugin: tes.routing.distance
+ - plugin: generic.routing.random
```
</code_context>
<issue_to_address>
**Lookups continue during rollout**
When a rolling upgrade leaves 0.4.0 pods serving requests alongside 0.4.1 pods, old 0.4.0 pods keep running their distance-routing default and send input-host IP addresses to DB-IP and Nominatim for requests routed to them, so the deployment continues disclosing addresses during the upgrade.
Document that lookups can continue until old pods stop serving traffic, or use a rollout procedure that drains the old pods before the privacy change is considered complete.
</issue_to_address>
### Comment 2
<location path="README.md" line_range="28" />
<code_context>
-routing plugins of foca-plugins, which the image contains); other plugins
-serve access control, request processing or validation, or the selection of
+there and tracks its state. By default, tasks go to a random TES instance,
+for load balancing, without sending data to third parties; plugins (e.g.,
+the routing plugins of foca-plugins, which the image contains) route tasks to
+the TES instance closest to their input data (an opt-in, as it uses lookup
</code_context>
<issue_to_address>
**Task data still reaches external TES**
When a deployment configures a TES backend operated by a third party, the statements that random routing sends “no data to third parties” imply that task data stays within the deployment, but `TaskRuns._run_pipeline` still forwards each task to a configured TES backend. Operators may therefore route sensitive tasks to an external TES believing no data leaves the deployment.
Narrow the claim to say that random routing makes no third-party location lookups, while clarifying that tasks are still forwarded to the configured TES backend.
Also at `docs/index.md:49`, `docs/plugins.md:95`, `deployment/values.yaml:109`.
</issue_to_address>Linked issues
#384 fix: make third-party location lookups opt-in · 4 of 4 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Default to routing without third-party lookups; use random routing if distance routing cannot work without lookups. | ✅ Met | The base config makes only generic.routing.random available and uses it as the pipeline; tests cover tasks with and without public input addresses and fail on address or hostname lookups. |
| 2 | Let operators explicitly enable DB-IP/Nominatim lookups in configuration and chart values, and document what data leaves the deployment. | ✅ Met | The docs and chart README show how to enable tes.routing.distance with provider: dbip and describe the addresses sent to DB-IP and Nominatim; they also document the offline provider. |
| 3 | Test the default for no outgoing lookups and test the opt-in. | ✅ Met | Tests assert that default routing makes no lookups and that the opt-in loads distance routing and performs the expected lookup. |
| 4 | Document the changed default and how to restore 0.4.0 behavior in the upgrade guide. | ✅ Met | The 0.4.1 upgrade section explains the changed default and provides configuration and Helm guidance for restoring distance routing. |
Sourcery assessment
Approval pending. 2 findings to address first.
Blocking findings: pro_tes/config.yaml:362, README.md:28
Say that the default makes no third-party location lookups instead of that no data goes to third parties (tasks still reach the configured TES instances), and note that 0.4.0 pods keep looking up addresses during a rolling upgrade (Sourcery review). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Summary
Closes #384
Third-party location lookups are now an opt-in. The default pipeline is
generic.routing.randomonly.tes.routing.distancestays installed in the image but is not enabled.Why random and not distance routing:
tes.routing.distancecan only locate the hosts of inputs through a provider.dbipsends their public addresses to DB-IP and Nominatim, andofflineneeds a GeoIP database that the image doesn't contain (it is the plugin's default provider and fails withoutdatabase). Configured backendlocations alone are not enough, because the inputs need locating too. So no distance default exists without lookups.Release notes (draft)
Breaking changes / Security: proTES no longer sends data to third parties by default. The default routing is random order; 0.4.0 routed by distance to the input data and looked up the public IP addresses of the hosts of inputs at DB-IP and Nominatim. To restore the behavior of 0.4.0, enable
tes.routing.distancewithprovider: dbipand put it beforegeneric.routing.randominplugins.pipeline(also in the Helm chart values), or useprovider: offlinewith a GeoIP database of your own to keep the data in the gateway. See the upgrade guide, "To version 0.4.1" (#384).Changes
pro_tes/config.yaml: onlygeneric.routing.randomavailable and in the pipeline.values.yaml,values.schema.jsonanddeployment/README.mddescribe the new default and the opt-in (no template changes: empty values are left out).plugins.md(opt-in, offline, ordered, privacy note on what leaves the deployment),upgrading.md("To version 0.4.1", how to restore 0.4.0),configuration.md,plugin-images.md,index.md,api.md, README,config.dev.yaml.getaddrinfofail the test), opt-in loads the plugin, opt-in makes the lookup; doc examples are validated merged into the base config.Verification
pytest -W ignore::DeprecationWarning(all excepttests/test_chart.pyand 2 chart-render tests intest_config_examples.py): 1166 passed. Coverage 100%.mypy pro_tes tests: clean.ruff checkandruff format(0.17.3): clean.mkdocs build --strict: OK.helm lint(Helm is not installed in the agent environment; they needhelm dependency build), and the pre-commit hooks other than ruff (no network for hook repos). CI runs them.Lane
Regular lane (default behavior, security).
adversarial-reviewerandquality-reviewerran in parallel. Fixed: stale default indocs/api.md, a stale bullet in the 0.4.0 upgrade notes, a stale comment and plugin set intests/ga4gh/tes/conftest.py.Declined review findings
docs/releases/0.4.0.md(historical notes): left as is.OPT_INfrom the doc example: the docs examples are already schema-validated; kept the explicit copy.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Make third-party location lookups opt-in by defaulting proTES to random routing and documenting the migration path for distance-based routing.
Bug Fixes:
Enhancements: