Skip to content

fix(cli): render running-no-probe containers as healthy in doctor#1870

Merged
Aureliolo merged 1 commit into
mainfrom
fix/doctor-nats-healthy-when-running
May 11, 2026
Merged

fix(cli): render running-no-probe containers as healthy in doctor#1870
Aureliolo merged 1 commit into
mainfrom
fix/doctor-nats-healthy-when-running

Conversation

@Aureliolo
Copy link
Copy Markdown
Owner

Summary

synthorg doctor was rendering NATS as ● running (blue step icon) while peers with docker-level healthchecks rendered as ✓ healthy (green success icon). NATS has no docker healthcheck declared; application-level liveness is surfaced via /api/v1/readyz instead.

Before:

✓ synthorg-backend-1       healthy
● synthorg-nats-1          running
✓ synthorg-postgres-1      healthy
✓ synthorg-web-1           healthy

After:

✓ synthorg-backend-1       healthy
✓ synthorg-nats-1          healthy
✓ synthorg-postgres-1      healthy
✓ synthorg-web-1           healthy

Change

Add an explicit case c.State == "running" arm in renderDoctorContainers (cli/cmd/doctor.go:436-440) ahead of the catch-all default, rendering with out.Success(...) and label "healthy". The case is only reached when Health == "" (all non-empty Health values are caught upstream).

Cross-file parity

cli/cmd/status.go:252-269 healthIcon() already does the same thing (running + empty Health -> IconSuccess) with a doc-comment explaining the rationale. Doctor was inconsistent with status; this aligns them.

Test plan

  • go -C cli build ./...: clean.
  • go -C cli vet ./...: clean.
  • go -C cli test ./...: all packages pass (cmd, completion, compose, config, diagnostics, docker, health, images, scaffold, selfupdate, ui, verify).
  • Manual: synthorg doctor against a running stack renders NATS row as green check + "healthy" matching the other services.

Review coverage

Pre-PR review pipeline (/pre-pr-review) ran 4 applicable agents (go-reviewer, go-conventions-enforcer, docs-consistency, comment-quality-rot). Zero findings; all agents approved. Triage record at _audit/pre-pr-review/triage.md.

Restarting / paused / created / dead states with empty Health still fall through to the default out.Step(...) arm and render with the in-progress icon, matching healthIcon()'s behaviour for the same states.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 11, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a0951f0a-9c4f-4bac-89c7-4a2ccce83ba7

📥 Commits

Reviewing files that changed from the base of the PR and between af33ddb and 823e2fb.

📒 Files selected for processing (1)
  • cli/cmd/doctor.go
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
  • GitHub Check: CLI Bench Regression
  • GitHub Check: CLI Test (windows-latest)
  • GitHub Check: CLI Test (ubuntu-latest)
  • GitHub Check: CLI Test (macos-latest)
  • GitHub Check: CLI Lint
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
🧰 Additional context used
📓 Path-based instructions (3)
cli/**/*.go

📄 CodeRabbit inference engine (cli/CLAUDE.md)

cli/**/*.go: Use go -C cli to run Go commands (build, test, vet) from any working directory without affecting the shell's cwd. Never use a bare cd cli in Bash; instead use subshells (bash -c "cd cli && <cmd>" or (cd cli && <cmd>)) for external tools lacking a -C flag.
Run golangci-lint via subshell with bash -c "cd cli && golangci-lint run" because golangci-lint lacks a -C flag. Install it once with scripts/install_cli_tools.sh to keep cli/go.mod free of GPL-3.0 transitive dependencies.
Use environment variables with the SYNTHORG_ prefix for backend/channel overrides (LOG_LEVEL, BACKEND_PORT, WEB_PORT, CHANNEL, IMAGE_TAG, TELEMETRY_ENABLED, AUTO_*), image/registry overrides, timeouts/retry tuning, and byte caps/ports. Refer to docs/reference/cli-env-vars.md for the complete table, rationales, and hardcoded address audit.

Files:

  • cli/cmd/doctor.go
cli/cmd/**/*.go

📄 CodeRabbit inference engine (cli/CLAUDE.md)

cli/cmd/**/*.go: All CLI commands must accept persistent global flags (--data-dir, --skip-verify, --quiet, --verbose, --no-color, --plain, --json, --yes, --help-all) with proper precedence: flag > env var > config > default.
Use these exit codes: 0 (success), 1 (runtime error), 2 (usage error), 3 (unhealthy), 4 (unreachable), 10 (updates available with --check).

Files:

  • cli/cmd/doctor.go
cli/cmd/doctor.go

📄 CodeRabbit inference engine (cli/CLAUDE.md)

