zaptst / zap

A streamable structured interface for real time reporting of developer tools.
MIT License
120 stars 1 forks source link

Progress, Statuses, and Completion Values #11

Closed jamiebuilds closed 6 years ago

jamiebuilds commented 6 years ago

A couple things:

idea:

Here is a vague idea of what we could do: (Note: I don't like this very much atm)

// init state:
{ id: "0",   kind: "item",  event: "started",   status: "running" }

// child success:
{ id: "0.0", kind: "check", event: "started",   status: "running" }
{ id: "0.0", kind: "check", event: "completed", status: "passed"  }

// child fail:
{ id: "0.1", kind: "check", event: "started",   status: "running" }
{ id: "0.1", kind: "check", event: "completed", status: "failed"  }

// notify state change of parent:
{ id: "0",   kind: "item",  event: "progress",  status: "failed"  }

// child success:
{ id: "0.2", kind: "check", event: "started",   status: "running" }
{ id: "0.2", kind: "check", event: "completed", status: "passed"  }

// child errored:
{ id: "0.3", kind: "check", event: "started",   status: "running" }
{ id: "0.3", kind: "check", event: "completed", status: "errored" }

// final state:
{ id: "0",   kind: "item",  event: "completed", status: "failed"  }

There would be 3 "event"'s:

There would be 4 "status"'s:


We could also add a progress field:

{ ... kind: "group", event: "started", progress: { completed: 4, planned: 20 } ... }