Skip to content

build: use FOCA 0.19 - #360

Merged
uniqueg merged 7 commits into
devfrom
build/foca-0.19
Oct 31, 2026
Merged

uniqueg merged 7 commits into
devfrom
build/foca-0.19

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves proTES to FOCA 0.19.0. This PR only covers compatibility, configuration, docs and tests. proTES code does not use the new plugin store.

  • Build: pins foca>=0.19.0,<0.20 and the base image elixircloud/foca:0.19.0-py3.13 by digest (sha256:82446bdd…). The smoke-test plugin pin and the FOCA versions in the docs examples move to 0.19 as well. The foca-common library chart stays at 0.2.0, because no chart has been released since then.
  • Plugin listing: test_list_plugins_storage covers the new required fields data_stored and storage. It checks shared with the database and off with store.enabled: false.
  • Helm chart: plugins.available.<id>.store (enabled, maxEntrySize, maxTtl) is now in values.yaml and values.schema.json, with FOCA's bounds. protes.pluginKeys converts it to snake_case. test_plugins_keys, which checks that the schema mirrors FOCA's PluginsConfig, passes again. plugins.defaults.store stays in config.plugins, like the other defaults.
  • Docs:
    • docs/upgrading.md has a new section, Plugin store. It covers the plugin_store collection in taskStore, the indexes created on startup, the createIndex right (part of readWrite) and the new listing fields.
    • docs/operations.md has a new section, Plugin store.
    • docs/configuration.md describes the store settings, with an example that is validated against FOCA's model.
    • docs/plugins.md describes the listing fields and the chart keys.
    • The chart README covers the keys, the external MongoDB role and the FOCA 0.19 requirement for the store values. The values.yaml comments are updated too.

Closes #359

Behaviour and upgrade notes (for the 0.4.0 release notes)

  • proTES runs on FOCA 0.19.0. On startup it creates the collection plugin_store and its indexes (a TTL index on expires_at, one on ns) in taskStore, or in the database named by MONGO_DBNAME. The database user needs createIndex, which readWrite includes and which the chart's app user has. Without that right, proTES starts anyway and logs an error, and plugin writes to the store fail.
  • The plugin listing (GET /ga4gh/tes/v1/plugins, /plugins/{plugin_id}) has two new required fields, data_stored and storage (listing spec 1.1.0).
  • New settings plugins.defaults.store and plugins.available.<id>.store. They have defaults, so existing configs need no change. The chart adds plugins.available.<id>.store (enabled, maxEntrySize, maxTtl).

Verification

  • pytest with coverage: 1253 passed, 1 skipped, 100% coverage. Helm 3 came from the k8s env, and helm dependency build checked out against charts.sha256.
  • pre-commit run --all-files: all hooks passed (ruff, ruff format, semgrep, gitleaks, actionlint, ast-grep with its rule tests, mypy).
  • The CI's helm lint deployment --strict runs pass, all three variants.
  • mkdocs build --strict: built with no warnings.
  • CI: all checks passed (CI passed, including Test (MongoDB 7.0), which runs against a real MongoDB, Test (mongomock), Chart, Smoke test, Scan image and Docs), plus CodeQL and the Read the Docs preview.

Review

Both reviewers ran, as required for a Helm chart change: adversarial-reviewer and quality-reviewer.

  • The adversarial reviewer found one low: the chart README did not say which FOCA version the store values need. Fixed.
  • The quality reviewer's mediums were all about wording and duplication in the docs. Fixed: the first-database rule, the in-memory store of plugins whose store is off, the shortened upgrade and chart notes, and the rewrapped plugins page.
  • The quality reviewer's low about chart bounds is fixed with test_plugins_store_bounds.
  • There was no second round, because the fixes after round 1 touched only docs and tests.

Declined review findings

  • Test the local storage mode (quality, low). proTES always has a database, so local (no db.dbs) does not happen in a valid proTES config. FOCA's own tests cover it.

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Upgrade proTES to FOCA 0.19 and add compatibility for its plugin store configuration and listing metadata.

New Features:

  • Add support for FOCA 0.19 plugin-store settings and plugin listing metadata.
  • Expose configurable plugin store options through the Helm chart.

Enhancements:

  • Update proTES runtime compatibility and container images to FOCA 0.19.
  • Document plugin-store behavior, operational requirements, configuration, upgrades, and API listing fields.
  • Validate plugin store configuration bounds and cover shared and disabled storage modes in tests.

