Skip to content

1.18.0

Choose a tag to compare

@BrewingCoder BrewingCoder released this 05 Nov 15:40
· 22 commits to main since this release
7944807

Added

  • Build-wide cancellation and orderly interrupts (#125, part 1). tamp now handles Ctrl+C, SIGTERM and SIGHUP itself instead of being killed mid-build:
    • The first signal cancels the new TampBuild.BuildCancellation token (also passed to the new Executes(async ct => ...) overloads) and ProcessRunner kills the running tool's whole process tree and starts nothing new.
    • The running target finishes with the new status cancelled (reason: "signal: SIGINT"; no remedy, no failure handlers), later targets are not_run, and AssuredAfterFailure cleanup targets still run with a fresh token that cancels when the shutdown grace period ends (default 10 s, --shutdown-timeout <seconds> / TAMP_SHUTDOWN_TIMEOUT).
    • build.finished reports status: "cancelled", reason and a cancelled count, and the exit code is 128 + signal on every OS (130 SIGINT, 143 SIGTERM, 129 SIGHUP).
    • A second signal, or the grace period running out, forces the exit after killing child process trees.
    • Also: ProcessCancelledException, ExecutionResult.InterruptSignal, IBuildReporter.OnTargetCancelled (defaults to OnTargetNotRun), the tamp mcp run summary's status / reason, and the cancelled ADR-0018 outcome. Additive; the event schema stays 1.0.
  • service.ready / service.stopped events for long-running services (#124). A target that starts a dev server, emulator or other long-running process can now say when it is usable (kind, url, optional port, pid, processStartTime, readinessProbe, statePath) and when and why it stopped (reason: requested | signal | exited | timeout, plus optional pid, exitCode, durationMs). The reason lets consumers tell a deliberate shutdown from a failure: a killed service reports a non-zero tool.exited code even when nothing went wrong. Emitted with BuildEvents.ServiceReady(...) / BuildEvents.ServiceStopped(...), which can share the service's tool.invoked command span; url and readinessProbe are scrubbed through the redaction table. Additive: the schema version stays 1.0. See docs/agent-first.md.
  • ManagedProcess: a long-running child process for targets that start a dev server, emulator or similar (#125, part 2). ManagedProcess.StartAsync(plan, options) emits tool.invoked, waits for a Readiness check (Http with optional loopback self-signed TLS, Tcp, OutputMatches, When), then service.ready, all on one command span parented to the starting target. Disposing it kills the whole process tree (optionally SIGTERM first on Unix) and records service.stopped (requested) and tool.exited; the stop is idempotent and safe across threads. An early exit throws with the output tail (exited), a readiness timeout throws TimeoutException (timeout), and an exit on its own after ready is recorded at once (exited). The executor stops managed processes on an interrupt (signal), kills them on a forced exit, and stops any still running when the build ends, so a service can serve later targets but never outlives the build.

Changed

  • Event sinks are now written under a lock, so an event emitted off the build thread (a forced exit) can't interleave with the main loop's.

Backfilled: this version was published to nuget.org at the time but no GitHub Release was created (tamp#159). Notes are this version's CHANGELOG.md section, unedited.