Skip to content

Make COAST_SKIP_UI_BUILD a complete backend-only path#3

Draft
agustif wants to merge 43 commits intomainfrom
af/backend-build-reliability
Draft

Make COAST_SKIP_UI_BUILD a complete backend-only path#3
agustif wants to merge 43 commits intomainfrom
af/backend-build-reliability

Conversation

@agustif
Copy link
Owner

@agustif agustif commented Mar 12, 2026

Summary

Draft follow-up for coast-guard#70.

This branch makes COAST_SKIP_UI_BUILD=1 a real backend-only build/test mode for coast-daemon, and removes the stale embedded-asset shortcut from the build script.

What changed

  • build script now emits a dedicated cfg when COAST_SKIP_UI_BUILD=1
  • backend-only builds no longer require coast-guard/dist/ to exist at compile time
  • embedded UI serving falls back to a clear 404 in backend-only mode
  • daemon API tests now assert the backend-only behavior explicitly
  • the build script no longer skips npm run build just because dist/index.html already exists

Validation

  • rm -rf coast-guard/dist && COAST_SKIP_UI_BUILD=1 cargo test -p coast-daemon test_docker_info_disconnected_without_docker
  • rm -rf coast-guard/dist && COAST_SKIP_UI_BUILD=1 cargo test -p coast-daemon test_index_returns_html
  • cargo fmt --check

Refs: coast-guard#70

agustif and others added 30 commits March 5, 2026 20:09
Summary:
- augment the macOS daemon PATH with /opt/homebrew/bin and
  /usr/local/bin before host-side docker commands run
- write the augmented PATH into generated launchd plists so login
  daemons inherit standard user-installed binary directories
- add regression tests for PATH extension and launchd plist output

Rationale:
- launchd starts coastd with a stripped PATH, which breaks docker
  subprocesses when the CLI is installed outside the system paths
- standard user-installed binary directories cover Homebrew and
  symlinked OrbStack/docker installs without hardcoding app internals

Tests:
- cargo fmt --all
- COAST_SKIP_UI_BUILD=1 cargo test -p coast-daemon
  test_extend_path_entries_appends_only_missing_candidates --lib
- COAST_SKIP_UI_BUILD=1 cargo test -p coast-cli
  test_generate_launchd_plist_content
- COAST_SKIP_UI_BUILD=1 cargo test -p coast-cli
  test_extend_path_entries_appends_only_missing_candidates
- COAST_SKIP_UI_BUILD=1 cargo build -p coast-daemon --bin coastd-dev
  -p coast-cli --bin coast-dev
- PATH="/usr/bin:/bin:/usr/sbin:/sbin"
  /Users/af/symphony/coasts/target/debug/coast-dev build
  (from /Users/af/symphony)
- PATH="/usr/bin:/bin:/usr/sbin:/sbin"
  /Users/af/symphony/coasts/target/debug/coast-dev run pr-check-1
  (from /Users/af/symphony)
- COAST_SKIP_UI_BUILD=1 cargo clippy -p coast-daemon -p coast-cli
  --all-targets -- -D warnings
  (fails due pre-existing warnings in untouched files)

Co-authored-by: Codex <codex@openai.com>
compose_context_for_build extracted the compose subdirectory from the
resolved absolute path returned by Coastfile::from_file. That method
resolves relative paths against the coastfile's parent directory, which
inside the artifact dir turns "./docker-compose.yml" into
"<artifact_hash>/docker-compose.yml". The parent dir name of that
resolved path is the artifact hash, which was then used as the compose
project name and --project-directory, causing `docker compose ps` to
return empty results and all services to appear as "down" in coast ps
and Coastguard.

The fix reads the raw TOML compose string instead of the resolved
PathBuf, so root-level compose files correctly produce
compose_rel_dir=None and project_name="coast-{project}".

Only affects projects with compose at the project root (e.g.
compose = "./docker-compose.yml"). Projects with compose in a
subdirectory (e.g. compose = "./infra/docker-compose.yml") were
unaffected because the subdirectory name is the same in both the
raw and resolved paths.
Fix macOS launchd PATH for host docker subprocesses
…ktree-detection

[jrs] fixed lookup worktree path detection
…t-name-root-dir

[dh] fix: compose project name derived from artifact hash when compose is at project root
…etection-and-link-to-example-in-docs

[jrs] detect orbstack and link to demo in deocs and README.md
…etection-and-link-to-example-in-docs

[jrs] doc updates
…leanup-for-stopped-coasts

[jrs] add support for cross project checkouts and handle unbinding wh…
…oping-to-build-id

[jrs] Bug fix: scope secrets to build id in api.
…n-into-smaller-parts

[jrs] break assign up into smaller parts
…list-bug

[jrs] fix daemon install script and add auto restart post install
jamiesunderland and others added 13 commits March 9, 2026 16:42
…emeral-state-checks

[jrs] add update ephemeral state checks and quiescing
…ort-mappings

[ec] added compose port mappings
Replace VIDEO_TUTORIALS.md with a dedicated learn-coasts/ directory
containing individual pages per video with embedded YouTube players.
Add youtube fenced code block renderer to DocsViewer with optional
caption and link support.
…ed contributing section

Move the curl install command above the coasts.dev link so it's the first
thing users see. Consolidate prerequisites, dev setup, and the 3-terminal
workflow under Contributing. Add building from source section at the bottom.
…ent-order-and-name

[jrs] put video docs in correct order
Teach coast-daemon to compile and run targeted backend tests without prebuilt Coast Guard assets when COAST_SKIP_UI_BUILD=1 is set. Also remove the stale dist-presence shortcut so UI assets rebuild whenever the build script reruns after source changes.

Refs: coast-guard#70

Co-authored-by: Codex <noreply@openai.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.

3 participants