From 4f1d42fce0f82bdfc9e862b3de352fbc455171ab Mon Sep 17 00:00:00 2001 From: David Su Date: Thu, 25 Jun 2020 17:54:14 -0700 Subject: metrics_pdd_hook: allow committer to specify reason if PDD does not need to be updated e.g. if metrics.proto was merely reformatted, or only comments were changed. Bug: 140895523 Test: create test CL that changes metrics.proto Change-Id: Ia0430d2870097c5d8a4d53c57f853ffb184b41b3 --- metrics_pdd_hook.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/metrics_pdd_hook.py b/metrics_pdd_hook.py index 093f2cdf2..fa858553a 100755 --- a/metrics_pdd_hook.py +++ b/metrics_pdd_hook.py @@ -38,7 +38,7 @@ def is_in_aosp(): def is_commit_msg_valid(commit_msg): for line in commit_msg.splitlines(): line = line.strip().lower() - if line.startswith('updated-pdd') and 'true' in line: + if line.startswith('updated-pdd'): return True return False @@ -65,11 +65,16 @@ def main(): return 0 print('This commit has changed {metrics_file}.'.format(metrics_file=metrics_file)) - print('Please update the Wifi Metrics Privacy Design Doc (PDD) at go/wifi-metrics-pdd') + print('If this change added/changed/removed metrics collected from the device,') + print('please update the Wifi Metrics Privacy Design Doc (PDD) at go/wifi-metrics-pdd') print('and acknowledge you have done so by adding this line to your commit message:') print() print('Updated-PDD: TRUE') print() + print('Otherwise, please explain why the PDD does not need to be updated:') + print() + print('Updated-PDD: Not applicable - reformatted file') + print() print('Please reach out to the OWNERS for more information about the Wifi Metrics PDD.') return 1 -- cgit v1.2.3