The doctor command collects diagnostics, saves a timestamped synthorg-diagnostic-YYYYMMDD-HHMMSS.txt (mode 0600) under the data directory, prints a summary, and optionally auto-fixes with --fix. Filter categories with --checks [,...]. Print synthorg doctor report and synthorg logs as next-step hints in the footer. Check categories: environment, health, containers, images, compose, config, disk, errors.

Files:

  • cli/cmd/doctor.go
🔇 Additional comments (1)
cli/cmd/doctor.go (1)

436-440: Good fallback for running containers without Docker health checks.

Line 436 adds the missing state mapping cleanly, and the branch order preserves existing healthy/unhealthy/starting behavior while fixing the indefinite “in progress” output for no-probe services.


Walkthrough

This PR updates the doctor command's container status rendering in cli/cmd/doctor.go. The change adds an explicit switch case to treat running containers without docker-level health checks as healthy. Previously, such containers would fall through to generic rendering. The new logic explicitly checks for running state and outputs a healthy status with explanatory comments, providing clearer feedback in the doctor command output.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 40.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: rendering running containers without health probes as healthy in the doctor command.
Description check ✅ Passed The description is well-related to the changeset, providing context, before/after examples, implementation details, and test coverage for the specific fix.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@github-actions
Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the renderDoctorContainers function in cli/cmd/doctor.go to treat containers in a "running" state as healthy when no explicit Docker healthcheck is defined. This ensures that containers without healthchecks, such as NATS, are correctly reported as healthy rather than appearing indefinitely in progress. I have no further feedback to provide.

@Aureliolo Aureliolo merged commit 6263795 into main May 11, 2026
57 checks passed
@Aureliolo Aureliolo deleted the fix/doctor-nats-healthy-when-running branch May 11, 2026 20:31
Aureliolo pushed a commit that referenced this pull request May 12, 2026
<!-- HIGHLIGHTS_START -->
## Highlights

> _AI-generated summary (model: `openai/gpt-4.1-mini` via GitHub
Models). Commit-based changelog below._

### What you'll notice
- Password and secret fields now include an eye-toggle for easier
visibility control.
- Containers running without probes are shown as healthy in the doctor
command.
- Unloaded and missing PR-review agents are restored and available
again.

### What's new
- Gate baseline protection is enhanced to block em-dashes during
writing.

### Under the hood
- Replaced Atlas with yoyo-migrations for persistence management.
- Refactored codebase extensively, including context-bound user
authentication and registry pattern for enums.
- Improved linting by draining magic number usages and tightening mock
and constant checks.
- Updated CI to retry Docker pushes on network timeout errors.
- Updated apko lockfiles for dependency management.

<!-- HIGHLIGHTS_END -->

:robot: I have created a release *beep* *boop*
---


##
[0.8.3](v0.8.2...v0.8.3)
(2026-05-12)


### Features

* harden gate baseline protection + block em-dashes at write time
([#1860](#1860))
([b41f151](b41f151))
* **web:** eye-toggle on every password / secret field
([#1873](#1873))
([9070387](9070387))


### Bug Fixes

* **ci:** retry Docker push on Go net/http deadline + cancellation
errors ([#1877](#1877))
([23a0bfa](23a0bfa))
* **cli:** render running-no-probe containers as healthy in doctor
([#1870](#1870))
([6263795](6263795))
* restore unloaded and missing PR-review agents
([#1875](#1875))
([db004fd](db004fd)),
closes [#1871](#1871)


### Refactoring

* bind authenticated user via ContextVar
([#1858](#1858))
([57ed0b4](57ed0b4))
* code-structure cleanup (sub-tasks D + F + G + H + I)
([#1859](#1859))
([362e5c8](362e5c8))
* convert enum dispatch to registry pattern
([#1854](#1854))
([e90550e](e90550e))
* drain no_magic_numbers baseline to zero via Final hoists
([#1856](#1856) phase 2)
([#1872](#1872))
([ec8109e](ec8109e))
* drain pagination + loop-init + kill-switch baselines
([#1857](#1857))
([#1868](#1868))
([115c3c2](115c3c2))
* **persistence:** replace Atlas with yoyo-migrations
([#1876](#1876))
([1b7e975](1b7e975)),
closes [#1874](#1874)
* protocols audit follow-up (REVIEW + fold pass)
([#1869](#1869))
([af33ddb](af33ddb))
* protocols audit follow-up REMOVE pass
([#1867](#1867))
([dd1eebc](dd1eebc))
* tighten check_mock_spec gate, add mock_of[T], drain baseline
([#1862](#1862))
([240a253](240a253))
* tighten check_no_magic_numbers for named module constants
([#1856](#1856))
([#1866](#1866))
([90c933b](90c933b))


### CI/CD

* update apko lockfiles
([#1863](#1863))
([2bd32e6](2bd32e6))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

---------

Co-authored-by: synthorg-repo-bot[bot] <279117679+synthorg-repo-bot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

1 participant