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

Issue 2342973002: Teach bot_update to remove partially deleted git repos. (Closed)

Created:
4 years, 3 months ago by Vadim Sh.
Modified:
4 years, 3 months ago
CC:
chromium-reviews, dpranke+depot_tools_chromium.org, iannucci+depot_tools_chromium.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Teach bot_update to remove partially deleted git repos. Also add logging to 'remove', helps to debug issues with 'build.dead' filling up with crap. R=iannucci@chromium.org, hinoka@chromium.org BUG=647046 Committed: https://chromium.googlesource.com/chromium/tools/depot_tools/+/18ca30ca804679ee624a52e73017d234a8c0008f

Patch Set 1 #

Total comments: 8

Patch Set 2 : Teach bot_update to remove partially deleted git repos. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+15 lines, -4 lines) Patch
M recipe_modules/bot_update/resources/bot_update.py View 1 6 chunks +15 lines, -4 lines 0 comments Download

Messages

Total messages: 17 (8 generated)
Vadim Sh.
See the bug for more info. tl;dr cleanup_disk did a bad job of removing "old" ...
4 years, 3 months ago (2016-09-15 21:24:48 UTC) #1
martiniss
lgtm
4 years, 3 months ago (2016-09-15 21:41:51 UTC) #3
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/2342973002/1
4 years, 3 months ago (2016-09-15 21:43:00 UTC) #5
dnj
lgtm w/ comments https://codereview.chromium.org/2342973002/diff/1/recipe_modules/bot_update/resources/bot_update.py File recipe_modules/bot_update/resources/bot_update.py (right): https://codereview.chromium.org/2342973002/diff/1/recipe_modules/bot_update/resources/bot_update.py#newcode301 recipe_modules/bot_update/resources/bot_update.py:301: print 'Removing %s => %s' % ...
4 years, 3 months ago (2016-09-15 21:44:35 UTC) #7
tandrii(chromium)
lgtm https://codereview.chromium.org/2342973002/diff/1/recipe_modules/bot_update/resources/bot_update.py File recipe_modules/bot_update/resources/bot_update.py (right): https://codereview.chromium.org/2342973002/diff/1/recipe_modules/bot_update/resources/bot_update.py#newcode463 recipe_modules/bot_update/resources/bot_update.py:463: return not path.exists(os.path.join(repo_dir, '.git', 'config')) On 2016/09/15 21:44:34, ...
4 years, 3 months ago (2016-09-15 21:49:43 UTC) #10
Vadim Sh.
https://codereview.chromium.org/2342973002/diff/1/recipe_modules/bot_update/resources/bot_update.py File recipe_modules/bot_update/resources/bot_update.py (right): https://codereview.chromium.org/2342973002/diff/1/recipe_modules/bot_update/resources/bot_update.py#newcode301 recipe_modules/bot_update/resources/bot_update.py:301: print 'Removing %s => %s' % (target, dest) On ...
4 years, 3 months ago (2016-09-15 21:56:26 UTC) #11
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/2342973002/20001
4 years, 3 months ago (2016-09-15 21:56:50 UTC) #14
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://chromium.googlesource.com/chromium/tools/depot_tools/+/18ca30ca804679ee624a52e73017d234a8c0008f
4 years, 3 months ago (2016-09-15 22:00:07 UTC) #16
dnj
4 years, 3 months ago (2016-09-15 22:03:12 UTC) #17
Message was sent while issue was closed.
https://codereview.chromium.org/2342973002/diff/1/recipe_modules/bot_update/r...
File recipe_modules/bot_update/resources/bot_update.py (right):

https://codereview.chromium.org/2342973002/diff/1/recipe_modules/bot_update/r...
recipe_modules/bot_update/resources/bot_update.py:463: return not
path.exists(os.path.join(repo_dir, '.git', 'config'))
On 2016/09/15 21:56:26, Vadim Sh. wrote:
> On 2016/09/15 21:44:34, dnj wrote:
> > This is a good check. WDYT about adding something like:
> > 
> > ... or $("git -C <repo_dir> status").return_code != 0
> > 
> > This will actually let Git try and run in each directory, maybe detecting
> other
> > types of corruption.
> 
> I'm afraid running 'git', it can complicate life, e.g. it can discover parent
> '.git' (I've seen it doing that with some broken checkouts). And --git-dir is
> magic.

I think we could ensure this doesn't happen with:
git_dir = 
git(
    '--git-dir', os.path.join(repo_dir, '.git'),
    '--work-tree', repo_dir,
    'status')

> 
> I really don't like modifying this script beyond absolute minimum. Not unless
I
> can reliably verify my modification work, without breaking all bots in the
> process. And I can't. So I'll be modifying it in absolute minimum way.

Fair enough. It'd be nice if we had some way to actually canary this :/

Powered by Google App Engine
This is Rietveld 408576698