mirror of
https://github.com/coder/coder.git
synced 2026-10-16 14:48:56 +08:00
feat(agent): enforce lifecycle script ordering Honor `coder_script_order` dependencies for startup and shutdown scripts using the existing outcome-aware unit manager. Cron, legacy scripts, and scripts without dependencies retain their existing behavior. - Wait for all prerequisites before running. `success` requires a successful prerequisite; `completion` also accepts failure, timeout, or skip. Skip dependents as soon as a required success becomes impossible, preserving the original failure as the lifecycle error. - Reject invalid dependency graphs before any scripts start and write the reason to every selected script's log. - Log unmet dependencies every 30 seconds and explain skips. Populate display names in the manifest so skip messages use readable names, falling back to Terraform addresses. - Exclude dependency waits from script timeouts, record an outcome on every exit, and use fresh state per execution. Cancellation stops waiters without starting dependents or emitting skip messages. Add regression coverage for ordering, skip propagation, timeouts, cancellation, invalid graphs, and unchanged unordered execution. Refs https://linear.app/codercom/issue/PLAT-549/phase-3-enforce-lifecycle-script-ordering