Skip to content

Commit 2f87129

Browse files
committed
scripts: set_assignee.py: Support file groups
Deal with new section in the maintainer file defining file groups. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
1 parent a9fdb66 commit 2f87129

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

scripts/set_assignees.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def process_pr(gh, maintainer_file, number):
128128
# areas where assignment happens if only said areas are affected
129129
meta_areas = ['Release Notes', 'Documentation', 'Samples', 'Tests']
130130

131+
collab_per_path = []
131132
for changed_file in fn:
132133
num_files += 1
133134
log(f"file: {changed_file.filename}")
@@ -139,11 +140,14 @@ def process_pr(gh, maintainer_file, number):
139140
continue
140141
parsed_areas = process_manifest(old_manifest_file=args.updated_manifest)
141142
for _area in parsed_areas:
143+
collab_per_path.extend(_area.get_collaborators_for_path(changed_file.filename))
142144
area_match = maintainer_file.name2areas(_area)
143145
if area_match:
144146
areas.extend(area_match)
145147
else:
146148
areas = maintainer_file.path2areas(changed_file.filename)
149+
for _area in areas:
150+
collab_per_path.extend(_area.get_collaborators_for_path(changed_file.filename))
147151

148152
log(f"areas for {changed_file}: {areas}")
149153

@@ -173,6 +177,9 @@ def process_pr(gh, maintainer_file, number):
173177
if 'Platform' in area.name:
174178
is_instance = True
175179

180+
for _area in sorted_areas:
181+
collab_per_path.extend(_area.get_collaborators_for_path(changed_file.filename))
182+
176183
area_counter = dict(sorted(area_counter.items(), key=lambda item: item[1], reverse=True))
177184
log(f"Area matches: {area_counter}")
178185
log(f"labels: {labels}")
@@ -182,6 +189,8 @@ def process_pr(gh, maintainer_file, number):
182189
for area in area_counter:
183190
collab += maintainer_file.areas[area.name].maintainers
184191
collab += maintainer_file.areas[area.name].collaborators
192+
collab += collab_per_path
193+
185194
collab = list(dict.fromkeys(collab))
186195
log(f"collab: {collab}")
187196

0 commit comments

Comments
 (0)