Skip to content

feat: add Drupal Site app with second healthcheck indicator#41

Merged
rfay merged 1 commit into
mainfrom
20260307_more_health_check
Mar 7, 2026
Merged

feat: add Drupal Site app with second healthcheck indicator#41
rfay merged 1 commit into
mainfrom
20260307_more_health_check

Conversation

@rfay
Copy link
Copy Markdown
Member

@rfay rfay commented Mar 7, 2026

Summary

Adds a second app icon Drupal Site (white check-circle) alongside the existing DDEV Web icon, giving two distinct health indicators with different semantics.

How Coder app healthchecks work

Each coder_app resource can have a healthcheck block that polls a URL on a configurable interval. The app icon appears dim when unhealthy and bright when healthy.

What counts as healthy: any HTTP response that is not a connection failure and not 5xx. This means 2xx, 3xx, and 4xx all pass. There is no way to require specifically 200, check response body content, or apply any custom logic — status code only.

Key limitation: the health indicator is only visible in the individual workspace detail view. The main workspaces list shows only the agent status (Running/Stopped), not per-app health.

Docs: https://registry.terraform.io/providers/coder/coder/latest/docs/resources/app

The two indicators

App Healthcheck URL Lights up when
DDEV Web http://localhost:80 ddev start completes — nginx responds with anything
Drupal Site ✓ http://localhost:80/user/login Drupal is installed — returns non-5xx (typically 200)

Why /user/login: before drush si completes, Drupal returns 500 (no database). After install it returns 200. This makes the Drupal Site icon dim through the entire setup process and bright only once the site is serving.

Known limitations

  • sql-drop → redirect: after ddev drush sql-drop -y, Drupal redirects /user/login/install.php (302). Coder treats 302 as healthy, so the icon stays bright. A custom health.php that tests DB connectivity directly would be needed to catch this.
  • 4xx responses pass: removing index.php gives 403 — icon stays bright.
  • PHP errors may return 200: in DDEV's dev mode (display_errors=On), PHP parse errors can return 200 with error text in the body rather than 500.

The icon is a best-effort indicator, not a guarantee of a fully functioning site.

🤖 Generated with Claude Code

Adds a second app icon alongside DDEV Web:
- DDEV Web: lights up when ddev starts (any 2xx/3xx from port 80)
- Drupal Site: lights up only when Drupal returns non-5xx from
  /user/login — dim during setup (500 from missing DB), bright
  after drush si completes

Uses Iconify API for a white check-circle icon visible on dark backgrounds.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@rfay rfay merged commit 8362586 into main Mar 7, 2026
@rfay rfay deleted the 20260307_more_health_check branch March 7, 2026 22:25
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