Build:

  • Pin the Python dependency, smoke-test plugin dependency, and Docker base image to FOCA 0.19.

Deployment:

  • Add Helm values and schema support for per-plugin store settings, including camelCase-to-snake_case conversion.

Documentation:

  • Update FOCA version references and document plugin-store configuration, operations, upgrades, chart usage, and new plugin listing fields.

Tests:

  • Add coverage for plugin storage metadata, Helm store configuration rendering, validation, and FOCA-defined bounds.

uniqueg and others added 6 commits October 31, 2026 19:40
Pin foca>=0.19.0,<0.20 and the FOCA 0.19.0 base image by digest, also
in the smoke-test plugin and the version mentions of the docs. Test
the new required fields of the plugin listing (data_stored, storage).

Refs #359

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mirror FOCA 0.19's plugins.available.<id>.store (enabled, maxEntrySize,
maxTtl) in the chart's values and schema, converted to snake_case like
the other plugin keys; the defaults stay in config.plugins.

Refs #359

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Describe the plugin store of FOCA 0.19 for operators (collection
plugin_store in taskStore, indexes created on startup, createIndex
right), its settings, the new listing fields and the upgrade notes.

Refs #359

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name the first database rule and the in-memory store of plugins whose
store is off, shorten the upgrade and chart notes, and rewrap the
listing fields of the plugins page (review findings).

Refs #359

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Render the store settings of a plugin at FOCA's limits (maxTtl 0.001
and 10 years, maxEntrySize 1) and validate them with FOCA's model.

Refs #359

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The store settings of plugins need images built with FOCA 0.19 or
later; older images refuse the unknown keys.

Refs #359

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR migrates proTES to FOCA 0.19.0 through dependency and image pin updates, adds Helm support for FOCA's plugin-store settings with schema-driven validation and key translation, and documents and tests the new plugin-store behavior and required plugin-listing fields without adopting the new plugin store in proTES code itself.

Sequence diagram for plugin store startup initialization

sequenceDiagram
    participant ProTES
    participant MongoDB
    participant Plugin

    ProTES->>MongoDB: createIndex
    MongoDB-->>ProTES: indexes ready
    ProTES->>MongoDB: update plugin_store expiry
    MongoDB-->>ProTES: expiry updated
    Plugin->>MongoDB: store entry in plugin_store
    MongoDB-->>Plugin: entry persisted
Loading

Flow diagram for Helm plugin store configuration

flowchart LR
    Values[plugins.available.<id>.store] --> Schema[values.schema.json validation]
    Schema --> Keys[protes.pluginKeys]
    Keys --> Config[FOCA config.plugins]
    Config --> FOCA[FOCA 0.19]
    Defaults[plugins.defaults.store] --> Config
Loading

File-Level Changes

Change Details Files
Upgrade the application and container runtime to FOCA 0.19.0 while preserving compatibility with the existing proTES configuration and deployment model.
  • Pin the Python dependency, Docker base image, smoke-test plugin, and documentation examples to FOCA 0.19.
  • Update API and implementation references that report or describe the FOCA version.
  • Document the required FOCA version and retain the existing foca-common chart version.
Dockerfile
pyproject.toml
docs/api.md
docs/configuration.md
docs/plugin-images.md
docs/upgrading.md
pro_tes/ga4gh/tes/backends.py
tests/smoke/plugin/pyproject.toml
Expose and translate FOCA 0.19 plugin-store configuration through the Helm chart.
  • Add per-plugin store settings and FOCA-compatible bounds to chart values and schema.
  • Convert camelCase chart keys such as maxEntrySize and maxTtl to FOCA's snake_case configuration.
  • Keep global store defaults under config.plugins and document database permissions, external MongoDB usage, and FOCA version requirements.
  • Add rendering, validation, and boundary tests for store settings.
deployment/README.md
deployment/templates/_helpers.tpl
deployment/values.schema.json
deployment/values.yaml
tests/test_chart.py
Add compatibility coverage and operational documentation for FOCA's plugin store and expanded plugin listings.
  • Verify listing responses include data_stored and storage for shared and disabled stores.
  • Document plugin-store persistence, collection/index creation, TTL behavior, permissions, failure modes, and cleanup.
  • Document the new configuration settings, listing fields, storage modes, and upgrade implications.
tests/ga4gh/tes/test_client_choices.py
docs/configuration.md
docs/operations.md
docs/plugins.md
docs/upgrading.md

