Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Issue 2148153002: Fix per-file owners check for deleted files. (Closed)

Created:
4 years, 5 months ago by dtu
Modified:
4 years, 2 months ago
CC:
chromium-reviews, tandrii+omg_git_cl_chromium.org, dpranke+depot_tools_chromium.org, iannucci+depot_tools_chromium.org, prasadv, RobertoCN, sullivan
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Fix per-file owners check for deleted files. Previously if you deleted a file that you had per-file owners on, it would fail the owners check. This fixes that. Originally, owners.Database used glob to enumerate the directory and added all the matching files in the directory to some dicts holding the owners information. If a CL deleted a file, it'd no longer be on the filesystem, so it wouldn't be in these dicts. There'd be no per-file owners information for it. With this patch, the Database no longer enumerates individual files. It instead keeps track of the glob patterns and checks the CL's files against the patterns at lookup time. BUG=622381 TEST=tests/owners_unittest.py && tests/owners_finder_test.py # Unit test included. Committed: https://chromium.googlesource.com/chromium/tools/depot_tools/+/944b60530e30ff97179b273360c8d3fb4f8cea7a

Patch Set 1 #

Total comments: 3

Patch Set 2 : Rebase! #

Unified diffs Side-by-side diffs Delta from patch set Stats (+92 lines, -78 lines) Patch
M git_cl.py View 3 chunks +2 lines, -3 lines 0 comments Download
M owners.py View 1 12 chunks +48 lines, -44 lines 0 comments Download
M owners_finder.py View 3 chunks +6 lines, -19 lines 0 comments Download
M presubmit_support.py View 1 chunk +1 line, -1 line 0 comments Download
M tests/owners_finder_test.py View 2 chunks +2 lines, -5 lines 0 comments Download
M tests/owners_unittest.py View 1 4 chunks +33 lines, -6 lines 0 comments Download

Messages

Total messages: 17 (8 generated)
dtu
https://codereview.chromium.org/2148153002/diff/1/owners_finder.py File owners_finder.py (left): https://codereview.chromium.org/2148153002/diff/1/owners_finder.py#oldcode47 owners_finder.py:47: if author: This seemed like an abstraction layer violation. ...
4 years, 5 months ago (2016-07-14 01:06:51 UTC) #3
Dirk Pranke
lgtm. There are some somewhat-subtle changes in the logic here, and it's been a long ...
4 years, 5 months ago (2016-07-14 19:52:23 UTC) #4
dtu
On 2016/07/14 19:52:23, Dirk Pranke wrote: > lgtm. > > There are some somewhat-subtle changes ...
4 years, 5 months ago (2016-07-14 21:15:36 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2148153002/1
4 years, 5 months ago (2016-07-14 21:15:49 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: Depot Tools Presubmit on master.tryserver.infra (JOB_FAILED, https://build.chromium.org/p/tryserver.infra/builders/Depot%20Tools%20Presubmit/builds/801)
4 years, 5 months ago (2016-07-14 21:18:20 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2148153002/20001
4 years, 5 months ago (2016-07-14 21:41:07 UTC) #12
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/tools/depot_tools/+/944b60530e30ff97179b273360c8d3fb4f8cea7a
4 years, 5 months ago (2016-07-14 21:48:25 UTC) #14
ncarter (slow)
This change may have caused a serious performance regression in owners checking. If you patch ...
4 years, 3 months ago (2016-08-30 21:46:19 UTC) #16
Dirk Pranke
4 years, 3 months ago (2016-08-31 04:47:54 UTC) #17
Message was sent while issue was closed.
On 2016/08/30 21:46:19, ncarter wrote:
> This change may have caused a serious performance regression in owners
checking.
> 
> If you patch in https://codereview.chromium.org/2248873002/ to a chromium
> checkout, and run 'git cl presubmit --upload', the checking owners step takes
> 71971 milliseconds. If I revert this change in my depot_tools, it only takes
144
> milliseconds.
> 
> load_data_needed_for() alone takes over 50 seconds; almost all of this time is
> spent in the _owners_for() function.
> 
> This seems unnecessary. Can we revert this change?

I don't think we should revert this change. It fixes real issues, and this is
the first
complaint I've heard about performance. 

I do take the complaint serious, though, of course, and we should fix it ASAP.

It looks like you posted a potential fix, so I'll take a look at that and we can
either
land that if it works, or I can figure out a different fix.

Powered by Google App Engine
This is Rietveld 408576698