mirror of
https://github.com/facebook/sapling.git
synced 2024-10-06 06:47:41 +03:00
f613702fef
Summary: When this check was previously enabled, we saw 2 issues from users: - The check failing due to status taking more than 5s, - The check having false positive. The first one can be fixed by increasing the timeout on the Thrift client, the second one is anything but clear at first sight. Digging a bit deeper, one issue became apparent. In: if modified_file not in diff: The type of `modified_file` is a `Path`, while the type of `diff` was a `Set[str]` (the type annotation was wrong). If we manually test this, here is what we get: % python3 Python 3.8.6 (default, Feb 10 2023, 17:15:29) [GCC 11.x 20221024 (Facebook) 11.2.1+] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from pathlib import Path >>> a = {"a/b.c", "c/d.c"} >>> a {'c/d.c', 'a/b.c'} >>> Path('c/d.c') in a False >>> a = {Path("a/b.c"), Path("c/d.c")} >>> Path('c/d.c') in a True >>> The check would have thus failed, which would have led to false positives. Lastly, this also fixes a potential false negative, where the number of modified files could be the same as the files in diff when the latter includes an added/remove file but is missing one of the modified file. Removing the check comparing both is sufficient to avoid this issue. Reviewed By: chadaustin Differential Revision: D44558090 fbshipit-source-id: 0cc83a87758a5feeff78c38b210ebd91fa5d58f5 |
||
---|---|---|
.. | ||
fs | ||
integration | ||
locale | ||
mononoke | ||
scm | ||
test_support | ||
test-data | ||
testlib | ||
.clang-tidy | ||
.gitignore | ||
.mononoke_test_file | ||
Eden.project.toml |