Refactor DirectoryOwnersExtractor to make it more useful
DirectoryOwnersExtractor.find_owners_file is made more generic to accommodate the new usage in ImportNotifier: * It does not skip "empty" OWNERS (those without emails) any more, which allows "# WPT-NOTIFY" to be added to OWNERS files with comments only (e.g. "# TEAM", "# COMPONENT" lines; there are a bunch in wpt). * It may now return LayoutTests/external/OWNERS. This is to make sure owners can always be found for WPT files so that ImportNotifier can generate and log bugs for all failures (but we will never turn on WPT-NOTIFY there). * It can now take four variants of paths: (absolute, relative) X (file, directory), to make it easier to use. Previous heuristics like skipping empty OWNERS are moved to list_owners instead, which is only used for generating a list of owners in commit messages and may eventually be removed. Also improve the setup of the unit test of this module. Bug: 765334 Change-Id: I01bd1fa85d2602299eaf1e0d8e0872b04b93a008 Reviewed-on: https://chromium-review.googlesource.com/822834 Commit-Queue: Robert Ma <robertma@chromium.org> Reviewed-by:Quinten Yearsley <qyearsley@chromium.org> Cr-Commit-Position: refs/heads/master@{#523781}
Showing
Please register or sign in to comment