Repository navigation
build: use FOCA 0.19 - #360
Conversation
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]>
Reviewer's GuideThis 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 initializationsequenceDiagram
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
Flow diagram for Helm plugin store configurationflowchart 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
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 #360 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 2234 2234
=========================================
Hits 2234 2234 ☔ 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="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
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]>
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.
foca>=0.19.0,<0.20and the base imageelixircloud/foca:0.19.0-py3.13by digest (sha256:82446bdd…). The smoke-test plugin pin and the FOCA versions in the docs examples move to 0.19 as well. Thefoca-commonlibrary chart stays at 0.2.0, because no chart has been released since then.test_list_plugins_storagecovers the new required fieldsdata_storedandstorage. It checkssharedwith the database andoffwithstore.enabled: false.plugins.available.<id>.store(enabled,maxEntrySize,maxTtl) is now invalues.yamlandvalues.schema.json, with FOCA's bounds.protes.pluginKeysconverts it to snake_case.test_plugins_keys, which checks that the schema mirrors FOCA'sPluginsConfig, passes again.plugins.defaults.storestays inconfig.plugins, like the other defaults.docs/upgrading.mdhas a new section, Plugin store. It covers theplugin_storecollection intaskStore, the indexes created on startup, thecreateIndexright (part ofreadWrite) and the new listing fields.docs/operations.mdhas a new section, Plugin store.docs/configuration.mddescribes the store settings, with an example that is validated against FOCA's model.docs/plugins.mddescribes the listing fields and the chart keys.values.yamlcomments are updated too.Closes #359
Behaviour and upgrade notes (for the 0.4.0 release notes)
plugin_storeand its indexes (a TTL index onexpires_at, one onns) intaskStore, or in the database named byMONGO_DBNAME. The database user needscreateIndex, whichreadWriteincludes 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.GET /ga4gh/tes/v1/plugins,/plugins/{plugin_id}) has two new required fields,data_storedandstorage(listing spec 1.1.0).plugins.defaults.storeandplugins.available.<id>.store. They have defaults, so existing configs need no change. The chart addsplugins.available.<id>.store(enabled,maxEntrySize,maxTtl).Verification
pytestwith coverage: 1253 passed, 1 skipped, 100% coverage. Helm 3 came from the k8s env, andhelm dependency buildchecked out againstcharts.sha256.pre-commit run --all-files: all hooks passed (ruff, ruff format, semgrep, gitleaks, actionlint, ast-grep with its rule tests, mypy).helm lint deployment --strictruns pass, all three variants.mkdocs build --strict: built with no warnings.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-reviewerandquality-reviewer.test_plugins_store_bounds.Declined review findings
localstorage mode (quality, low). proTES always has a database, solocal(nodb.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:
Enhancements:
Build:
Deployment:
Documentation:
Tests: