• Bruce Dawson's avatar
    Optimize presubmit --all with --no_diffs option · 09c0c073
    Bruce Dawson authored
    Some of the expensive checks when running presubmit --all, such as
    CheckStableMojomChanges (~300 s) and CheckAddedDepsHaveTargetApprovals
    (~200 s) only look at diffs and are therefore guaranteed to be NOPs when
    running presubmit --all or --files=. Passing along the no_diffs state
    lets these expensive checks be skipped, thus allowing for faster
    iteration times.
    
    Initial testing suggests that (with some supporting changes in the
    Chromium repo) this reduces "presubmit --all" times by about ten
    minutes, or a bit more than 10%, and additional improvements may be
    possible.
    
    Special handling for the no-diffs case also offers a simple way to avoid
    presubmit failures that happen whenever all files are flagged as being
    changed.
    
    Finally, and perhaps most importantly for having a presubmit --all bot,
    when --no_diffs is passed we can treat errors like "Issue wasn't
    uploaded" and "Add a description to the CL" as messages, thus making it
    possible to have zero presubmit errors when run on origin/main.
    
    Bug: 1320937, 1322936
    Change-Id: I0d09dd4aae8fdaa48c8b2f89337441cf96dcff72
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3628368
    Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
    Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
    09c0c073
git_cl_test.py 157 KB