New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 844412 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Task



Sign in to add a comment

PRESUBMIT for policy_templates.json "convenience" editing number

Project Member Reported by pmarko@chromium.org, May 18 2018

Issue description

Add a check in syntax_check_policy_template_json.py which is run from components/policy/resources/PRESUBMIT.py to check that the number mentioned in the line
"For your editing convenience: highest ID currently used:"
is indeed the highest ID currently used.
 
Crazy idea - put the max policy number in a proper field of the dictionary e.g. 'next_available_id' and refer it in the comment by name. Then it will be trivial to check it and find it if it is say at the bottom of the file.

Comment 2 by emaxx@chromium.org, May 29 2018

Cc: emaxx@chromium.org
+1 for doing something in this area - it just happened again that the constant was forgotten to be bumped.

I'm fine with either of approaches (either grep for the comment marker, or introduce a JSON field). Perhaps grepping is faster to implement; although it's not the cleanest indeed.
Project Member

Comment 3 by bugdroid1@chromium.org, Jun 4 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/07019d1fd5d07d6b97413fdf58c409757bf62be5

commit 07019d1fd5d07d6b97413fdf58c409757bf62be5
Author: Pavol Marko <pmarko@chromium.org>
Date: Mon Jun 04 06:41:42 2018

Move highest policy id into constant and ensure its correctness in PRESUBMIT

Example error message:
Error: 'highest_id_currently_used' must be set to the highest policy id
in use, which is currently 451 (vs 450).

Bug:  844412 
Test: ran git cl presubmit
Change-Id: I75dfb8bbbec8d0a39ed579760e3f3a5390ed88e9
Reviewed-on: https://chromium-review.googlesource.com/1078311
Commit-Queue: Pavol Marko <pmarko@chromium.org>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Reviewed-by: Lutz Justen <ljusten@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#564006}
[modify] https://crrev.com/07019d1fd5d07d6b97413fdf58c409757bf62be5/components/policy/resources/policy_templates.json
[modify] https://crrev.com/07019d1fd5d07d6b97413fdf58c409757bf62be5/components/policy/tools/syntax_check_policy_template_json.py

Status: Fixed (was: Assigned)

Sign in to add a comment