Skip to content

fix: make readiness probeable and parse charts in CI - #613

Merged
kartikeya-27 merged 2 commits into
masterfrom
fix/probe-credentials-and-diagram-check
Aug 2, 2026
Merged

fix: make readiness probeable and parse charts in CI#613
kartikeya-27 merged 2 commits into
masterfrom
fix/probe-credentials-and-diagram-check

Conversation

@pratyush618

@pratyush618 pratyush618 commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

The two follow-ups left open by #612.

A readiness probe that can actually run

/readiness is the route that checks storage, and it is gated alongside /metrics. A Kubernetes probe carries no credential and cannot be given one — a probe header is a literal string in the manifest, so authenticating it would mean copying the token out of its Secret into the Deployment spec. The result was a probe that returned 401 and a pod that never went Ready, so #612 shipped with readiness pointed at /health, which passes as long as the process is alive and checks nothing.

TASKITO_DASHBOARD_PUBLIC_READINESS=1 answers that one route without a credential. /metrics stays gated — the switch is scoped to the probe, not to every unauthenticated reader. What it publishes to anything that can reach the port: whether storage answers, and how many workers are registered. That is the trade, and it is the smaller of the two: the alternative leaks a bearer token to anyone with get deployment.

The chart sets it by default and probes /readiness. --set dashboard.publicReadiness=false reverts to /health for both.

Every Mermaid chart is parsed in CI

Charts render inside <Mermaid>'s effect, in the browser. pnpm build prerenders the page around a broken one and exits 0, so a syntax error ships silently and the page has a hole in it — which is how the clipped node in #612 got as far as a screenshot.

pnpm check:diagrams extracts every <Mermaid chart={...}/> in docs/content and runs mermaid.parse over it. Wired into docs.yml beside the parity check. Mermaid needs a DOM even to parse, hence jsdom as a docs devDependency.

Current state: 50 charts across 38 files, all parse.

Verification

  • cargo test -p taskito-server — 197 lib + every integration suite, 0 failures. Clippy clean.
  • New tests: the config default, and an integration test asserting the gate flips — /readiness 401s under session auth, answers with a real storage check once opted out, and /metrics stays 401 in both.
  • Against the running binary, both directions. With TASKITO_DASHBOARD_AUTH=session: without the flag /readiness → 401; with it → 200 and {"storage": "ok"}, while /metrics → 401 throughout.
  • ci-chart.yml gains an assertion that the rendered probe path and the env var move together — the two halves have to agree or the pod hangs NotReady, and nothing else would catch them drifting apart.
  • The diagram check was confirmed to actually fail: breaking a chart on purpose exits non-zero and names the file and the line.

Summary by CodeRabbit

  • New Features

    • Added configurable public readiness checks for deployments.
    • Helm deployments use /readiness by default, while /metrics remains protected.
    • Readiness falls back to /health when public access is disabled.
  • Documentation

    • Updated deployment guidance, configuration references, and changelogs.
  • Quality Improvements

    • Added automated validation for Mermaid diagrams during documentation builds.
    • Expanded checks for readiness probe behavior and authentication.

It is gated with /metrics, so a kubelet probe got 401 and the pod never went Ready. Probe headers are literal strings, so a token cannot be injected.
Charts render client-side, so a syntax error never fails the build — the page just ships with a hole in it.
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fe7798ab-3761-4b8f-9592-91bda7a0e6dc

📥 Commits

Reviewing files that changed from the base of the PR and between 5f0b749 and 7dea2ca.

⛔ Files ignored due to path filters (1)
  • docs/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (15)
  • .github/workflows/ci-chart.yml
  • .github/workflows/docs.yml
  • CHANGELOG.md
  • crates/taskito-server/src/config/dashboard.rs
  • crates/taskito-server/src/dashboard/probes.rs
  • crates/taskito-server/src/main.rs
  • crates/taskito-server/tests/http_api.rs
  • crates/taskito-server/tests/support/mod.rs
  • deploy/helm/taskito-server/README.md
  • deploy/helm/taskito-server/templates/deployment.yaml
  • deploy/helm/taskito-server/values.yaml
  • docs/content/docs/resources/changelog.mdx
  • docs/content/docs/shared/guides/operations/deployment.mdx
  • docs/package.json
  • docs/scripts/check-diagrams.mjs
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • ByteVeda/taskito (manual)

📝 Walkthrough

Walkthrough

The server now supports configurable unauthenticated /readiness checks. The Helm chart enables this mode by default and separates liveness and readiness probes. Documentation CI now parses Mermaid diagrams before building.

Changes

Public readiness probes

Layer / File(s) Summary
Readiness configuration and authorization
crates/taskito-server/src/config/dashboard.rs, crates/taskito-server/src/dashboard/probes.rs, crates/taskito-server/src/main.rs, crates/taskito-server/tests/*
The server reads TASKITO_DASHBOARD_PUBLIC_READINESS. Readiness authentication is bypassed when enabled. Metrics authentication remains enforced. Tests cover default and enabled behavior.
Helm probe and environment wiring
deploy/helm/taskito-server/values.yaml, deploy/helm/taskito-server/templates/deployment.yaml, .github/workflows/ci-chart.yml
The chart enables public readiness by default, sets the environment variable, uses /health for liveness, and selects /readiness or /health for readiness. CI validates both configurations.
Readiness operational documentation
CHANGELOG.md, deploy/helm/taskito-server/README.md, docs/content/docs/resources/changelog.mdx, docs/content/docs/shared/guides/operations/deployment.mdx
Documentation describes readiness checks, probe authentication, metrics protection, and health fallback behavior.

Documentation diagram validation

Layer / File(s) Summary
Mermaid parsing command and CI integration
docs/scripts/check-diagrams.mjs, docs/package.json, .github/workflows/docs.yml
A new command parses Mermaid charts in MDX files with jsdom and fails on invalid charts. Documentation CI runs the command before the build.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Kubernetes
  participant TaskitoReadiness
  participant StorageAndWorkers
  Kubernetes->>TaskitoReadiness: Request /readiness
  TaskitoReadiness->>StorageAndWorkers: Run storage and worker-registration checks
  StorageAndWorkers-->>TaskitoReadiness: Return check results
  TaskitoReadiness-->>Kubernetes: Return readiness response
Loading

Possibly related PRs

  • ByteVeda/taskito#612: Introduces the Helm deployment and probe configuration extended by this change.

Suggested labels: dashboard

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes both primary changes: making readiness probeable and adding chart parsing in CI.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@kartikeya-27
kartikeya-27 merged commit 9c76531 into master Aug 2, 2026
64 of 66 checks passed
@kartikeya-27
kartikeya-27 deleted the fix/probe-credentials-and-diagram-check branch August 2, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants