summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Su <dysu@google.com>2020-06-25 17:54:14 -0700
committerDavid Su <dysu@google.com>2020-06-25 17:54:14 -0700
commit4f1d42fce0f82bdfc9e862b3de352fbc455171ab (patch)
treea36c687844548613e1b3444e1b878b7b4a17ce9f
parentdb04b29f0f6a96b19850fc17e23818855f800d61 (diff)
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
-rwxr-xr-xmetrics_pdd_hook.py9
1 files 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