Skip to content

feat: hide TES backends in the service info - #401

Merged
uniqueg merged 1 commit into
devfrom
feat/service-info-hide-backends
Nov 3, 2026
Merged

uniqueg merged 1 commit into
devfrom
feat/service-info-hide-backends

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds custom.service_info.list_backends (default: true, today's behaviour). When it is false, the public GET /service-info leaves out backends, keeps gateway, and reads no registries for it. Before, the only opt-out, service_info.runtime_fields: null, hid both.

The default stays as it is because clients that choose backends with gateway.backends need their identifiers, and registries publish verified backends anyway.

docs/configuration.md says plainly that this hides the TES instances from anonymous callers only: any user who can create tasks still gets their identifiers from the provenance of one task, and the URLs of those tried from its tags. docs/upgrading.md has a note in "To version 0.5.0".

This is the last open child of #366. Per-backend tokens moved to #397 (milestone v0.6.0); the silent default routing point is moot since #385.

Closes #396
Closes #366

Verification

  • TDD: three new tests in tests/ga4gh/tes/test_backend_list.py failed first (no service_info on the config), then passed. They cover the unit level, GET /service-info through the app, and the default and unknown keys.
  • coverage run -m pytest: 1189 passed, 1 skipped, 100% coverage. The 175 failures of that run all came from the library chart missing at that point; after helm dependency build deployment, tests/test_chart.py and tests/test_config_examples.py gave 206 passed.
  • Rerun after the last docs fix: tests/ga4gh/tes/test_backend_list.py, tests/test_version_mentions.py, tests/test_docs_hooks.py.
  • ruff check and ruff format --check (0.17.3, the version of the pre-commit config), mypy pro_tes tests, mkdocs build --strict: pass.
  • helm template with config.custom.service_info.list_backends=false renders the setting into the config.
  • Not run locally: pre-commit run --all-files as a whole (semgrep, gitleaks, ast-grep, actionlint) and the smoke test; CI runs them.
  • CI on this PR: CI passed, including Lint, Test (mongomock, MongoDB 7.0), Chart, Docs, Smoke test and Scan image.

Review

adversarial-reviewer and quality-reviewer, two rounds for the former. Round 1 found one medium, fixed: the docs understated what signed-in users can still see. Round 2 found one low, fixed: a link target. Also fixed: a long line in the docs.

Declined review findings

  • test_service_info_hidden wraps the setup in an app context, reported as unnecessary: get_custom_config needs it there, as that test has no fixture that provides one.
  • ServiceInfo as a class name is generic: optional per the reviewer, and it matches its neighbours Tes and Controllers.

🤖 Generated with Claude Code

https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG

Summary by Sourcery

Allow deployments to hide TES backend listings from public service information without affecting gateway capabilities.

New Features:

  • Add custom.service_info.list_backends to optionally omit TES backend details from the public service information while retaining gateway metadata.

Enhancements:

  • Clarify the limits of hiding backend information and document the new configuration alongside the existing runtime field behavior.

Documentation:

  • Document the backend-list visibility setting and its implications for anonymous users, task provenance, tags, and registries.
  • Add an upgrade note for the new service information configuration.

Tests:

  • Add coverage for default configuration, hidden backend output, gateway retention, and avoiding registry reads when backends are hidden.

Add `custom.service_info.list_backends` (default: true, as before). When
false, `service_info_fields()` leaves out `backends`, keeps `gateway` and
reads no registries. The docs say what stays visible to signed-in users.

Closes #396

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
@uniqueg uniqueg added this to the v0.5.0 milestone Nov 3, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR adds a default-enabled custom.service_info.list_backends setting that can hide TES backend identifiers from anonymous GET /service-info responses without loading registries or removing gateway capabilities, with corresponding configuration documentation and focused tests.

Sequence diagram for filtered public service info

sequenceDiagram
    participant Client
    participant ServiceInfo as GET /service-info
    participant Config
    participant Registries
    participant Plugins

    Client->>ServiceInfo: GET /service-info
    ServiceInfo->>Config: get_custom_config(CustomConfig)
    alt list_backends is true
        ServiceInfo->>Registries: get_backend_list().describe()
        Registries-->>ServiceInfo: backends
    else list_backends is false
        Note over ServiceInfo,Registries: No registry lookup
    end
    ServiceInfo->>Plugins: service_info_fields(plugins_url=PLUGINS_PATH)
    Plugins-->>ServiceInfo: gateway
    ServiceInfo-->>Client: service info with gateway and optional backends
Loading

File-Level Changes

Change Details Files
Add an opt-out configuration for omitting TES backends from public service info while preserving gateway metadata.
  • Introduce custom.service_info.list_backends, defaulting to true with strict validation.
  • Conditionally build the backends field so disabled mode avoids reading backend registries.
  • Keep plugin-provided gateway information available in both modes.
  • Document anonymous visibility, remaining task/provenance disclosure, upgrade behavior, and Helm/config examples.
pro_tes/config_models.py
pro_tes/ga4gh/tes/backends.py
pro_tes/config.yaml
docs/configuration.md
docs/upgrading.md
Add coverage for default, configured, hidden, and invalid service-info behavior.
  • Verify hidden unit-level service info contains only gateway and does not read registries.
  • Verify GET /service-info omits backends while retaining gateway.
  • Verify the default remains enabled and unknown configuration keys raise validation errors.
tests/ga4gh/tes/test_backend_list.py

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 proTES | 🛠️ Build #35604230 | 📁 Comparing 3741b25 against latest (81f923a)

  🔍 Preview build  

3 files changed
± configuration/index.html
± reference/index.html
± upgrading/index.html

@uniqueg
uniqueg marked this pull request as ready for review November 3, 2026 06:32
@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (81f923a) to head (3741b25).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #401   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines         2233      2238    +5     
=========================================
+ Hits          2233      2238    +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Linked issues

#366 feat: limit exposure of tokens and backend URLs · 1 of 3 met

# Requirement Status Notes
1 Limit replay of a registry token across its TES instances. ❌ Not addressed The PR says “Per-backend tokens moved to #397”; this diff does not change token scoping.
2 Limit exposure of backend URLs in the public service info. ✅ Met The new setting omits backends while retaining gateway; the default remains unchanged.
3 Warn about silent default routing when multiple TES instances are configured. ❌ Not addressed There is no routing warning in this diff; the PR says this point is “moot since #385”.

#396 feat: hide TES backends in the service info · 3 of 3 met

# Requirement Status Notes
1 With the setting off, omit backends but keep gateway; by default, leave behavior unchanged. ✅ Met The setting defaults to true; when false, service_info_fields() skips backends and still adds plugin service-info fields.
2 With the setting off, serving service info does not read registries. ✅ Met get_backend_list() is only called when list_backends is true; a test checks that no registry is read when false.
3 Document the setting and what it does not hide in docs/configuration.md and the 0.5.0 upgrade notes. ✅ Met The configuration docs explain the remaining visibility to task creators and registries; the upgrade note describes the setting and that gateway remains.

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@uniqueg
uniqueg merged commit ed55e4c into dev Nov 3, 2026
52 of 56 checks passed
@uniqueg
uniqueg deleted the feat/service-info-hide-backends branch November 3, 2026 06:40
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.

feat: hide TES backends in the service info feat: limit exposure of tokens and backend URLs

1 participant