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

Issue 2841823007: Fix presubmit_scheme_histograms.py and presubmit_bad_message_reasons.py (Closed)

Created:
3 years, 7 months ago by Łukasz Anforowicz
Modified:
3 years, 7 months ago
CC:
chromium-reviews, blink-reviews, jam, blink-reviews-frames_chromium.org, darin-cc_chromium.org, asvitkine+watch_chromium.org, lunalu
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix presubmit_scheme_histograms.py and presubmit_bad_message_reasons.py This CL fixes presubmit_scheme_histograms.py and presubmit_bad_message_reasons.py which after r462591 would always report presubmit errors (because it started returning a tuple from HistogramNeedsUpdate which always coerces to True in the broken presubmit scripts). After r462591 HistogramNeedsUpdate effectively checks all histogram-enum-related presubmits (both for updating histograms.xml and for detecting duplicate values). Therefore the current CL renames this function to CheckPresubmitErrors and makes it return a presubmit error (rather than a tuple of (needs_updating, duplicates)). This refactoring has a nice side benefit - after this CL, all presubmits going through CheckPresubmitErrors will check for duplicate values (r462591 only added this check for UseCounter histograms). This CL also tweaks content/browser/PRESUBMIT.py so that it applies *both* to upload-time and commit-time checks (without this change |git cl presubmit| would not hit the checks related to content/browser/bad_message.h - they would only be hit when running |git cl presubmit --upload|). Manual testing done: - Make changes in content/browser/bad_message.h, chrome/browser/extensions/chrome_content_browser_client_extensions_part.cc, third_party/WebKit/Source/code/frame - Run git cl presubmit and verify that the presubmit checks detect 1) duplicates and 2) the need to update histograms.xml BUG=577772 TEST=See "Manual testing done" above. TBR=sky@chromium.org, jochen@chromium.org, rdevlin.cronin@chromium.org Review-Url: https://codereview.chromium.org/2841823007 Cr-Commit-Position: refs/heads/master@{#468003} Committed: https://chromium.googlesource.com/chromium/src/+/14d9a1a8cade0d1b9878c4bda0bbc8417914893f

Patch Set 1 #

Patch Set 2 : Self-review... ooops... #

Total comments: 6

Patch Set 3 : Fixed typos / nits in comments and error strings. #

Total comments: 2

Patch Set 4 : Fix an old typo in _RunHistogramChecks. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+53 lines, -41 lines) Patch
M chrome/browser/PRESUBMIT.py View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M components/nacl/browser/PRESUBMIT.py View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M components/password_manager/content/browser/PRESUBMIT.py View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M content/browser/PRESUBMIT.py View 1 2 3 2 chunks +8 lines, -2 lines 0 comments Download
M extensions/browser/PRESUBMIT.py View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/frame/PRESUBMIT.py View 1 chunk +5 lines, -13 lines 0 comments Download
M tools/metrics/histograms/presubmit_bad_message_reasons.py View 1 chunk +6 lines, -6 lines 0 comments Download
M tools/metrics/histograms/presubmit_scheme_histograms.py View 1 chunk +6 lines, -7 lines 0 comments Download
M tools/metrics/histograms/update_histogram_enum.py View 1 2 2 chunks +24 lines, -9 lines 0 comments Download

Messages

Total messages: 30 (15 generated)
Łukasz Anforowicz
isherman@, could you PTAL? https://codereview.chromium.org/2841823007/diff/20001/content/browser/PRESUBMIT.py File content/browser/PRESUBMIT.py (right): https://codereview.chromium.org/2841823007/diff/20001/content/browser/PRESUBMIT.py#newcode14 content/browser/PRESUBMIT.py:14: I don't understand why we ...
3 years, 7 months ago (2017-04-26 22:20:54 UTC) #4
Ilya Sherman
Thanks! It seems that we need better testing of this system somehow, given the number ...
3 years, 7 months ago (2017-04-26 23:19:08 UTC) #6
Łukasz Anforowicz
On 2017/04/26 23:19:08, Ilya Sherman wrote: > Thanks! It seems that we need better testing ...
3 years, 7 months ago (2017-04-27 02:34:46 UTC) #7
Łukasz Anforowicz
On 2017/04/27 02:34:46, Łukasz A. wrote: > On 2017/04/26 23:19:08, Ilya Sherman wrote: > > ...
3 years, 7 months ago (2017-04-27 16:42:40 UTC) #8
Łukasz Anforowicz
On 2017/04/27 16:42:40, Łukasz A. wrote: > On 2017/04/27 02:34:46, Łukasz A. wrote: > > ...
3 years, 7 months ago (2017-04-27 16:44:15 UTC) #9
Ilya Sherman
Okay, I've looked through the files in detail now. The changes look great -- thanks ...
3 years, 7 months ago (2017-04-27 22:28:09 UTC) #10
Łukasz Anforowicz
Thanks! I'll push to CQ in a minute. https://codereview.chromium.org/2841823007/diff/20001/tools/metrics/histograms/update_histogram_enum.py File tools/metrics/histograms/update_histogram_enum.py (right): https://codereview.chromium.org/2841823007/diff/20001/tools/metrics/histograms/update_histogram_enum.py#newcode202 tools/metrics/histograms/update_histogram_enum.py:202: A ...
3 years, 7 months ago (2017-04-27 22:35:41 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/2841823007/40001
3 years, 7 months ago (2017-04-27 22:36:43 UTC) #14
Łukasz Anforowicz
+nick@ for content/browser/PRESUBMIT.py +bokan@ for third_party/WebKit/Source/core/frame/PRESUBMIT.py
3 years, 7 months ago (2017-04-27 23:27:58 UTC) #16
ncarter (slow)
lgtm
3 years, 7 months ago (2017-04-27 23:34:25 UTC) #17
ncarter (slow)
https://codereview.chromium.org/2841823007/diff/40001/content/browser/PRESUBMIT.py File content/browser/PRESUBMIT.py (right): https://codereview.chromium.org/2841823007/diff/40001/content/browser/PRESUBMIT.py#newcode17 content/browser/PRESUBMIT.py:17: # Setup sys.path so that we can call histrogram ...
3 years, 7 months ago (2017-04-27 23:35:52 UTC) #18
Łukasz Anforowicz
+sky@chromium.org, jochen@chromium.org, rdevlin.cronin@chromium.org - FYI, I am TBR-ing fixing of a small typo in a ...
3 years, 7 months ago (2017-04-27 23:59:04 UTC) #23
bokan
Source/core lgtm
3 years, 7 months ago (2017-04-28 12:49:51 UTC) #24
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/2841823007/100001
3 years, 7 months ago (2017-04-28 14:10:59 UTC) #27
commit-bot: I haz the power
3 years, 7 months ago (2017-04-28 15:24:12 UTC) #30
Message was sent while issue was closed.
Committed patchset #4 (id:100001) as
https://chromium.googlesource.com/chromium/src/+/14d9a1a8cade0d1b9878c4bda0bb...

Powered by Google App Engine
This is Rietveld 408576698