logs.gokuls.in

1 pull request merged across 1 repo

bahdotsh/wrkflw

  • Diff-aware execution: wrkflw run --diff parses workflow on: trigger configs (paths, branches, tags) and evaluates them against the local git diff — only workflows whose filters match will execute. This is a feature act completely lacks.
  • Watch mode: wrkflw watch uses filesystem monitoring (notify crate) with debouncing to detect changes and automatically re-run affected workflows.
  • TUI integration: Press d in the TUI to toggle a diff filter overlay showing which workflows would trigger based on current changes.

New crates

  • wrkflw-trigger-filter — parses on_raw YAML into structured trigger configs, matches against event context (38 unit tests)
  • wrkflw-watcher — filesystem watcher with debouncing and trigger-aware execution

CLI additions

wrkflw run --diff .github/workflows/ci.yml
wrkflw run --event pull_request --diff .github/workflows/ci.yml
wrkflw run --changed-files src/main.rs,src/lib.rs .github/workflows/ci.yml
wrkflw watch [--debounce 500] [--event push]

Design decisions

  • Shells out to git diff --name-only instead of adding git2/libgit2 C dependency
  • Uses glob::Pattern (already in workspace) for GitHub Actions-compatible path matching
  • Default behavior unchanged — no flags means run everything as before

Test plan

  • 38 unit tests across trigger-filter crate (parser, path matcher, ref matcher, evaluator)
  • 2 unit tests for watcher debouncer
  • Full workspace cargo test passes (all existing tests unaffected)
  • cargo clippy --workspace clean
  • cargo fmt --all applied
  • Manual: wrkflw run --diff in a repo with path-filtered workflows
  • Manual: wrkflw watch detects file changes and triggers correct workflows
  • Manual: TUI d key toggles diff filter with green/gray indicators