Skip to content

feat(chart): allow app probe overrides - #642

Merged
uniqueg merged 3 commits into
devfrom
feat/chart-probe-overrides
Nov 3, 2026
Merged

uniqueg merged 3 commits into
devfrom
feat/chart-probe-overrides

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Closes #603

Summary

Adds <valuesKey>.startupProbe, readinessProbe and livenessProbe to foca-common: a probe that is set replaces the default on probePath entirely, rendered as is, as for the worker; an empty map keeps the default. No FOCA code change and no new endpoints. Schema, petstore example and docs (a "Probes" section in the deployment notes, with an example for slow starts).

Without overrides, rendering differs only in a comment (see the snapshots).

Verification

  • pytest charts/foca-common/tests with Helm 3.22.1, the version of CI: passed
  • helm lint --strict charts/foca-common: passes
  • ruff check, ruff format, mkdocs build --strict: pass
  • Kind install: CI only
  • New override tests failed before the change.

Declined review findings

  • Bump the chart to 0.5.0: docs/helm-chart.md asks for one new version for all changes up to the next release; chart-v0.4.0 isn't tagged yet (latest chart-v0.3.0), so 0.4.0 still is that version. CI's chart version check agrees.
  • Stricter schema for probes (exactly one handler): the worker's probes have the same loose schema, and the API server rejects invalid probes on apply. The docs say so.

🤖 Generated with Claude Code

https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG

Summary by Sourcery

Add configurable application probe overrides to the common Helm chart while preserving default probe behavior.

New Features:

  • Allow application startup, readiness, and liveness probes to be overridden through chart values while retaining the existing defaults when unset or empty.

Enhancements:

  • Document application probe configuration and provide an example for applications with slow startup or response times.

Documentation:

  • Document the new application probe override values and their replacement behavior.
  • Add probe override examples to the Petstore chart configuration.

Tests:

  • Add coverage for default probes, individual probe overrides, and empty-map behavior.

Let operators replace the app container's startup, readiness and
liveness probes, as they can for the worker. Without an override,
rendering only differs in a comment. No new endpoints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
@uniqueg uniqueg added this to the v0.20.0 milestone Nov 3, 2026
@uniqueg uniqueg added the type: feature New feature or request label Nov 3, 2026
@sourcery-ai

sourcery-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

The chart now supports independently overriding application startup, readiness, and liveness probes by rendering supplied Kubernetes probe specs verbatim, while omitted or empty values retain the existing probePath-based defaults; schemas, examples, tests, snapshots, and deployment documentation are updated accordingly.

Flow diagram for application probe rendering

flowchart TD
    Values[Application values] --> ProbeSelection{Probe override set?}
    ProbeSelection -->|Yes| Override[Render supplied Kubernetes probe spec]
    ProbeSelection -->|No or empty map| Default[Render default probe using probePath]
    Override --> Deployment[Application Deployment]
    Default --> Deployment
Loading

File-Level Changes

Change Details Files
Add optional per-probe overrides while preserving the existing defaults when values are omitted or empty.
  • Render startup, readiness, and liveness probe values verbatim when provided.
  • Fall back independently to the existing probe definitions otherwise.
  • Use Helm with semantics so empty maps retain defaults.
charts/foca-common/templates/_deployment.tpl
Expose probe override configuration through validation and the example chart.
  • Add startup, readiness, and liveness probe properties to the application schemas.
  • Document empty defaults and replacement semantics in example values.
charts/foca-common/app-values.schema.json
examples/petstore/chart/values.schema.json
examples/petstore/chart/values.yaml
Cover default, override, and empty-map behavior with template tests and refreshed snapshots.
  • Verify each probe defaults to the configured probe path.
  • Verify one override replaces only its selected probe and updates fallback probes for a changed path.
  • Verify an empty override preserves the default probe.
charts/foca-common/tests/test_templates.py
charts/foca-common/tests/__snapshots__/celery.yaml
charts/foca-common/tests/__snapshots__/default.yaml
charts/foca-common/tests/__snapshots__/http-route.yaml
charts/foca-common/tests/__snapshots__/ingress-https.yaml
charts/foca-common/tests/__snapshots__/mongodb-external.yaml
charts/foca-common/tests/__snapshots__/replicas.yaml
charts/foca-common/tests/__snapshots__/route.yaml
Document application probe customization and its Kubernetes validation implications.
  • List the new values in the chart reference.
  • Provide a slow-start and slow-load example.
  • Explain complete replacement, empty-map fallback, values-file merging, and endpoint limitations.
docs/helm-chart.md

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

@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 (8b22ad7) to head (cd68c4d).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #642   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           56        56           
  Lines         7119      7119           
=========================================
  Hits          7119      7119           
Flag Coverage Δ
test_unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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 06:49

@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="docs/helm-chart.md" line_range="809" />
<code_context>
+So setting only `failureThreshold`, without `httpGet`, fails when the
+Deployment is applied. Helm merges values files, also these maps: to switch the
+kind of check over a probe set in another values file, set the probe to `null`
+in a file in between.
+
+FOCA has no health endpoints yet, so choose a path that needs no
</code_context>
<issue_to_address>
**Null probe resets fail validation**

When an app chart omits the optional probe key from its defaults and a later values file sets it to null to clear an earlier override, helm retains the null when the app chart has no default for that optional probe, and the added schema requires an object, so the values-file layering fails schema validation instead of restoring the default probe.

Allow null for the probe schema properties, or document that app charts must define empty probe maps in their defaults for this reset pattern.
</issue_to_address>

Linked issues

#603 feat(chart): allow app probe overrides · 6 of 7 met · 1 to check by hand

# Requirement Status Notes
1 Allow overrides for startupProbe, readinessProbe and livenessProbe. ✅ Met Each app probe uses the supplied non-empty map in place of its default.
2 Keep the current defaults for empty maps and render defaults unchanged for existing values. ✅ Met Empty maps fall back to the defaults; the snapshots change only in comments.
3 Add schema, docs with a slow-start example, and the Petstore example. ✅ Met Both schemas include the probe fields, and the docs and Petstore values show their use.
4 Make no FOCA code change and add no new endpoints. ✅ Met The changes are limited to chart templates, values, schemas, docs and tests.
5 Test unchanged defaults and full replacement for each probe type. ✅ Met Parameterized tests cover all three overrides and default probes.
6 Pass helm lint and chart unit tests. ✅ Met The PR verification reports both passed.
7 Pass the kind install. 👀 Check by hand (runtime) Check the CI kind-install result; the PR verification says this runs in CI only.

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: docs/helm-chart.md:809


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

Comment thread docs/helm-chart.md Resolved
uniqueg and others added 2 commits November 3, 2026 07:54
App charts without defaults for the probes keep a null of a values file,
which the documented way to clear an override relies on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011FSoqMUX3EU35poH13xMgG
@uniqueg
uniqueg merged commit 16812d8 into dev Nov 3, 2026
56 checks passed
@uniqueg
uniqueg deleted the feat/chart-probe-overrides branch November 3, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(chart): allow app probe overrides

1 participant