Commit d7ec5d9
authored
fix(ci): stop e2e workflows triggering on docs-only changes (tldraw#8902)
In order to stop the dotcom, examples, and perf e2e workflows from
running on PRs that don't touch their dependencies (for example,
docs-only PRs or markdown-only changes inside `packages/`), this PR
splits each workflow's relevance check into two `dorny/paths-filter`
steps and ANDs the results in the job's `outputs:` expression.
Closes tldraw#8878
### Why the previous filter misbehaved
`dorny/paths-filter@v3` defaults to `predicate-quantifier: some`, so the
filter returns `true` if **any** listed pattern matches. Under that
quantifier, a negation like `!**/*.md` matches every file that isn't a
`.md` — including `.mdx` files. A docs-only change to
`apps/docs/content/releases/next.mdx` therefore matched `!**/*.md` and
tripped the filter, even though no positive include matched it.
### Why one filter isn't enough
`dorny/paths-filter` only supports `predicate-quantifier: some | every`
(it's a per-step option, not per-filter). Under `every`, every listed
pattern must match for a file to count, which doesn't combine with
multiple positive includes like `packages/**` **or** `apps/dotcom/**` —
no single file is in both. So we use two steps and combine.
### How the new check works
Per workflow:
- `includes` (default `some`): true if any changed file is in a relevant
path (`packages/**`, `apps/dotcom/**` or `apps/examples/**`, the
workflow file itself, `.github/actions/**`, `yarn.lock`).
- `nondocs` (`predicate-quantifier: 'every'` with `['**', '!**/*.md',
'!**/*.mdx']`): a file is included only if it matches `**` and is not
`.md` and not `.mdx`, so the filter is true iff at least one
non-markdown file changed.
`relevant = includes && nondocs`, evaluated in the job's `outputs:`
expression. Behavior:
| PR contents | `includes` | `nondocs` | `relevant` |
| --- | --- | --- | --- |
| `apps/docs/content/foo.mdx` only | false | false | **false** (skip) |
| `packages/foo/README.md` only | true | false | **false** (skip) |
| `packages/foo/src/index.ts` only | true | true | **true** (run) |
| `packages/foo/src/index.ts` + `apps/docs/foo.mdx` | true | true |
**true** (run, code change wins) |
### Change type
- [x] `other`
### Test plan
1. Open a PR that only changes `apps/docs/content/releases/next.mdx`.
Confirm each of `End to end tests (dotcom)`, `End to end tests
(examples)`, and `End to end tests (perf)` reports both filter steps and
resolves `relevant = false`, and the matching `build` job is skipped.
2. Open a PR that only changes a `packages/**/README.md`. Confirm the
same three workflows skip the `build` job (`includes = true`, `nondocs =
false`).
3. Open a PR that changes a relevant code file (e.g. anything under
`packages/<x>/src/`, `apps/dotcom/`, `apps/examples/`, the workflow
file, `.github/actions/`, or `yarn.lock`). Confirm the corresponding e2e
workflow still runs.
4. Open a PR that mixes a code change with a docs/markdown change.
Confirm the workflow still runs (the code change satisfies `nondocs`).
### Release notes
- Internal CI fix; no user-facing changes.1 parent 3df7177 commit d7ec5d9
3 files changed
Lines changed: 39 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
40 | 49 | | |
41 | 50 | | |
42 | 51 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
38 | 47 | | |
39 | 48 | | |
40 | 49 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
38 | 47 | | |
39 | 48 | | |
40 | 49 | | |
| |||
0 commit comments