Possibly linked issues

  • build: use FOCA 0.19 #359: The PR directly implements the issue: FOCA 0.19 pins, listing fields, plugin-store documentation and permissions, chart settings, and tests.

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

read-the-docs-community Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 proTES | 🛠️ Build #35548947 | 📁 Comparing 0dbbe20 against latest (bbd5dc5)

  🔍 Preview build  

8 files changed · ± 8 modified

± Modified

@uniqueg
uniqueg marked this pull request as ready for review October 31, 2026 19:00
@codecov

codecov Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (bbd5dc5) to head (0dbbe20).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #360   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           23        23           
  Lines         2234      2234           
=========================================
  Hits          2234      2234           

☔ 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 found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/operations.md" line_range="245-246" />
<code_context>
+proTES starts anyway and logs a warning (an error, with the cause, for
+conflicting indexes, failed authentication or missing rights), and writes
+of plugins to the store fail until the indexes exist. On each start, proTES
+also cuts the expiry of stored entries to the current `max_ttl`; if that
+fails (logged), they keep their expiry until a later start succeeds.
+
+What each plugin keeps there is listed in the plugin listing (`data_stored`,
</code_context>
<issue_to_address>
**Entries outlive new TTL**

When a rolling deployment lowers `max_ttl` while old-config instances are still serving requests, the new instance shortens stored expiries at startup, but an old-config instance still serving requests can then write entries with its larger `max_ttl`. Those entries miss the startup cut and remain in MongoDB beyond the newly configured maximum.

Ensure old-config instances are drained before the final expiry cut, or enforce the current TTL continuously so stale instances cannot leave longer-lived entries.

Also at `docs/configuration.md:259-260`.
</issue_to_address>

### Comment 2
<location path="deployment/values.yaml" line_range="123-124" />
<code_context>
   #   tes.routing.distance:
   #     version: ">=1.0,<2"
   #     config: {}
+  #     store:
+  #       maxTtl: 86400
   # Steps that process each new task, in order, each with alternatives
   # tried in order (the long form of FOCA's steps only)
</code_context>
<issue_to_address>
**Plugins see inconsistent shared data**

When two plugin IDs from the same distribution are configured with different `store.enabled` values, fOCA gives plugins from the same distribution a shared namespace, but different `store.enabled` values send their entries to different backends. One plugin then cannot see entries written by another, so shared counters or caches return inconsistent results.

Validate or warn when plugins from the same distribution have conflicting `store.enabled` values.
</issue_to_address>

Linked issues

#359 build: use FOCA 0.19 · 6 of 6 met

# Requirement Status Notes
1 Pin FOCA 0.19.0 in the dependency, base image, smoke-test plugin and documentation examples. ✅ Met The dependency range, digest-pinned image, smoke-test plugin pin and FOCA version examples are updated.
2 Cover the plugin listing fields data_stored and storage in tests and documentation. ✅ Met The listing test checks both fields, and the plugin and upgrade documentation describe them.
3 Document the plugin store collection, startup indexes and required database permission in upgrade and operator documentation. ✅ Met The upgrade and operations documentation cover the plugin_store collection, its indexes and the createIndex permission.
4 Add plugins.available.<id>.store to the Helm values and schema in camelCase, convert its keys to snake_case, and keep defaults in config.plugins. ✅ Met The chart values, schema and key conversion include the store settings; the defaults remain in config.plugins.
5 Document plugins.defaults.store and plugins.available.<id>.store. ✅ Met The configuration and chart documentation describe both settings.
6 Keep the foca-common library chart unchanged. ✅ Met

Sourcery assessment

Needs a human reviewer. 2 findings to address first, and FOCA 0.19 adds a persistent plugin store with TTL-based deletion, and startup can shorten existing entries’ expiry to the configured maximum. If that retention limit is wrong, plugin data may be deleted before plugins expect it; reverting the image does not restore expired records.

Blocking findings: docs/operations.md:246, deployment/values.yaml:124


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

Comment thread docs/operations.md Resolved
Comment thread deployment/values.yaml Resolved
Restart once more after a rolling update that lowers max_ttl, and note
that plugins of one distribution need the same store.enabled (Sourcery
review).

Refs #359

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit 5d04da6 into dev Oct 31, 2026
19 checks passed
@uniqueg
uniqueg deleted the build/foca-0.19 branch October 31, 2026 19:10
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.

build: use FOCA 0.19

1 participant