Commit bd6f8d97 authored by Roberto Carrillo's avatar Roberto Carrillo Committed by Commit Bot

[OWNERS Tags] Validate OS tag correctly.

When validating a modified OWNERS file, make sure that the OS is taken
into account when checking that there is only one team per component/os
combination.

R=cmasso,sergiyb
BUG=750937

Change-Id: Ic0a7a2ab226e0e3232a7aae134b1458be6b334e1
Reviewed-on: https://chromium-review.googlesource.com/594876Reviewed-by: default avatarShuotao Gao <stgao@chromium.org>
Commit-Queue: Roberto Carrillo <robertocn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491589}
parent f224ed39
...@@ -75,6 +75,10 @@ def validate_mappings(options, args): ...@@ -75,6 +75,10 @@ def validate_mappings(options, args):
for dir_name, tags in current_mappings.iteritems(): for dir_name, tags in current_mappings.iteritems():
team = tags.get('team') team = tags.get('team')
component = tags.get('component') component = tags.get('component')
os_tag = tags.get('os')
if os_tag:
component = '%s(%s)' % (component, os)
if component: if component:
new_dir_to_component[dir_name] = component new_dir_to_component[dir_name] = component
if team: if team:
...@@ -92,7 +96,7 @@ def validate_mappings(options, args): ...@@ -92,7 +96,7 @@ def validate_mappings(options, args):
team_details = [] team_details = []
for team in teams: for team in teams:
offending_dirs = [d for d in team_to_dir[team] offending_dirs = [d for d in team_to_dir[team]
if new_dir_to_component[d] == component] if new_dir_to_component.get(d) == component]
team_details.append('%(team)s is used in %(paths)s' % { team_details.append('%(team)s is used in %(paths)s' % {
'team': team, 'team': team,
'paths': ', '.join(offending_dirs), 'paths': ', '.join(offending_dirs),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment