dokploy icon indicating copy to clipboard operation
dokploy copied to clipboard

Watch path negations are evaluated independently across multiple patterns

Open lmachineone opened this issue 3 months ago • 1 comments

What happened

When Watch Paths contains multiple negated patterns, a change that should be excluded can still trigger a deployment.

Example patterns:

!CHANGELOG.md
!VERSION
!tests/**

With VERSION as the only changed file, deployment is triggered.

Expected behavior

A deployment should not start when every changed file is excluded by the combined pattern set.

Cause

shouldDeploy currently calls micromatch.some(files, watchPaths). That evaluates each pattern independently. Although !VERSION rejects VERSION, another negative matcher such as !CHANGELOG.md accepts it, so the overall some() result is true.

Proposed fix

Evaluate the files and patterns as one micromatch set, then deploy only when at least one file remains. Add regression tests for multiple negations, mixed positive/negative patterns, and recursive directory exclusions.

I can submit a focused PR against canary with the implementation and tests.

lmachineone avatar Aug 28 '26 17:08 lmachineone

DOK-701

linear-code[bot] avatar Aug 28 '26 17:08 linear-code[bot]