Repository navigation
build: move to FOCA 0.20.0 - #351
Conversation
Base image and lock on FOCA 0.20.0; the image has no pip, so its build uses uv, and pip-vendored advisories leave .trivyignore.yaml. The chart moves to foca-common 0.4.0, with values for probes, and leaves checking audiences to the library. Closes #350 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Also review fixes in comments and docs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe PR upgrades the application to FOCA 0.20.0 and foca-common 0.4.0, reworks the image build around digest-pinned uv mounts so the final image contains neither installer, adds validation and CI coverage for the new build contract, and updates Helm behavior and documentation for probes and audience enforcement. Sequence diagram for the hash-checked uv image buildsequenceDiagram
participant UV as uv stage
participant Build as Build stage
participant Base as FOCA base image
participant Image as Final image
Build->>UV: uv export --frozen
Build->>UV: uv venv
Build->>UV: uv pip install --require-hashes
Build->>Base: uv build --offline
Base->>Image: Create final image
Image->>UV: uv export --frozen
Image->>UV: uv pip install --system --require-hashes --compile-bytecode
Image->>UV: uv pip check --system
Image-->>Image: Remove temporary uv lock
Flow diagram for Helm audience enforcement and configurable probesflowchart TD
Values[Helm values]
Config[Rendered app configuration]
Library[foca-common 0.4.0]
Audience[requireAudience: true]
Probes[Optional startup readiness liveness probes]
Deployment[Kubernetes deployment]
Values --> Config
Library --> Config
Config --> Audience
Config --> Probes
Audience --> Deployment
Probes --> Deployment
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 #351 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 23 23
Lines 2625 2625
=========================================
Hits 2625 2625 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="deployment/values.yaml" line_range="91-93" />
<code_context>
probePath: /ga4gh/registry/v1/ui/
+ # Probes of the app's container (Kubernetes probe specs); if set, one
+ # replaces the default on `probePath` entirely
+ startupProbe: {}
+ readinessProbe: {}
+ livenessProbe: {}
# Number of the app's pods; with more than one, the app stays available
# while a pod is restarted or evicted (e.g., on node drains, crashes and
</code_context>
<issue_to_address>
**Invalid probe overrides reach deployment**
When a user supplies a malformed probe override, the chart schema accepts any object for these overrides, so a probe missing its required handler or containing invalid fields passes Helm validation and is rejected only by the Kubernetes API, failing the release or upgrade.
Validate probe overrides against Kubernetes probe-spec structure in the chart schema, including a required handler and supported fields.
</issue_to_address>
### Comment 2
<location path="docs/upgrading.md" line_range="100" />
<code_context>
+**FOCA 0.20:** the app now builds on FOCA 0.20 (see [FOCA's migration
+guide](https://foca.readthedocs.io/en/v0.20.0/migration-0.20/)), whose image has
+no pip. Images derived from the app's image that run `pip install` must use uv
+instead. The app has no gateway plugins, so the plugin store and its secret
+don't apply. The Helm chart is now on foca-common 0.4.0, which checks audiences:
</code_context>
<issue_to_address>
**Derived image builds lack uv**
When a derived-image build uses `uv` without adding the uv binary or mounting it from a separate stage, a downstream Dockerfile that follows this instruction by replacing `pip install` with `uv pip install` fails with `uv: not found`: the final app image contains neither installer, and the note does not say to add or mount uv for the build.
Explain that derived-image builds must source uv separately, for example by mounting it from a pinned uv image in the relevant build step.
</issue_to_address>
### Comment 3
<location path="deployment/templates/_helpers.tpl" line_range="22" />
<code_context>
valuesKey: cloudRegistry
maxContentLength: 1048576
-requireAudience: {{ include "cloud-registry.requireAudience" . }}
+requireAudience: true
mongodb:
databases: [serviceStore]
</code_context>
<issue_to_address>
**Audience guidance contradicts chart behavior**
When an operator consults the chart's default values comments while configuring audiences per issuer, deployments with an audience on each issuer do not need a global audience, but `deployment/values.yaml` still says they must set `security.auth.audience` unless audience verification is disabled, misleading operators about valid configuration.
Update the audience guidance in `deployment/values.yaml` to mention that every issuer can provide its own audience instead of setting a global one.
</issue_to_address>Linked issues
#350 Move to FOCA 0.20.0 · 6 of 6 met
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Move Cloud Registry to FOCA 0.20.0 before 1.0.0rc2, following the migration guide. | ✅ Met | The dependency and base image use FOCA 0.20.0, and the 1.0.0rc2 release notes and upgrade guide document the move. |
| 2 | Set foca>=0.20.0,<0.21 in pyproject.toml and update uv.lock. |
✅ Met | pyproject.toml and the lock contain the requested FOCA constraint and 0.20.0 release. |
| 3 | Use the pinned FOCA 0.20.0 base image, install in the final stage with mounted uv, and remove the pip-vendored entries from .trivyignore.yaml. |
✅ Met | The Dockerfile pins the 0.20.0 image by digest and mounts uv for installation; the ignore file is cleared, and CI checks that the image has no installer. |
| 4 | Move the chart to foca-common 0.4.0, apply its relevant new values, and omit pluginStore.existingSecret when the chart does not need to carry it. |
✅ Met | The chart pins 0.4.0, adds the three app probe values, and excludes pluginStore from its values schema. |
| 5 | Update the custom-configuration validation test for a plain ValueError as the cause. |
✅ Met | test_create_app_service_info_in_custom asserts that the cause is exactly ValueError. |
| 6 | Update the upgrade notes, 1.0.0rc2 release notes, and development documentation. | ✅ Met | All three documents include the FOCA 0.20.0 migration information. |
Sourcery assessment
Approval pending. 1 finding to address first, and the security scan did not finish.
Blocking findings: deployment/values.yaml:93
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes #350
Summary
foca>=0.20.0,<0.21and the lock; base imageelixircloud/foca:0.20.0-py3.13by digest. FOCA 0.19.0 has no migration guide, as nothing breaks.--compile-bytecodefor the read-only root file system. A smoke test step checks that the image has no installer. All pip-vendored entries leave.trivyignore.yaml.foca-common0.4.0:Chart.yaml,Chart.lock,charts.sha256, schema and links. New valuescloudRegistry.startupProbe,readinessProbeandlivenessProbe.requireAudience: true: the library now checks audiences of issuers, so the app's helper goes.pluginStore.existingSecretdoesn't apply: the app has no gateway plugins and no plugin store. It stays out ofvalues.yamland the schema, whichtest_schema_of_libraryrecords.ValueErroras__cause__, not theValidationError(tests/test_app.py).tests/test_image_build.pyfollows proTES's checks of the uv build.docs/upgrading.md,docs/releases/1.0.0rc2.md,docs/development.md,deployment/README.md.How it was verified
Locally, with Helm 3.22.1:
pytestwith coverage (mongomock): 2 failed, 2025 passed, 11 skipped, 100%. Both failures weretest_issuer_audience_requiredwith the library's new message; the cases moved totest_issuer_audience_invalid, andtests/test_image_build.py,test_config.pyandtest_chart.pypass (303 passed).tests/test_app.py,test_invitations.py,test_access_control.pyandtest_upgrade_rc1.pyon MongoDB 7.0: 493 passed.docker buildof the image: FOCA 0.20.0, nopiporuvin the image, 20.pycfiles for the app.pre-commit run --all-files: passes;gitleaksskipped in the last run, passed in the one before the last two commits.mkdocs build --strict: passes.Not run locally: the image scan, the smoke test and the chart install on kind. In CI, all checks pass, including Scan image (with the empty
.trivyignore.yaml), Smoke test (with the new installer check), Chart and Test on mongomock and MongoDB 7.0.Declined review findings
tests/test_image_build.pycovers the Dockerfile.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Upgrade the application and deployment chart to FOCA 0.20 while producing installer-free runtime images and exposing the updated chart configuration.
New Features:
Bug Fixes:
Enhancements:
Build:
CI:
Documentation:
Tests: