Commit Graph

72 Commits

Author SHA1 Message Date
17a50d776b chore: bump version to 1.6.0, update CHANGELOG v1.6.0 2026-04-01 14:39:21 +01:00
550dcd1f0c chore: add wfe-server crates to workspace, update test contexts
Add wfe-server-protos and wfe-server to workspace members.
Update StepExecutionContext constructions with log_sink: None
in buildkit and containerd test files.
2026-04-01 14:37:40 +01:00
cbbeaf6d67 feat(wfe-server): headless workflow server with gRPC, webhooks, and OIDC auth
Single-binary server exposing the WFE engine over gRPC (13 RPCs) with
HTTP webhook support (GitHub, Gitea, generic events).

Features:
- gRPC API: workflow CRUD, lifecycle event streaming, log streaming,
  log search via OpenSearch
- HTTP webhooks: HMAC-SHA256 verified GitHub/Gitea webhooks with
  configurable triggers that auto-start workflows
- OIDC/JWT auth: discovers JWKS from issuer, validates with asymmetric
  algorithm allowlist to prevent algorithm confusion attacks
- Static bearer token auth with constant-time comparison
- Lifecycle event broadcasting via tokio::broadcast
- Log streaming: real-time stdout/stderr via LogSink trait, history
  replay, follow mode
- Log search: full-text search via OpenSearch with workflow/step/stream
  filters
- Layered config: CLI flags > env vars > TOML file
- Fail-closed on OIDC discovery failure, fail-loud on config parse errors
- 2MB webhook payload size limit
- Blocked sensitive env var injection (PATH, LD_PRELOAD, etc.)
2026-04-01 14:37:25 +01:00
6dffb91626 feat(wfe-server-protos): add gRPC service definitions for workflow server
13 RPCs in wfe.v1.Wfe service: RegisterWorkflow, StartWorkflow,
GetWorkflow, CancelWorkflow, SuspendWorkflow, ResumeWorkflow,
SearchWorkflows, PublishEvent, WatchLifecycle (stream),
StreamLogs (stream), SearchLogs, ListDefinitions.
2026-04-01 14:35:57 +01:00
c63bf7b814 feat(wfe-yaml): add log streaming to shell executor + security hardening
Shell step streaming: when LogSink is present, uses cmd.spawn() with
tokio::select! to interleave stdout/stderr line-by-line. Respects
timeout_ms with child.kill() on timeout. Falls back to buffered mode
when no LogSink.

Security: block sensitive env var overrides (PATH, LD_PRELOAD, etc.)
from workflow data injection. Proper error handling for pipe capture.

4 LogSink regression tests + 2 env var security regression tests.
2026-04-01 14:33:53 +01:00
7a9af8015e feat(wfe-core): add LogSink trait and wire lifecycle publisher into executor
LogSink trait for real-time step output streaming. Added to
StepExecutionContext as optional field (backward compatible).
Threaded through WorkflowExecutor and WorkflowHostBuilder.

Wired LifecyclePublisher.publish() into executor at 5 points:
StepStarted, StepCompleted, Error, Completed, Terminated.
Also added lifecycle events to host start/suspend/resume/terminate.
2026-04-01 14:33:27 +01:00
d437e6ff36 chore: add CHANGELOG.md for v1.5.0
Full changelog covering v1.0.0, v1.4.0, and v1.5.0 releases.
Also fix containerd integration test default address to handle
Lima socket forwarding gracefully.

879 tests passing. 88.8% coverage on wfe-rustlang.
v1.5.0
2026-03-29 17:13:14 +01:00
93f1b726ce chore: bump version to 1.5.0
Bump workspace version and all internal crate references to 1.5.0.
Add wfe-rustlang to workspace members and dependencies.
2026-03-29 17:08:41 +01:00
c58c5d3eff chore: update Lima VM config and CI pipeline for v1.5.0
Lima wfe-test VM: Alpine with system containerd + BuildKit from apk,
TCP socat proxy for reliable gRPC transport, probes with sudo for
socket permission fixes. 2 core / 4GB / 20GB.

CI pipeline: add wfe-rustlang to feature-tests, package, and publish
steps. Container tests use TCP proxy (http://127.0.0.1:2500) instead
of Unix socket forwarding. Containerd tests set WFE_IO_DIR for shared
filesystem support.
2026-03-29 16:58:03 +01:00
60e8c7f9a8 feat(wfe-yaml): wire rustlang step types and containerd integration tests
Add rustlang feature flag to wfe-yaml with support for all cargo and
rustup step types (15 total), including cargo-doc-mdx.

Schema additions: output_dir, package, features, all_features,
no_default_features, release, profile, toolchain, extra_args,
components, targets, default_toolchain fields on StepConfig.

Integration tests for compiling all step types from YAML, and
containerd-based end-to-end tests for running Rust toolchain
inside containers from bare Debian images.
2026-03-29 16:57:50 +01:00
272ddf17c2 fix(wfe-containerd): fix remote daemon support
Four bugs fixed in the containerd gRPC executor:

- Snapshot parent: resolve image chain ID from content store instead of
  using empty parent, which created rootless containers with no binaries
- I/O capture: replace FIFOs with regular files for stdout/stderr since
  FIFOs don't work across virtiofs filesystem boundaries (Lima VMs)
- Capabilities: grant Docker-default capability set (SETUID, SETGID,
  CHOWN, etc.) when running as root so apt-get and similar tools work
- Shell path: use /bin/sh instead of sh in process args since container
  PATH may be empty

Also adds WFE_IO_DIR env var for shared filesystem support with remote
daemons, and documents the remote daemon setup in lib.rs.
2026-03-29 16:56:59 +01:00
b0bf71aa61 feat(wfe-rustlang): add external tool auto-install and cargo-doc-mdx
External cargo tools (audit, deny, nextest, llvm-cov) auto-install
via cargo install if not found on the system. For llvm-cov, the
llvm-tools-preview rustup component is also installed automatically.

New cargo-doc-mdx step type generates MDX documentation from rustdoc
JSON output. Runs cargo +nightly rustdoc --output-format json, then
transforms the JSON into MDX files with frontmatter, type signatures,
and doc comments grouped by module. Uses the official rustdoc-types
crate for deserialization.
2026-03-29 16:56:21 +01:00
0cb26df68b feat(wfe-rustlang): add Rust toolchain step executors
New crate providing cargo and rustup step types for WFE workflows:

Cargo steps: build, test, check, clippy, fmt, doc, publish
Rustup steps: rust-install, rustup-toolchain, rustup-component, rustup-target

Shared CargoConfig base with toolchain, package, features, release,
target, profile, extra_args, env, working_dir, and timeout support.
Toolchain override via rustup run for any cargo command.
2026-03-29 16:56:07 +01:00
a7c2eb1d9b chore: add sunbeam registry annotations for crate publishing 2026-03-27 00:35:42 +00:00
496a192198 chore: bump version to 1.4.0 v1.4.0 2026-03-26 23:52:50 +00:00
d9e2c485f4 fix: pipeline coverage step produces valid JSON, deno reads it with readFile() 2026-03-26 23:37:34 +00:00
ed9c97ca32 fix: add host_context field to container executor test contexts 2026-03-26 23:37:24 +00:00
31a46ecbbd feat(wfe-yaml): add readFile() op to deno runtime with permission checking 2026-03-26 23:29:11 +00:00
d3426e5d82 feat(wfe-yaml): auto-convert ##wfe[output] values to typed JSON (bool, number) 2026-03-26 23:28:10 +00:00
ed38caecec fix(wfe-core): resolve .outputs. paths flat and pass empty object to child workflows 2026-03-26 23:18:48 +00:00
f0cc531ada docs: update README with condition system and task file include documentation 2026-03-26 17:26:11 +00:00
b1a1098fbc test(wfe-yaml): add condition schema, compiler, validation, and include tests 2026-03-26 17:25:26 +00:00
04c52c8158 feat(wfe-yaml): add task file includes with cycle detection and config override 2026-03-26 17:22:02 +00:00
1f14c9ac9a feat(wfe-yaml): add condition field path validation, type checking, and unused output detection 2026-03-26 17:21:50 +00:00
6c11473999 feat(wfe-yaml): compile YAML conditions into StepCondition with all operators 2026-03-26 17:21:28 +00:00
ced1916def feat(wfe-yaml): add YamlCondition types with combinator and comparison deserialization 2026-03-26 17:21:20 +00:00
57d4bdfb79 fix(wfe-postgres): add Skipped status to pointer status conversion 2026-03-26 17:20:28 +00:00
dd724e0a3c feat(wfe-core): integrate condition check into executor before step execution 2026-03-26 17:11:37 +00:00
ab1dbea329 feat(wfe-core): add condition evaluator with field path resolution and cascade skip 2026-03-26 17:10:05 +00:00
9c90f0a477 feat(wfe-core): add when condition field to WorkflowStep 2026-03-26 17:05:30 +00:00
aff3df6fcf feat(wfe-core): add StepCondition types and PointerStatus::Skipped 2026-03-26 17:05:14 +00:00
a71fa531f9 docs: add self-hosting CI pipeline section to README
Documents pipeline architecture, how to run it, WFE features
demonstrated, preflight tool checks, and graceful infrastructure
skipping. Adds nextest cover profile for llvm-cov integration.
2026-03-26 16:03:14 +00:00
aeb51614cb feat: self-hosting CI pipeline with 12 composable workflows
workflows.yaml defines the canonical CI pipeline: preflight → lint →
test (unit + integration + containers) → cover → package → tag →
publish → release, orchestrated by the ci workflow.

Demonstrates: nested workflows, typed I/O schemas, shell + deno executors,
YAML anchors with merge keys, variable interpolation, error handling with
retry, on_failure hooks, ensure hooks, infrastructure detection (docker/lima).

run_pipeline example loads and executes the pipeline with InMemory providers.
2026-03-26 16:01:51 +00:00
39b3daf57c feat(wfe-yaml): add YAML 1.1 merge key support via yaml-merge-keys
Preprocesses <<: *anchor merge keys before serde_yaml 0.9 deserialization.
serde_yaml implements YAML 1.2 which dropped merge keys; the yaml-merge-keys
crate resolves them as a preprocessing step, giving full anchor + merge
support for DRY pipeline definitions.
2026-03-26 15:59:28 +00:00
fe65d2debc fix(wfe-yaml): replace SubWorkflow placeholder with real implementation
The YAML compiler was using SubWorkflowPlaceholderStep that returned
next() immediately. Replaced with real SubWorkflowStep from wfe-core
that starts child workflows and waits for completion events.

Added regression test verifying the compiled factory produces a step
that calls host_context.start_workflow() and returns wait_for_event.
2026-03-26 15:58:47 +00:00
20f32531b7 chore: add nextest cover profile, update backward-compat imports
Nextest cover profile for cargo llvm-cov integration.
Update existing test imports from load_workflow_from_str to
load_single_workflow_from_str for backward compatibility.
2026-03-26 14:15:50 +00:00
856edbd22e feat(wfe): implement HostContext for nested workflow execution
HostContextImpl delegates start_workflow to persistence/registry/queue.
Background consumer passes host_context to executor so SubWorkflowStep
can start child workflows. SubWorkflowStep auto-registered as primitive.

E2E tests: parent-child workflow, typed inputs/outputs, child failure
propagation, nonexistent child definition. 90% line coverage.
2026-03-26 14:15:19 +00:00
bf252c51f0 feat(wfe-yaml): add workflow step type, cross-ref validation, cycle detection
Compiler dispatches type: workflow to SubWorkflowStep. Validation
detects circular workflow references via DFS with coloring. Cross-
workflow reference checking for multi-workflow files. Duplicate
workflow ID detection. 28 edge case tests for validation paths.
2026-03-26 14:14:39 +00:00
821ef2f570 feat(wfe-yaml): add multi-workflow YAML and typed input/output schemas
YamlWorkflowFile supports both single (workflow:) and multi (workflows:)
formats. WorkflowSpec gains typed inputs/outputs declarations.
Type string parser for inline types ("string?", "list<number>", etc.).
load_workflow_from_str returns Vec<CompiledWorkflow>.
Backward-compatible load_single_workflow_from_str convenience function.
2026-03-26 14:14:15 +00:00
a3211552a5 feat(wfe-core): add typed workflow schema system
SchemaType enum with inline syntax parsing: "string", "string?",
"list<number>", "map<string>", nested generics. WorkflowSchema
validates inputs/outputs against type declarations at both compile
time and runtime. 39 tests for parse and validate paths.
2026-03-26 14:12:51 +00:00
0317c6adea feat(wfe-buildkit): rewrite to use own generated protos (tonic 0.14)
Replaced third-party buildkit-client git dependency with
wfe-buildkit-protos generated from official moby/buildkit protos.

Direct ControlClient gRPC calls: SolveRequest with frontend attrs,
exporters, cache options. Daemon-local context paths for builds
(session protocol for remote transfer is TODO).

Both proto crates now use tonic 0.14 / prost 0.14 — no transitive
dependency conflicts. 95 combined tests, 85.6% region coverage.
2026-03-26 12:43:02 +00:00
2f861a9192 feat(wfe-buildkit-protos): generate full BuildKit gRPC API (tonic 0.14)
New crate generating Rust gRPC stubs from the official BuildKit
proto files (git submodule from moby/buildkit). Control service,
LLB definitions, session protocols, and source policy.
tonic 0.14 / prost 0.14.
2026-03-26 12:29:00 +00:00
27ce28e2ea feat(wfe-containerd): rewrite to use generated containerd gRPC protos
Replaced nerdctl CLI shell-out with direct gRPC communication via
wfe-containerd-protos (tonic 0.14). Connects to containerd daemon
over Unix socket.

Implementation:
- connect() with tonic Unix socket connector
- ensure_image() via ImagesClient (full pull is TODO)
- build_oci_spec() constructing OCI runtime spec with process args,
  env, user, cwd, mounts, and linux namespaces
- Container lifecycle: create → snapshot → task create → start →
  wait → read FIFOs → cleanup
- containerd-namespace header injection on every request

FIFO-based stdout/stderr capture using named pipes.
40 tests, 88% line coverage (cargo-llvm-cov).
2026-03-26 12:11:28 +00:00
d71f86a38b feat(wfe-containerd-protos): generate full containerd gRPC API (tonic 0.14)
New crate generating Rust gRPC stubs from the official containerd
proto files (vendored as git submodule). Full client-facing API surface
using tonic 0.14 / prost 0.14. No transitive dependency conflicts.

Services: containers, content, diff, events, images, introspection,
leases, mounts, namespaces, sandbox, snapshots, streaming, tasks,
transfer, version.
2026-03-26 12:00:46 +00:00
b02da21aac feat(wfe-buildkit): rewrite to use buildkit-client gRPC instead of CLI
Replaced buildctl CLI shell-out with direct gRPC communication via
buildkit-client crate. Connects to buildkitd daemon over Unix socket
or TCP with optional TLS.

Implementation:
- connect() with custom tonic UnixStream connector
- execute_build() implementing the solve protocol directly against
  ControlClient (session setup, file sync, frontend attributes)
- Extracts digest from containerimage.digest in solve response

Added custom lima template (test/lima/wfe-test.yaml) that provides
both buildkitd and containerd with host-forwarded Unix sockets for
reproducible integration testing.

E2E tests against real buildkitd daemon via WFE_BUILDKIT_ADDR env var.
54 tests total. 89% line coverage (cargo-llvm-cov with E2E).
2026-03-26 11:18:22 +00:00
30b26ca5f0 feat(wfe-buildkit, wfe-containerd): add container executor crates
Standalone workspace crates for BuildKit image building and containerd
container execution. Config types, YAML schema integration, compiler
dispatch, validation rules, and mock-based unit tests.

Current implementation shells out to buildctl/nerdctl — will be
replaced with proper gRPC clients (buildkit-client, containerd protos)
in a follow-up. Config types, YAML integration, and test infrastructure
are stable and reusable.

wfe-buildkit: 60 tests, 97.9% library coverage
wfe-containerd: 61 tests, 97.8% library coverage
447 total workspace tests.
2026-03-26 10:28:53 +00:00
d4519e862f feat(wfe-buildkit): add BuildKit image builder executor
Standalone crate implementing StepBody for building container images
via buildctl CLI. Supports Dockerfiles, multi-stage targets, tags,
build args, cache import/export, push to registry.

Security: TLS client certs for buildkitd connections, per-registry
authentication for push operations.

Testable without daemon via build_command() and parse_digest().
20 tests, 85%+ coverage.
2026-03-26 10:00:42 +00:00
4fc16646eb chore: add versions and sunbeam registry config for publishing 2026-03-26 01:02:34 +00:00
a26a088c69 chore: add versions to workspace path dependencies for crates.io 2026-03-26 01:00:19 +00:00
71d9821c4c chore: bump version to 1.0.0 and add repository metadata 2026-03-26 00:59:20 +00:00