Our CI runs with `pants test --changed-since=origi...
# general
g
Our CI runs with
pants test --changed-since=origin/main
now I observed that one PR changed a file name that didn’t trigger a test that depended on that file. Has this been observed before? (I searched but couldn’t find a matching issue)
g
Isn't
origin/main
the current commit when your CI runs? I use HEAD^ for CI to compare against previous commit (we always squash-merge).
g
I meant the CI runs inside the branch associated with the PR. Not CI runs on the main branch itself.
g
Ah, makes sense. Are you doing shallow checkouts or something like that so it doesn't fetch the whole git history? This is quite common on GitHub actions for example. I think Buildkite might also do that in some configurations.
h
Hi @gentle-gigabyte-52115, can you provide a small github repo that demonstrates the problem? Many people, myself included, use
--changed-since
frequently, and I haven't noticed this issue. So maybe this is a git diffing issue of some kind as @gorgeous-winter-99296 suggests?
g
we use
fetch-depth: 0
in actions. I’ll create a minimal example tomorrow
g
Maybe the
--changed-dependents
(https://www.pantsbuild.org/docs/reference-changed#dependents) would help here?
h
Ah yes, of course 🤦‍♂️
--changed-since
only retrieves files that have changed.
--changed-dependents
also retrieves all files that transitively depend on files that have changed. So based on your use case it sounds like you need that.
g
Here is a minimal example https://github.com/JoostvDoorn/pants-changed-since-reproduction See the README for the steps to reproduce. I know this can be caught by turning
unowned_dependency_behavior
to error, but we currently use the default value.