Skip to content

build: move to FOCA 0.21 - #434

Merged
uniqueg merged 1 commit into
devfrom
build/foca-0.21
Nov 5, 2026
Merged

uniqueg merged 1 commit into
devfrom
build/foca-0.21

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Closes #433

Summary

  • Base image elixircloud/foca:0.21.0-py3.13 by digest, with the pin foca>=0.21.0,<0.22 and the lock.
  • The apt workaround and its test are gone: the new image has apt 3.0.4, so CVE-2026-109518 is fixed there.
  • foca-plugins: its latest release, 0.2.0, and plugins 0.1.2 cap foca<0.21, so pyproject.toml pins the meta distribution and the two routing plugins to commit 8c5e0c2 of dev, which allows <0.22. Compared with the plugins' last tag, that commit changes no plugin source.
  • The image has no Git and these requirements have no hashes, so the build stage fetches that commit with ADD <repo>.git#<sha> and builds their wheels offline, with the locked build requirements. scripts/image_requirements.py leaves them out and rejects any other form of reference. A test checks that the commits in pyproject.toml and the Dockerfile match.
  • The release pin check flags the three references, so a release of proTES needs a release of foca-plugins first. docs/development.md lists what to remove then.

No release, tag or version bump of proTES. The chart stays on foca-common 0.4.0.

FOCA 0.21 for proTES

Went through the release notes' breaking changes. In the code, only the tests of index errors needed changing, for FOCA's new message. proTES keeps no MongoDB client across forks, doesn't read jobs.backend and doesn't call is_admin. What applies to operators is in the new section "To version 0.6.0" of docs/upgrading.md. That number follows the milestone of #433; docs/operations.md, the chart's README and the examples in the docs follow.

How it was verified

Locally, with a private Compose project, port and image tag, removed afterwards:

  • Image built from the Dockerfile: FOCA 0.21.0, apt 3.0.4, plugins 0.1.2 from the commit, and its uv pip check passed.
  • tests/smoke/check.sh passed.
  • pytest passed (1613 passed, 11 skipped), and pre-commit run --all-files and mkdocs build --strict passed.

Not run locally, left to CI: tests/smoke/plugins.sh (it would overwrite the shared local tag protes:plugins), the Trivy scan, and the integration jobs on Funnel, TESP-API and TESK.

CI: see the checks of this PR.

Declined review findings

None open: the reviewers' findings on uv.lock (regenerated with the locked uv 0.13.6) and the docs were fixed.

Open questions

None.

🤖 Generated with Claude Code

Summary by Sourcery

Move proTES to FOCA 0.21 with compatible pinned plugin builds and refreshed documentation, dependency validation, and tests.

Bug Fixes:

  • Update expected index-conflict error messages for FOCA 0.21.

Enhancements:

  • Upgrade proTES to FOCA 0.21 and document the resulting operator-facing changes.
  • Temporarily build the required foca-plugins distributions from a pinned compatible commit while their releases catch up.
  • Strengthen image dependency handling and verify that plugin source references match the Docker build commit.

Build:

  • Use the pinned FOCA 0.21.0 base image, removing the obsolete apt security workaround.

Documentation:

  • Update API, deployment, plugin, operations, development, and upgrade documentation for FOCA 0.21 and the temporary plugin pinning.

Tests:

  • Update test fixtures and coverage for FOCA 0.21 compatibility and pinned plugin builds.

Base image and pin on FOCA 0.21.0, whose image has the fixed apt, so the
workaround goes. The releases of foca-plugins cap foca<0.21, so pin it
and its two routing plugins to a commit of dev, and build their wheels
in the image's build stage. The release pin check flags these references
until foca-plugins has a release.

Closes #433

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

sourcery-ai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Moves proTES to the digest-pinned FOCA 0.21 image and dependency lock, temporarily builds FOCA 0.21-compatible routing plugins from a verified source commit, strengthens build-time consistency checks, updates affected tests, and documents operational and upgrade implications.

Flow diagram for pinned plugin dependency validation

flowchart TD
    Requirements[pyproject.toml plugin commit references]
    Validator[scripts/image_requirements.py]
    Docker[Dockerfile plugin commit]
    Test[Commit consistency test]
    Wheels[Plugin wheels built offline]

    Requirements --> Validator
    Requirements --> Test
    Docker --> Test
    Validator -->|Exclude from exported image requirements| Wheels
    Test -->|Matching commit| Wheels
Loading

File-Level Changes

