fix(ci): drop paths-filter negation patterns that fire on docs-only PRs - #61
Merged
Merged
Conversation
dorny/paths-filter standalone negation patterns (`'!apps/api/**/*.md'` and the like) don't behave like exclude-from-include rules — they evaluate to true for ANY changed file that doesn't fit the inverse pattern. Net effect: on a docs-only PR with no code touched, the `code` filter still returned `true` because a docs `.mdx` file doesn't match `apps/api/**/*.md`, so the negation "matched". Concrete evidence: PR #58 (only changed `apps/docs/.../deployment.mdx`). Every step in `apps-api-ci.yml`'s `validate` job ran — checkout, filter, Bun, install, db migrations, full test suite, coverage, production bundle. The buggy negation set `Filter code = true`, the internal `if: steps.filter.outputs.code == 'true'` gates all short-circuited to "run", and we hit a unit-test flake on a PR that touched zero application code. Removed the negation lines from all 10 affected workflows. The filter now matches strictly on the positive paths (`apps/api/**`, `apps/ui/**`, etc. + the workflow file itself). Trade-off: a `README.md` change inside `apps/api/` will now trigger api-ci. That's acceptable — those changes are rare, and the previous "fast-skip" optimisation wasn't actually working anyway. Net effect on docs-only PRs: api-ci, ui-validate, smoke, bootstrap-validate, validate-compose, and the security workflows all now correctly skip-with-success in ~30 s instead of running their full pipelines. Files touched (10 workflows, 22 lines deleted): apps-api-ci.yml apps-api-security-{deps,sast,secrets}.yml apps-ui-security-{deps,sast,secrets}.yml apps-ui-validate.yml infra-bootstrap-validate.yml infra-compose-full-stack-smoke.yml infra-compose-validate-compose.yml (3 filter blocks) This PR self-verifies: it's workflow-only, so the `code` filter on every affected workflow should now correctly evaluate to `false` on this PR (no apps/api, apps/ui, infra/* changes), and the heavy jobs should report quick green via skip-with-success. If you see Bun install + full test suite running on this PR, the fix is wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
`dorny/paths-filter` standalone negation patterns (`'!apps/api//*.md'` and the like) don't behave like "exclude these from the matches" rules. They evaluate to true for any changed file that doesn't fit the inverse pattern. So on a docs-only PR, the `code` filter returns `true` because the changed `.mdx` file doesn't match `apps/api//*.md` — and the negation "matches".
Concrete evidence: PR #58 changed only `apps/docs/.../deployment.mdx`. Every step in `apps-api-ci.yml`'s validate job ran — checkout, filter, Bun, install, db migrations, full test suite, coverage, production bundle. The buggy negation set `Filter code = true`, the internal `if: steps.filter.outputs.code == 'true'` gates all short-circuited to "run", and we hit a unit-test flake on a PR that touched zero application code.
Fix
Remove the negation lines from all 10 affected workflows. Filters now match strictly on the positive paths.
Trade-off: A `README.md` change inside `apps/api/` will now trigger api-ci. That's acceptable — those changes are rare, and the previous "fast-skip" wasn't actually working anyway.
Net effect on docs-only PRs: api-ci, ui-validate, smoke, bootstrap-validate, validate-compose, and the security workflows all now correctly skip-with-success in ~30 s instead of running their full pipelines.
Test plan