feat(events): progress values on custom attestation steps

Merged
MI
3d ago
+964-129

Refs #3825

Custom attestation steps can carry progress values, so a long pipeline step can show how far it got, for example 240 of 500 commits.

  • API: WorkflowRunEvent gets an optional top-level Progress progress, with Progress { int64 current; int64 total }. Current is from 0 to total, and total is more than 0. The progress is not one of the typed attributes, so other event types can support it later. Today the control plane accepts it only on custom events. It is stored in a new nullable progress column.
  • CLI: chainloop attestation event takes --current N --total N. It needs both flags or neither. A wrong or empty value shows a warning, sends nothing, and exits 0, as for the other wrong input of the command.
  • A long step reports its progress with repeated started events of its key. There is no new status.
  • chainloop workflow run describe shows the progress of the last event of a custom step on the step row. Below the step, consecutive progress updates fold into the last one, so a step that reports every few seconds does not print hundreds of lines. The JSON output keeps every event.
├─ 10:01:02  ● step `classify-commits`  running for 4m43s · 240/500
│  ├─ 10:01:02  ● Classifying 500 commits · 0/500
│  └─ 10:01:22  ● 240/500

Spec: this adds R-015 and D-015 to spec issue-3825. D-015 supersedes the Non-goal "custom attributes on custom events", which is struck through.

AI disclosure: this change was made with the help of Claude Code.

🤖 Posted by Maximus bot (Claude Code) on behalf of @migmartri