Skip to content

reproduce ignore rules inconsistency - #17641

Closed
jriddy wants to merge 1 commit into
mainfrom
repro-gitignore-pantsignore-inconsistency
Closed

reproduce ignore rules inconsistency#17641
jriddy wants to merge 1 commit into
mainfrom
repro-gitignore-pantsignore-inconsistency

Conversation

@jriddy

@jriddy jriddy commented Nov 26, 2022

Copy link
Copy Markdown
Contributor

There's an inconsistency between patterns defined in .gitignore and
patterns defined in pants_ignore for how the filesystem watcher is
invalidating ignored paths. For paths only in .gitignore, if you
touch that node, and the parent directory is not ignored, it still
invalidates ongoing build graph steps. However, if this path is in
pants_ignore, it is ignored properly.

To reproduce on this branch, comment out the #/ignored_dir line
from pants.toml and run the following command:

./pants test \
  --extra-env-vars=IGNORED_DIR="$(pwd)"/ignored_dir \
  code_using_ignored_dir/test_writing_files.py

You'll see the test never complete because the touch inside the test
invalidates the graph. Comment the line in pants.toml again, and re-run
the command, and you'll see the test run fine.

This is just a demo PR, it is not intended to be merged ever

[ci skip-rust]

There's an inconsistency between patterns defined in .gitignore and
patterns defined in pants_ignore for how the filesystem watcher is
invalidating ignored paths.  For paths only in .gitignore, if you
`touch` that node, and the parent directory is not ignored, it still
invalidates ongoing build graph steps.  However, if this path is in
pants_ignore, it is ignored properly.

To reproduce on this branch, comment out the `#/ignored_dir` line
from pants.toml and run the following command:

```
./pants test \
  --extra-env-vars=IGNORED_DIR="$(pwd)"/ignored_dir \
  code_using_ignored_dir/test_writing_files.py
```

You'll see the test never complete because the `touch` inside the test
invalidates the graph.  Comment the line in pants.toml again, and re-run
the command, and you'll see the test run fine.

This is just a demo PR, it is not intended to be merged ever

[ci skip-rust]
@jriddy

jriddy commented Nov 26, 2022

Copy link
Copy Markdown
Contributor Author

This seems to be related to the trailing slash notation in .gitignore. Removing the trailing slash (i.e. putting /ignored_dir) fixes this issue. But the trailing slash is a common gitignore pattern.

@jriddy jriddy added the bug label Nov 26, 2022
@jriddy jriddy closed this Nov 26, 2022
@kaos
kaos deleted the repro-gitignore-pantsignore-inconsistency branch April 23, 2023 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant