Skip to content

build(chart): use foca-common 0.4.0 - #406

Merged
uniqueg merged 2 commits into
devfrom
build/chart-foca-common-0.4.0
Nov 3, 2026
Merged

uniqueg merged 2 commits into
devfrom
build/chart-foca-common-0.4.0

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Closes #398

Summary

  • Chart on the released foca-common 0.4.0: Chart.yaml, Chart.lock, charts.sha256, values.schema.json and links to the library's docs.
  • Adopt its new values: pluginStore.existingSecret (the name plugins.existingSecret was never released), protes.replicas with protes.podDisruptionBudget and a template for it, and protes.startupProbe, readinessProbe and livenessProbe.
  • requireAudience: true: the library now accepts issuers with audiences of their own, so the helper protes.requireAudience goes, as FOCA's migration guide says.
  • protes.extraEnv can't set FOCA_PLUGINS_STORE_KEY_SECRET, which the chart sets.
  • Docs: deployment/README.md (Secrets, Several replicas, Probes), docs/upgrading.md, docs/development.md.

pluginStore.existingSecret has 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):

  • New chart tests first, failing on foca-common 0.2.0 (6 failed), then passing.
  • Default render with ci/test-values.yaml: differs from dev by one comment in the Deployment.
  • The archive's schema and templates are the same as tag chart-v0.4.0; charts.sha256 updated from the downloaded archive.
  • Full pytest with coverage: 1471 passed, 11 skipped, 100% (before the last review fixes, which change the chart and its tests only).
  • After them: tests/test_chart.py 185 passed; chart README, release pins and version mention tests pass; helm lint --strict with the CI values passes; scripts/check_release_pins.py passes; pre-commit run --all-files passes.

CI: all checks pass, including Chart, Smoke test and the chart install.

Not run locally: helm test and the chart install on kind, which CI covers.

Declined review findings

  • pluginStore.existingSecret is ignored by the FOCA 0.19 image on dev (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:

  • Add support for plugin-store Secrets, configurable application replicas with PodDisruptionBudgets, and customizable application probes.
  • Allow issuer-specific audiences without requiring a global audience when all issuers define their own.

Bug Fixes:

  • Prevent protes.extraEnv from overriding the chart-managed plugin-store secret environment variable.

Enhancements:

  • Upgrade the Helm chart dependency to foca-common 0.4.0 and align chart metadata, schemas, templates, and documentation with the new library release.

Documentation:

  • Document plugin-store Secrets, multiple application replicas, probe configuration, and the upgrade implications of foca-common 0.4.0.

Tests:

  • Expand chart coverage for plugin-store secrets, replica disruption budgets, probe overrides, and issuer audience validation.

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]>
@uniqueg uniqueg added the type: delivery Related to packaging, deployment etc. label Nov 3, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The 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 configuration

sequenceDiagram
    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
Loading

Flow diagram for scalable app deployment and disruption protection

flowchart TD
    Values["protes.replicas and podDisruptionBudget"] --> Render["Helm render"]
    Render --> Pods["Multiple app pods"]
    Render --> PDB["PodDisruptionBudget"]
    PDB -->|limits voluntary evictions| Pods
Loading

File-Level Changes

Change Details Files
Upgrade the packaged Helm library dependency and synchronize chart metadata and documentation with foca-common 0.4.0.
  • Pin the dependency and lockfile to 0.4.0.
  • Refresh the packaged archive checksum and schema.
  • Update links and guidance to the 0.4.0 library documentation and migration notes.
deployment/Chart.lock
deployment/Chart.yaml
deployment/charts.sha256
deployment/values.schema.json
deployment/README.md
docs/development.md
docs/upgrading.md
Expose plugin-store Secret configuration while ensuring the chart retains ownership of its environment variable.
  • Add pluginStore.existingSecret and inject its key into app and worker containers without placing it in the ConfigMap overlay.
  • Reserve FOCA_PLUGINS_STORE_KEY_SECRET from protes.extraEnv and reject plugin-store secrets configured in plain config.
  • Document the FOCA 0.20 image requirement and secret rotation implications.
deployment/values.yaml
deployment/templates/_helpers.tpl
deployment/README.md
deployment/ci/optional-values.yaml
tests/test_chart.py
Adopt application scaling and PodDisruptionBudget support from the library chart.
  • Add protes.replicas and podDisruptionBudget values with validation for replica counts and mutually exclusive availability limits.
  • Add the PodDisruptionBudget template and exercise independent app and worker replica settings.
deployment/values.yaml
deployment/templates/poddisruptionbudget.yaml
deployment/values.schema.json
deployment/ci/optional-values.yaml
tests/test_chart.py
deployment/README.md
Expose configurable startup, readiness, and liveness probes for the application.
  • Add empty probe override values that replace the corresponding library defaults.
  • Verify each override renders unchanged into the app container and document the behavior.
deployment/values.yaml
deployment/values.schema.json
tests/test_chart.py
deployment/README.md
Align audience validation with foca-common 0.4.0 issuer behavior.
  • Set requireAudience unconditionally and remove the obsolete helper.
  • Continue rejecting invalid global audiences while permitting issuers whose audiences are all configured individually.
  • Update regression coverage for issuer-specific and mixed audience configurations.
deployment/templates/_helpers.tpl
tests/test_chart.py

Possibly linked issues


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 Nov 3, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 proTES | 🛠️ Build #35627538 | 📁 Comparing 80ed8f2 against latest (1ab74e1)

  🔍 Preview build  

2 files changed
± deployment/index.html
± upgrading/index.html

@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1ab74e1) to head (80ed8f2).

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.
📢 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 3, 2026 22:27

@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_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


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

Comment thread tests/test_chart.py Resolved
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]>
@uniqueg
uniqueg merged commit 5a57844 into dev Nov 3, 2026
34 of 44 checks passed
@uniqueg
uniqueg deleted the build/chart-foca-common-0.4.0 branch November 3, 2026 22:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: delivery Related to packaging, deployment etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

build(chart): use foca-common 0.4.0

1 participant