Repository navigation
build(chart): use foca-common 0.4.0 - #406
Conversation
Move the chart to the released library chart, with its lock, digest and values schema, and adopt what it adds: `pluginStore.existingSecret`, `protes.replicas` with `protes.podDisruptionBudget`, and the probes of the app's container. The library now accepts issuers with audiences of their own, so `requireAudience` is simply true and the workaround helper goes. `protes.extraEnv` can't set `FOCA_PLUGINS_STORE_KEY_SECRET`, which the chart sets. The default render differs by one comment only. Closes #398 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideThe chart is upgraded to foca-common 0.4.0 and adopts its Secret, scaling, disruption-budget, probe, and audience-validation behavior, with corresponding values/schema, documentation, packaged metadata, and Helm render tests updated. Sequence diagram for chart validation and probe configurationsequenceDiagram
participant Operator
participant Helm
participant Chart
participant Kubernetes
Operator->>Helm: helm template
Helm->>Chart: render protes.settings
Chart->>Chart: protes.validate
Chart-->>Helm: Deployment and probe configuration
Helm-->>Operator: Rendered manifests
Kubernetes->>Kubernetes: startupProbe
Kubernetes->>Kubernetes: readinessProbe
Kubernetes->>Kubernetes: livenessProbe
Flow diagram for scalable app deployment and disruption protectionflowchart TD
Values["protes.replicas and podDisruptionBudget"] --> Render["Helm render"]
Render --> Pods["Multiple app pods"]
Render --> PDB["PodDisruptionBudget"]
PDB -->|limits voluntary evictions| Pods
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 #406 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 24 24
Lines 2479 2479
=========================================
Hits 2479 2479 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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_chart.py" line_range="1807" />
<code_context>
+ assert budget["spec"]["maxUnavailable"] == 1
+ pod_labels = docs[("Deployment", APP)]["spec"]["template"]["metadata"]["labels"]
+ selector = budget["spec"]["selector"]["matchLabels"]
+ assert selector.items() <= pod_labels.items()
+
+
</code_context>
<issue_to_address>
**Unscoped disruption budget passes**
When the rendered PodDisruptionBudget has an empty `matchLabels` map, the selector subset assertion in `test_replicas_budget` (line 1807) accepts an empty `matchLabels` map, so a namespace-wide PodDisruptionBudget selector passes even though it also affects unrelated workloads.
Assert that the selector includes labels that uniquely identify the app's pods, or compare it with the expected app selector.
</issue_to_address>Linked issues
#398 build(chart): use foca-common 0.4.0 · 5 of 6 met · 1 to check by hand
| # | Requirement | Status | Notes |
|---|---|---|---|
| 1 | Bump foca-common and update Chart.lock and deployment/charts.sha256. | ✅ Met | Chart.yaml and Chart.lock pin 0.4.0, and charts.sha256 names the matching 0.4.0 archive. |
| 2 | Adopt the new values where they apply to proTES in values.yaml, values.schema.json, and chart tests. | ✅ Met | The chart adds plugin-store Secret configuration, app replicas and PodDisruptionBudget settings, and app probe overrides, with corresponding schema and rendering tests. |
| 3 | Update deployment/README.md and the upgrade notes for 0.5.0. | ✅ Met | Both documents describe the new chart values and behavior; the README links to the 0.4.0 library-chart documentation. |
| 4 | Use released foca-common 0.4.0 and pass check_release_pins.py. | ✅ Met | The dependency and lock are pinned to 0.4.0, and the PR reports check_release_pins.py passes. |
| 5 | Have chart tests and helm lint pass, including with optional values. | ✅ Met | The chart tests render both standard and optional CI values; the PR reports the chart tests and helm lint pass. |
| 6 | Ensure FOCA's chart-v0.4.0 tag exists before relying on the release. | 👀 Check by hand (external system) | Verify that FOCA's chart-v0.4.0 tag and the corresponding OCI chart release are available externally. |
Sourcery assessment
Needs a human reviewer. 1 finding to address first, and if the plugin-store key secret is set, key_for() produces hashes tied to that secret, so a wrong or changed secret can leave persisted plugin entries unreachable after a revert; restoring the previous secret may recover them, but entries created under the wrong key may need repair. The default remains unset, so this does not change existing store keying unless an operator opts in.
Blocking findings: tests/test_chart.py:1807
An empty selector would pass a subset check, and would cover all pods of the namespace. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes #398
Summary
foca-common0.4.0:Chart.yaml,Chart.lock,charts.sha256,values.schema.jsonand links to the library's docs.pluginStore.existingSecret(the nameplugins.existingSecretwas never released),protes.replicaswithprotes.podDisruptionBudgetand a template for it, andprotes.startupProbe,readinessProbeandlivenessProbe.requireAudience: true: the library now accepts issuers with audiences of their own, so the helperprotes.requireAudiencegoes, as FOCA's migration guide says.protes.extraEnvcan't setFOCA_PLUGINS_STORE_KEY_SECRET, which the chart sets.deployment/README.md(Secrets, Several replicas, Probes),docs/upgrading.md,docs/development.md.pluginStore.existingSecrethas an effect only on images with FOCA 0.20 or later:dev's image is on 0.19 until #399, which is in the same milestone. The docs say so. The release 0.5.0 needs both.How it was verified
Locally, with Helm 3.22.1 from the mise path (the shim has no version set):
foca-common0.2.0 (6 failed), then passing.ci/test-values.yaml: differs fromdevby one comment in the Deployment.chart-v0.4.0;charts.sha256updated from the downloaded archive.pytestwith coverage: 1471 passed, 11 skipped, 100% (before the last review fixes, which change the chart and its tests only).tests/test_chart.py185 passed; chart README, release pins and version mention tests pass;helm lint --strictwith the CI values passes;scripts/check_release_pins.pypasses;pre-commit run --all-filespasses.CI: all checks pass, including Chart, Smoke test and the chart install.
Not run locally:
helm testand the chart install on kind, which CI covers.Declined review findings
pluginStore.existingSecretis ignored by the FOCA 0.19 image ondev(reviewer: high): documented rather than removed, as build: move to FOCA 0.20 #399 follows in the same milestone and the brief keeps the value in this PR.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Adopt foca-common 0.4.0 and expose its updated deployment, secret-management, probe, and audience-validation capabilities in the Helm chart.
New Features:
Bug Fixes:
protes.extraEnvfrom overriding the chart-managed plugin-store secret environment variable.Enhancements:
Documentation:
Tests: