Skip to content

feat(chart): render worker.startupProbe - #788

Merged
uniqueg merged 4 commits into
devfrom
feat/786-worker-startup-probe
Nov 18, 2026
Merged

uniqueg merged 4 commits into
devfrom
feat/786-worker-startup-probe

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Summary

  • worker.startupProbe: foca-common renders it like the readiness and liveness probes (verbatim, none if empty or null), and the schema has it.
  • Schema: the three worker probes accept null, and their descriptions say "null for none": app charts such as proTES set default probes, and Helm merges values into them, so null turns one off (an empty map changes nothing).
  • One handler per probe: proTES's protes.checkWorkerProbes (protes#505) is now in the library as foca-common.checkWorkerProbes, included by foca-common.validate. Rendering fails if a worker probe or one of its handlers isn't a map, or if a probe has more than one handler (set and not null, e.g., tcpSocket merged into a default exec) or none (e.g., only exec: null over a default). Kubernetes would refuse all of these. Like in proTES, the check also runs when the worker is disabled. It is skipped for app charts without worker values.
  • Examples: the petstore and gateway values have startupProbe: {}, and the petstore schema copy is updated.
  • Docs: the "Probes" section of docs/helm-chart.md covers the worker's probes, and the values table lists startupProbe. The 0.6.0 notes for the unreleased chart get a breaking-change entry for the check (it also covers leftover values of a disabled worker) and a feature entry. The chart version stays 0.6.0.

A draft follow-up issue for proTES to adopt this after a foca-common release is kept locally and is not posted.

Verification

  • Test-driven: the new worker probe tests failed before the change (19 failed: startup probe not rendered, no check, schema).
  • pytest charts/foca-common/tests tests/test_version_mentions.py tests/test_release_notes.py: 757 passed (Helm 3.22.1).
  • helm lint --strict on foca-common, on petstore with each ci/*-values.yaml, and on gateway with ci/test-values.yaml: all pass.
  • ruff check, ruff format --check, mypy (no issues), ast-grep scan, semgrep scan --config .semgrep --error and mkdocs build --strict all pass.
  • Not run locally: the chart-install kind job. CI ran it and passed, along with all other CI checks (gate CI passed, Chart, Chart install, Lint, Test matrix, CodeQL, codecov), on 506b428.
  • Review: adversarial-reviewer and quality-reviewer. Round 1 found one medium (the release notes) and lows; all are fixed except those under "Declined review findings". The handler counting changed, so round 2 ran the adversarial reviewer only.

Declined review findings

  • The three schema descriptions repeat "(Helm merges values into the app chart's default probe)". Kept: the descriptions show up one at a time (e.g., IDE hovers), so each needs the hint.
  • PING is a module-level dict shared by the tests. Kept: nothing mutates it, and the file already uses module-level constants the same way (e.g., CELERY_ENV).
  • The umbrella-chart (subchart) case of merged worker probes has no test. The reviewer checked it by rendering and it works. It follows from Helm's value coalescing and isn't specific to this check.

Open questions

None.

Closes #786

🤖 Generated with Claude Code

Summary by Sourcery

Support configurable and validated startup, readiness, and liveness probes for Celery workers.

New Features:

  • Add support for rendering worker startup probes alongside readiness and liveness probes.

Bug Fixes:

  • Reject invalid worker probe configurations that Kubernetes would refuse, including malformed handlers, multiple handlers, or missing handlers.

Enhancements:

  • Allow null to disable worker probes, including app-chart defaults, and validate probes even when the worker is disabled.

Documentation:

  • Document worker probe configuration, Helm merge behavior, and the new startup probe value.

Tests:

  • Add coverage for rendering, disabling, schema validation, Helm merging, and invalid worker probe configurations.

Chores:

  • Update example values, copied schemas, and 0.6.0 release notes for worker probe support and validation.

uniqueg and others added 3 commits November 18, 2026 12:16
Render worker.startupProbe like the readiness and liveness probes, and
fail rendering if a probe of the worker isn't a map or has more than
one handler or none (foca-common.checkWorkerProbes, moved from proTES's
protes.checkWorkerProbes). The schema accepts null for the worker
probes and says so: Helm merges values into an app chart's default
probes, so null turns one off.

Closes #786

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A handler counts when it is set and not null, so an empty httpGet
merged into a default exec probe is caught; a handler that isn't a
map fails. The release notes list the new check under breaking
changes, as it also applies to values of a disabled worker.

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

sourcery-ai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Extend the common and Petstore values schemas to accept nullable worker probes and include startupProbe.

  • charts/foca-common/app-values.schema.json L640-650
  • examples/petstore/chart/values.schema.json L640-650

Implementation

Add validation for worker probe shapes and handler counts, including probes on disabled workers, and render startupProbe in the worker container.

  • charts/foca-common/templates/_helpers.tpl L539-579
  • charts/foca-common/templates/_worker.tpl L84-87

Configuration

Add empty startupProbe defaults and clarify the worker-probe configuration comments in the example charts.

  • examples/gateway/chart/values.yaml L86
  • examples/petstore/chart/values.yaml L315-320

Documentation

Document worker startup probes, Helm merge behavior, and the new validation and release-note entries.

  • docs/helm-chart.md L182, L1026-1053
  • docs/releases/chart/0.6.0.md L1, L6, L12

Tests

Cover probe rendering and defaults, null and empty values, Helm-merged handlers, validation failures, and schema behavior.

  • charts/foca-common/tests/test_templates.py L2291-2438

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 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (9b24103) to head (506b428).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #788   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           75        75           
  Lines        10025     10025           
=========================================
  Hits         10025     10025           
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 18, 2026 13:28
@sourcery-ai

sourcery-ai Bot commented Nov 18, 2026

Copy link
Copy Markdown

Linked issues

Checked at commit 506b428

#786 feat(chart): render worker.startupProbe · 2 of 2 met

# Requirement Status Notes
1 Render worker.startupProbe and add it to the schema, with tests. ✅ Met The worker template renders startupProbe, the worker schema declares it, and tests cover rendering, null/empty values, and validation.
2 Update the worker probe schema descriptions to say null for none. ✅ Met The startup, readiness, and liveness worker probe descriptions all say null for none and explain Helm's default-probe merge.

@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 reviewed your changes and they look great!

Sourcery assessment

Approved.


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

@uniqueg
uniqueg merged commit ff1f2ab into dev Nov 18, 2026
108 checks passed
@uniqueg
uniqueg deleted the feat/786-worker-startup-probe branch November 18, 2026 14:39
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.

feat(chart): render worker.startupProbe

1 participant