Annotate pipelines with live run status/history from the Woodpecker API #4

Closed
opened 2026-08-01 15:42:15 +03:00 by oleks · 1 comment
Owner

SPEC.md roadmap item 3 — the single biggest gap per review feedback on
commit 4b5b336: pipetree is pure structure today (files on disk only),
so it can't say which pipelines are broken, redundant, or stale.

Pull last-run status per pipeline file via the Woodpecker HTTP API (the
same one woodpecker-cli/cluster:ci-agent use — see
SPEC.md)
and annotate the tree: last status, last run time, "hasn't run in N days".

This is what turns pipetree from a topology browser into a CI health tool.

Design note: this needs a repo -> Woodpecker-repo mapping (owner/name is
probably sufficient given the fleet's naming) and a server URL/token,
which up to now pipetree hasn't needed at all (pure filesystem tool) — worth
deciding whether this is a separate pipetree health subcommand vs. a flag
on the main scan, so the offline/no-network path stays fast and simple by
default.

Acceptance criteria

  • decide subcommand vs. flag (design note above) and document the choice in SPEC.md
  • server URL/token configurable via flag and env var (matching woodpecker-cli's WOODPECKER_SERVER/WOODPECKER_TOKEN convention where reasonable, for muscle-memory consistency)
  • each pipeline in tree/JSON output can show last status + last-run age when the health layer is invoked
  • default (no server access) scan behavior is completely unchanged — this is additive, opt-in
  • verified against a handful of real repos with known-good and known-stale pipelines
SPEC.md roadmap item 3 — the single biggest gap per review feedback on commit `4b5b336`: pipetree is pure structure today (files on disk only), so it can't say which pipelines are broken, redundant, or stale. Pull last-run status per pipeline file via the Woodpecker HTTP API (the same one `woodpecker-cli`/`cluster:ci-agent` use — see [SPEC.md](https://git.oleks.space/oleks/pipetree/src/branch/main/SPEC.md#external-validation-woodpecker-cli)) and annotate the tree: last status, last run time, "hasn't run in N days". This is what turns pipetree from a topology browser into a CI health tool. Design note: this needs a repo -> Woodpecker-repo mapping (owner/name is probably sufficient given the fleet's naming) and a server URL/token, which up to now pipetree hasn't needed at all (pure filesystem tool) — worth deciding whether this is a separate `pipetree health` subcommand vs. a flag on the main scan, so the offline/no-network path stays fast and simple by default. ## Acceptance criteria - [ ] decide subcommand vs. flag (design note above) and document the choice in SPEC.md - [ ] server URL/token configurable via flag and env var (matching `woodpecker-cli`'s `WOODPECKER_SERVER`/`WOODPECKER_TOKEN` convention where reasonable, for muscle-memory consistency) - [ ] each pipeline in tree/JSON output can show last status + last-run age when the health layer is invoked - [ ] default (no server access) scan behavior is completely unchanged — this is additive, opt-in - [ ] verified against a handful of real repos with known-good and known-stale pipelines
oleks added this to the v0.3 — CI health milestone 2026-08-01 15:42:15 +03:00
oleks added the enhancement label 2026-08-01 15:42:15 +03:00
oleks closed this issue 2026-08-01 17:04:02 +03:00
Author
Owner

Resolved by 2f13297 (v0.3 batch push). Design decision: -health flag, not a subcommand (see SPEC.md). Bug found+fixed during verification: initial lookup used pl.Name ("default") instead of Woodpecker's real runtime workflow name ("woodpecker", per SanitizePath) - added parse.WorkflowName, re-verified live against both oleks/pipetree (single-file) and oleks/builder-arbitrage (multi-file).

Resolved by 2f13297 (v0.3 batch push). Design decision: -health flag, not a subcommand (see SPEC.md). Bug found+fixed during verification: initial lookup used pl.Name ("default") instead of Woodpecker's real runtime workflow name ("woodpecker", per SanitizePath) - added parse.WorkflowName, re-verified live against both oleks/pipetree (single-file) and oleks/builder-arbitrage (multi-file).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: oleks/pipetree#4