Skip to content

Latest commit

 

History

History
155 lines (113 loc) · 13.3 KB

File metadata and controls

155 lines (113 loc) · 13.3 KB

CHANGELOG

Unreleased (explicitcontextualunderstanding) - 2026-03-31

Fixed

  • Container dependency health check for missing containers: waitForHealthy() now fails fast with ContainerNotFoundError when a dependency container doesn't exist, instead of hanging indefinitely. Provides clear error message explaining the issue and suggesting either removing depends_on: condition: service_healthy or ensuring the container exists with the expected name.
  • Documentation: Clarified that service_healthy dependencies should only be used for containers managed by compose. For externally managed dependencies, use short-form depends_on: [service_name] instead.

Added

  • External dependency health-gating (crash recovery): When container-compose up encounters a depends_on: { condition: service_healthy } against a container that is already running (started outside compose or by a previous run), it now skips the health wait and emits a warning. This prevents hangs on externally managed containers — critical for crash recovery scenarios where services like honcho-db and honcho-hub survive a Mac crash and compose is re-run. The new externallyPresentServices set tracks pre-existing running containers and skips waitForHealthy() for their dependents.

Changed

  • Registry environment variable: Database tests now require OCI_REGISTRY_URL environment variable (was OCI_REGISTRY_URL). Tests fail fast with clear instructions if not set. Apple Container does not support HTTP for RFC1918 private IPs, so an HTTPS-accessible registry is required for container image tests.
  • Test documentation: Added docs/DYNAMIC_TEST_PATTERNS.md documenting container orchestration challenges discovered through dynamic testing.

Documentation

  • Registry access via Cloudflare tunnel: Documented workaround for Apple Container's inability to pull from IP-address registries. Private Zot registry now accessible via Cloudflare tunnel with IP-based bypass authentication. See managing-container-registry skill for Cloudflare Access configuration details.

Unreleased (explicitcontextualunderstanding) - 2026-03-29

