Bnjoroge/concurrency

Merged
BN
3mo ago
+16007-576

Summary by cubic

Implements full GitHub Actions concurrency: support in aksh, with control‑plane enforcement and runner‑aligned cancellations. Adds strict conformance tooling and CI property tests to validate behavior.

  • New Features

    • Server: enforce workflow/job concurrency: groups with cancel-in-progress, queue: single|max, pending admission, promotion, and matrix/jobset handling (crates/aksh-runner-server).
    • Parser/Protocol: add Workflow.concurrency, job/run inputs; introduce ExecutionStatus::Pending; wire JobCancellation with { jobId, timeout } and NDJSON reasons (crates/aksh-gha-parser, crates/aksh-gha-protocol).
    • Runner: deliver graceful cancel once, compute hard‑kill deadline (kill_at), and match by jobId; treat mid‑step cancels as “The operation was canceled.” (crates/aksh-runner).
    • Client: support workflow dispatch inputs via --input KEY=VALUE (crates/aksh-runner-client).
    • CI: add fast vs intensive property profiles; nightly schedule; seed regression list (.github/workflows/ci.yml, proptest-regressions/*).
    • Conformance: add capture/comparison harnesses, strict log/step diff, and real‑world scenario corpus with reports and fixtures (benchmarks/real-world/*).
    • Docs: implementation plan and audit logs (docs/concurrency-*.md).
  • Bug Fixes

    • Use official cancellation type string "JobCancellation" on the wire (crates/aksh-gha-protocol).
    • Prevent dispatch while runner is busy; fix jobset admission and cancellation edge cases (crates/aksh-runner-server, crates/aksh-runner).
    • Project cancelled‑before‑dispatch jobs into jobs_list with correct conclusions; stabilize run log aggregation order (crates/aksh-runner-server).
    • Reject empty concurrency groups at runtime to match GitHub behavior; expose step outcomes via GET /api/v1/runs (crates/aksh-runner-server).
    • Normalize integer rendering in expressions/matrix to avoid 1.0 vs 1 mismatches (crates/aksh-gha-expressions, crates/aksh-gha-parser).
    • Mid‑step cancel sets step/job conclusion to cancelled and logs the standard error line (crates/aksh-runner).