@@ -57,6 +57,9 @@ def parse_args():
57
57
parser .add_argument ("-c" , "--commits" , default = None ,
58
58
help = "Commit range in the form: a..b" )
59
59
60
+ parser .add_argument ("-m" , "--manifest" , action = "store_true" , default = False ,
61
+ help = "Dump manifest changes" )
62
+
60
63
parser .add_argument ("-v" , "--verbose" , action = "count" , default = 0 ,
61
64
help = "Verbose Output" )
62
65
@@ -94,6 +97,28 @@ def process_manifest():
94
97
log (f'manifest areas: { areas } ' )
95
98
return areas
96
99
100
+
101
+ def dump_manifest_changes (gh , maintainer_file , pr ):
102
+ gh_repo = gh .get_repo (f"{ args .org } /{ args .repo } " )
103
+ pr = gh_repo .get_pull (number )
104
+ fn = list (pr .get_files ())
105
+ areas = set ()
106
+ for changed_file in fn :
107
+ log (f"file: { changed_file .filename } " )
108
+
109
+ if changed_file .filename in ['west.yml' ,'submanifests/optional.yaml' ]:
110
+ changed_areas = process_manifest ()
111
+ for _area in changed_areas :
112
+ area_match = maintainer_file .name2areas (_area )
113
+ if area_match :
114
+ areas .extend (area_match )
115
+
116
+ log (f"Areas: { areas } " )
117
+ # now dump the list of areas into a json file
118
+ import json
119
+ with open ("manifest_areas.json" , "w" ) as f :
120
+ json .dump ([area .name for area in areas ], f , indent = 4 )
121
+
97
122
def process_pr (gh , maintainer_file , number ):
98
123
99
124
gh_repo = gh .get_repo (f"{ args .org } /{ args .repo } " )
@@ -402,7 +427,9 @@ def main():
402
427
gh = Github (token )
403
428
maintainer_file = Maintainers (args .maintainer_file )
404
429
405
- if args .pull_request :
430
+ if args .pull_request and args .manifest :
431
+ dump_manifest_changes (gh , maintainer_file )
432
+ elif args .pull_request :
406
433
process_pr (gh , maintainer_file , args .pull_request )
407
434
elif args .issue :
408
435
process_issue (gh , maintainer_file , args .issue )
0 commit comments