Fixed

  • YAML string interpolation in database tests: Fixed malformed multi-line string syntax where \\( should be \( for proper Swift string interpolation. Tests testDatabaseContainerStarts and testThreeTierWithDatabase now correctly substitute OCI_REGISTRY_URL environment variable.
  • Test suite stability: All 164 tests now pass with proper registry URL configuration via OCI_REGISTRY_URL environment variable.

Changed

  • Registry URL configuration: Database tests now use getZotRegistryURL() helper function that reads OCI_REGISTRY_URL environment variable (defaults to 192.168.1.86:30500). Users can override with custom registry URLs for different deployment scenarios.
  • YAML formatting: Standardized indentation in test YAML strings (2 spaces for services, 4 spaces for nested fields) matching Docker Compose conventions.

Testing

  • Environment variable injection: Tests now support OCI_REGISTRY_URL=registry.example.com swift test pattern for custom registry configurations.
  • Full test suite: 164 tests passing (1 skipped - known YAML parsing issue in bind mount test).

Unreleased (explicitcontextualunderstanding) - 2026-03-27

Added

  • Service-level volume mapping: service.volumes entries now generate -v flags in container run commands. Bind mounts (paths with / or starting with .) and named volumes are supported.
  • Pre-decode ${VAR} substitution: Environment variables (${VAR}, ${VAR:-default}, ${VAR:?error}) are now resolved in raw YAML before decode, matching Docker Compose behavior. This resolves ${VAR} in image:, volumes:, command:, and all other compose fields — not just environment: values.
  • $$ escaping support: Users can write $$ in compose YAML to produce a literal $ for shell interpreters (e.g., command: ["sh", "-c", "echo $$HOME"] → shell sees $HOME).
  • resolveYamlVariables() function: New helper in Helper Functions.swift that wraps resolveVariable() with $$ sentinel escaping for safe pre-decode substitution.
  • __SERVICE_HOST__ / __SERVICE_PORT__ placeholder resolution: Runtime container IPs and ports are resolved for __{SERVICE_NAME}_HOST__ and __{SERVICE_NAME}_PORT__ patterns in environment variable values, with fuzzy matching (case-insensitive, strips hyphens/underscores).
  • Container runtime diagnostics: ContainerDependentTrait now pings the container API server on test startup and reports version, commit, and EUID status.
  • Idempotent compose up: Added --force-recreate and --no-recreate flags to control whether running containers are recreated.
  • Integration tests for Feature 1 and Feature 2: Static tests verify pre-decode substitution through the full YAML decode pipeline; dynamic tests verify ${VAR} resolution in running containers and service_healthy dependency enforcement.
  • Volume mapping tests: Added testBindMountMapping, testNamedVolumeMapping, testAbsolutePathBindMountMappingWithinCwd, testOutsidePathSecuritySkipped to verify -v flag generation.
  • Container polling helpers: New TestHelpers module with ContainerPollingHelpers for async container state verification:
    • waitForNetworks() - polls until container networks populate (Apple Container networks are async)
    • waitForAllNetworks() - waits for all project containers to have networks
    • waitForContainers() - waits for containers to be created
    • ContainerTestHelpers.assertHasNetworks() - safe network assertions without force unwraps
  • Three-tier web application test: Re-enabled testThreeTierWebApp() (formerly commented) using postgres:14-alpine, nginx:alpine, node:18-alpine, redis:alpine with network polling validation.

Fixed

  • Dead code removal: Removed unused configVolume() function at ComposeUp.swift:839 that was never called; volume handling is now properly integrated into makeRunArgs().
  • Service volume mounting: Previously service.volumes was parsed from YAML but never generated -v flags for container run. Now properly wired to create bind mounts and named volume mappings.
  • Test suite stabilization:
    • Fixed WordPress test to check for IP pattern instead of networks.first which may be empty (race condition in container runtime API)
    • Added polling wait for container startup in testUpAndDownComplex
    • testUpAndDownComplex uses busybox/nginx instead of MySQL/WordPress (MySQL 8.0 initialization takes 30-60s and often times out)
    • Note: testWordPressCompose still tests WordPress/MySQL functionality; only the compose down complex test was simplified
  • ${VAR} resolution in env pipeline: Replaced naive ${ string stripping with resolveVariable() for proper ${VAR:-default} and ${VAR:?error} support in post-decode environment values.
  • Test container name limit: Shortened test container prefix (CCT_ instead of ContainerComposeTest_) to avoid the macOS 63-character container name limit.
  • container start -d flag: Removed unsupported -d flag from container start calls.
  • Build tooling: Updated build-sign-install.sh to maintain /usr/local/bin symlink and auto-inject git commit hash during build.

Changed

  • .env loading order: .env file is now loaded before YAML decode (moved up in pipeline) so environment variables are available for pre-decode substitution.
  • Post-decode resolveVariable(): Retained as idempotent safety net; no longer the primary resolution point.

v0.10.2 - Fork release (explicitcontextualunderstanding) - 2026-03-24

Fixed

  • Shorthand env: Key Support: Fixed critical bug where the shorthand env: key (e.g., env: MY_VAR=value) was not being decoded.
  • Environment Variable Test Fix: Fixed HOST environment variable conflict in tests by using unique variable names.
  • Volume Creation Idempotency: Fixed volume creation to gracefully handle "already exists" errors.
  • Command String Parsing: Fixed parsing of string-form commands to properly split into executable and arguments.
  • Environment Variable Mapping: Added missing --env flag mapping in makeRunArgs.
  • Port Mapping: Added missing --publish flag mapping in makeRunArgs.
  • macOS Container Name Limit: Implemented proactive validation and warnings for the 64-character container name limit on macOS.
  • Test Suite Stabilization: Achieved 100% test pass rate (92/92 tests) on macOS by:
    • Transitioning WordPress tests to wordpress:fpm-alpine for runtime compatibility.
    • Implementing unique port assignments (18080-18085) for all dynamic tests to prevent parallel execution collisions.
    • Hardening run-tests.sh with build directory ownership checks and automated container pruning.
  • Security-Compliant Installation: Updated build-and-install.sh to target ~/bin with ad-hoc code signing to bypass macOS Gatekeeper and provenance restrictions.

v0.10.1 - Fork release (explicitcontextualunderstanding) - 2026-03-24

This release includes critical fixes from adversarial code review, silent failure remediation, and missing field mappings.

Fixed

  • Adversarial Review Fixes - Comprehensive code review identified and fixed 63 confirmed issues:

    • Fixed silent failures where streamCommand results were discarded (volume creation, container start, checkpoint)
    • Fixed file handle resource leaks in Helper Functions with proper cleanup
    • Added timeout mechanism to streamCommand (default 300s) to prevent indefinite hangs
    • Fixed loadEnvFile to properly propagate errors instead of silently swallowing
  • Stopped container restart: When a container exists but is not running (e.g., stopped), container-compose up now starts the existing container instead of failing with an error message.

    • Previously: Container existed with status: stopped. Error was printed and command returned without starting the container.
    • Now: Container is automatically started using container start <name> -d, then waits for it to be running and updates service IPs.
  • Missing Field Mappings - Added support for compose fields that were parsed but never mapped to container run flags:

    • --user for service.user
    • --hostname for service.hostname
    • --workdir for service.working_dir
    • --privileged for service.privileged
    • --read-only for service.read_only
    • --network for service.networks (supports multiple networks)
    • -t for service.tty
    • -i for service.stdin_open
  • Checkpoint Command Improvements:

    • Added pre-flight checks to verify container exists before checkpointing
    • Added validation that container is running (with --force flag to override)
    • Added exit code validation to ensure commit succeeded

v0.9.1 - Fork release (explicitcontextualunderstanding)

This release bundles several upstream fixes and improvements merged into this fork. Highlights and user-facing notes:

For full details and links to the source commits/PRs, see FORK_CHANGES.md.