File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -373,6 +373,12 @@ def main() -> None:
373373 key_regexp = params .get (options .KEY_REGEXP , None ),
374374 branch_regexp = branch_regexp ,
375375 )
376+ if params [options .COMPONENT_TYPE ] == "portfolios" :
377+ components = []
378+ for comp in components_list :
379+ components += comp .components ()
380+ components_list = components
381+
376382 if len (components_list ) == 0 :
377383 br = f"and branch matching regexp '{ params [options .BRANCH_REGEXP ]} '" if options .BRANCH_REGEXP in params else ""
378384 raise exceptions .SonarException (
Original file line number Diff line number Diff line change @@ -32,12 +32,9 @@ def get_components(
3232 if component_type in ("apps" , "applications" ):
3333 components = [p for p in applications .get_list (endpoint ).values () if re .match (rf"^{ key_regexp } $" , p .key )]
3434 elif component_type == "portfolios" :
35- portfolio_list = [p for p in portfolios .get_list (endpoint ).values () if re .match (rf"^{ key_regexp } $" , p .key )]
35+ components = [p for p in portfolios .get_list (endpoint ).values () if re .match (rf"^{ key_regexp } $" , p .key )]
3636 if kwargs .get ("topLevelOnly" , False ):
37- portfolio_list = [p for p in portfolio_list if p .is_toplevel ()]
38- components = []
39- for comp in portfolio_list :
40- components += comp .components ()
37+ components = [p for p in components if p .is_toplevel ()]
4138 else :
4239 components = [p for p in projects .get_list (endpoint ).values () if re .match (rf"^{ key_regexp } $" , p .key )]
4340 if component_type != "portfolios" and branch_regexp :
You can’t perform that action at this time.
0 commit comments