Change Details Files
Upgrade the runtime and dependency set to FOCA 0.21 while preserving routing-plugin compatibility through a pinned source commit.
  • Switch the pinned base image and application constraint to FOCA 0.21.
  • Replace the incompatible foca-plugins release with three commit-pinned distributions.
  • Fetch the exact plugin commit in the build stage and build its wheels offline.
  • Remove the obsolete apt security workaround and update the dependency lock.
Dockerfile
pyproject.toml
uv.lock
Extend dependency extraction and validation to safely handle source-pinned foca-plugins.
  • Exclude plugin commit references from runtime image requirements and reject unsupported reference forms.
  • Verify the Dockerfile commit matches the references in pyproject.toml.
  • Document the temporary plugin-build and release-pin workflow.
scripts/image_requirements.py
tests/test_image_requirements.py
docs/development.md
Adapt tests and smoke-plugin dependencies to FOCA 0.21 behavior.
  • Update index-conflict expectations to FOCA's new error message.
  • Update the smoke plugin's FOCA compatibility range and plugin installation assertions.
  • Remove the test for the deleted apt workaround.
tests/ga4gh/tes/test_default_routing.py
tests/smoke/plugin/pyproject.toml
tests/test_workflows.py
tests/utils/test_db.py
Refresh operator, API, deployment, and plugin documentation for the FOCA 0.21 upgrade.
  • Add upgrade guidance covering FOCA 0.21 configuration, request IDs, validation, workers, logging, MongoDB, indexes, and plugin compatibility.
  • Update documented FOCA versions and temporary source-built plugin behavior.
  • Clarify request-ID handling and the required chart/runtime image version.
deployment/README.md
docs/api.md
docs/operations.md
docs/plugin-images.md
docs/plugins.md
docs/upgrading.md

Possibly linked issues

  • build: move to FOCA 0.21 #433: The PR implements the issue’s requested FOCA 0.21 upgrade, plugin pinning, apt workaround removal, and upgrade notes.

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 #35666490 | 📁 Comparing 3010bd0 against latest (7b753a4)

  🔍 Preview build  

7 files changed · ± 7 modified

± Modified

@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (7b753a4) to head (3010bd0).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #434   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           24        24           
  Lines         2679      2685    +6     
=========================================
+ Hits          2679      2685    +6     

☔ 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.

@uniqueg
uniqueg marked this pull request as ready for review November 5, 2026 09:38

@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 1 issue

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

## Individual Comments

### Comment 1
<location path="tests/test_image_requirements.py" line_range="217" />
<code_context>
+        (root / "Dockerfile").read_text(),
+        re.M,
+    )
+    assert set(built) == set(locked)
</code_context>
<issue_to_address>
**Missing plugin pins go unnoticed**

When all plugin commit references are removed from both files, in `test_image_builds_plugins_of_pyproject`, line 217, equality succeeds for two empty sets, so the test passes even though no plugin commit is declared or built.

Assert that both extracted sets are non-empty before comparing them.
</issue_to_address>

Linked issues

#433 build: move to FOCA 0.21 · 4 of 4 met

# Requirement Status Notes
1 Use FOCA 0.21.0 for the base image and dependency pin, with the lock updated. ✅ Met The Dockerfile pins the FOCA 0.21.0 image by digest, and pyproject.toml and uv.lock are updated for FOCA 0.21.
2 Remove the apt upgrade if the new image makes it unnecessary. ✅ Met The apt upgrade workaround and its test are removed; the PR description reports that the new image has apt 3.0.4.
3 Use foca-plugins dev at a pinned commit until a compatible release, and have the release pin check flag it. ✅ Met The meta distribution and both routing plugins point to the same pinned commit, whose wheels are built in the Dockerfile. The release pin checker flags direct references.
4 Review FOCA 0.21.0 breaking changes for proTES and document the applicable changes in the upgrade notes. ✅ Met The new upgrade section covers the applicable discovery, configuration, request, worker, logging, MongoDB, index, and plugin impacts.

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and failed-run records will store generated request IDs by default instead of clients’ X-Request-ID values, so reverting will not restore the identifiers already written to those records. The impact is bounded to those records; the other documented behavior changes, such as rejecting query parameters or timing out sooner on MongoDB connections, are reverted with the FOCA version.

Blocking findings: tests/test_image_requirements.py:217


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

Comment thread tests/test_image_requirements.py Resolved
@uniqueg
uniqueg merged commit e47cac2 into dev Nov 5, 2026
50 checks passed
@uniqueg
uniqueg deleted the build/foca-0.21 branch November 5, 2026 09:48
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: move to FOCA 0.21

1 participant