Skip to content

fix(ci): drop paths-filter negation patterns that fire on docs-only PRs - #61

Merged
agjs merged 1 commit into
mainfrom
fix/paths-filter-negation-bug
May 30, 2026
Merged

agjs merged 1 commit into
mainfrom
fix/paths-filter-negation-bug

Conversation

@agjs

@agjs agjs commented May 30, 2026

Copy link
Copy Markdown
Contributor

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.

Workflow Negations removed
apps-api-ci.yml 2
apps-api-security-deps.yml 2
apps-api-security-sast.yml 2
apps-api-security-secrets.yml 2
apps-ui-security-deps.yml 2
apps-ui-security-sast.yml 2
apps-ui-security-secrets.yml 2
apps-ui-validate.yml 2
infra-bootstrap-validate.yml 1
infra-compose-full-stack-smoke.yml 2
infra-compose-validate-compose.yml 3
Total 22 lines

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

  • All 11 workflow YAMLs lint clean
  • This PR self-verifies: every affected workflow's filter includes its own file in its positive-path list, so each one runs in full on this PR. Green across the board = filter changes are sound when relevant files do change.
  • Follow-up verification (next docs-only PR): all heavy workflows skip in ~30 s instead of running their full pipeline.

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.
@agjs
agjs enabled auto-merge (squash) May 30, 2026 12:04
@agjs
agjs merged commit 3a8db23 into main May 30, 2026
23 checks passed
@agjs
agjs deleted the fix/paths-filter-negation-bug branch May 30, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant