Add pre-commit check for DEPS file hash length |
||
Issue descriptionWe need a pre-commit check to make sure that all git commit hashes in the DEPS file are full 40-character hashes. I accidentally caused a Canary Delivery Issue by committing a short hash: https://bugs.chromium.org/p/chromium/issues/detail?id=656493 I had log.abbrev_commit=true in my git config, which caused tools/roll_webgl_conformance.py to use a short hash instead of the full hash. This could be improved in the script but we also need to make sure that this can't make it through the CQ.
,
Oct 19 2016
I suggested kainino@ add andybons (who's heading up the team focused on immediate Infra needs of Chromium developers) and me. Thanks for picking this up though!
,
Oct 20 2016
> * Any presubmit check could only be a heuristic and a warning, because 'deadbeef' is both a reasonable short hash and a reasonable branch name, and we don't want to forbid setting branch names (the release buildspec templates would all fail). If the only way to implement this is with a general gclient check, then yes, it would be too strict, but I originally suggested using a presubmit because we were only talking about src/DEPS (and maybe src-internal/DEPS), which shouldn't be using either short refs or symbolic refs.
,
Oct 20 2016
Yep, and I'd be strongly in favor of having a src/PRESUBMIT check that could parse the DEPS file and yell, but from my quick survey of PRESUBMIT.py, presubmit_support.py, and gclient.py, doing so would be a highly non-trivial amount of work, and I judged it not worth it compared to the quick CL I was able to throw together above. If someone wants to dedicate a couple SWE days to adding this functionality to 'gclient verify' behind a flag, or teaching presubmit_support to parse DEPS files independently, then I wholeheartedly support that and will even do the code reviews! But in general I think this should be a P-3 infra issue at the very highest.
,
Oct 20 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2e9de0e8e7df6eedba8de5d2e29210b26d641266 commit 2e9de0e8e7df6eedba8de5d2e29210b26d641266 Author: agable <agable@chromium.org> Date: Thu Oct 20 01:03:18 2016 Don't let roll scripts use short hashes R=kainino@chromium.org BUG= 657642 Review-Url: https://chromiumcodereview.appspot.com/2431383003 Cr-Commit-Position: refs/heads/master@{#426359} [modify] https://crrev.com/2e9de0e8e7df6eedba8de5d2e29210b26d641266/tools/roll_angle.py [modify] https://crrev.com/2e9de0e8e7df6eedba8de5d2e29210b26d641266/tools/roll_webgl_conformance.py [modify] https://crrev.com/2e9de0e8e7df6eedba8de5d2e29210b26d641266/tools/roll_webrtc.py
,
Oct 20 2016
Because the above CL landed, I'm going to mark this as fixed. If someone really wants to work on adding an actual presubmit check, please re-open and unassign me as the owner :) |
||
►
Sign in to add a comment |
||
Comment 1 by aga...@chromium.org
, Oct 19 2016Status: Started (was: Untriaged)