buckley
buckley

Reputation: 14079

Why don't Path Filters in a Pull Request Build Validation work as expected?

Or, why are path filter (as of 2019-06-14) under documented by Microsoft.

Behavior of Path Filters inside PR Build validation can be perceived as non intuitive.

Builds are started or not triggered for no obvious reason.

Upvotes: 2

Views: 2542

Answers (1)

buckley
buckley

Reputation: 14079

Confusion can arise from looking at an individual commit to trigger (or not) a build.

Key is to take into account all commits that comprise a PR

  • previous additions/updates made in other commits should be considered
  • addition and removal of the same file is considered no change. Let's use the term net(to) effect of a group of commits to draw attention to this mechanism.

Some more observations

  • builds disappear from the overview if the path filter is not in scope anymore for the PR. So they are dynamic: existing PR (possibly in the 10's) are affected retro actively. This can be a good thing I suppose but also a bad+unexpected thing. Be cautious.
  • Specifying a path filter (overriding the empty string in the UI) removes the implicit root inclusion. So a beginners fault is that the the following path filter is expected to only ignore changes to folder1 and pick up all other changes !/folder1/*. It doesn't. You have to explicitly add the root back in /*;!/folder1/*

Upvotes: 11

Related Questions