Commit cd8af93e07

cd8af93e076d5f3a9e2059e13fb8f73638a8da79

parent: 63974ed532

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-05 04:46 UTC

Design: define path matching, since path.Match does not cross /

Ref #169

Layout: unified · split

docs/specs/2026-09-04-wiki-in-repo-design.md +16 −6
@@ -57,12 +57,22 @@ but the parity gain is conditional and should not be claimed otherwise.
5757
5858### Phase 1 — path filters (#169)
5959
60`ci.Job` gains `Paths` and `PathsIgnore`, each a list of globs matched with
61`path.Match` against the changed-file list from `gitutil.DiffFiles(dir, old,
62new)`, which already exists (`internal/gitutil/merge.go:276`).
63
64A job runs when its `Paths` is empty or at least one changed file matches it,
65and no `PathsIgnore` pattern matches every changed file.
60`ci.Job` gains `Paths` and `PathsIgnore`, each a list of globs matched against
61the changed-file list from `gitutil.DiffFiles(dir, old, new)`, which already
62exists (`internal/gitutil/merge.go:276`).
63
64**Matching.** `path.Match` alone is not enough: Go's `*` does not cross `/`, so
65`.gitbay/wiki/**` matches `.gitbay/wiki/Home.md` but not
66`.gitbay/wiki/sub/Page.md` — a filter that appears to work and quietly misses
67nested files. Define it explicitly: a pattern ending in `/**` matches that
68directory and everything beneath it at any depth, implemented as a prefix
69check; every other pattern goes to `path.Match` against the full path. A test
70must cover the nested case, since that is the one a reader will assume works.
71
72**Selection.** A job runs when `Paths` is empty or at least one changed file
73matches one of its patterns. It is then skipped only when every changed file
74matches at least one `PathsIgnore` pattern. A push touching one ignored file
75and one other file runs the job.
6676
6777**Fail open.** A job runs whenever the filter cannot be evaluated: a new branch
6878with no diff base (`old` is empty or all zeros), a `DiffFiles` error, or a job