@@ -606,18 +606,16 @@ def convert_app_json(old_app_json: dict[str, Any]) -> dict[str, Any]:
606606 new_json = common_json_helper .convert_common_fields (old_app_json .copy ())
607607 if "branches" not in new_json :
608608 return new_json
609- log .info ("CONVERT %s" , util .json_dump (new_json ["branches" ]))
610609 for br , data in new_json ["branches" ].items ():
611- log .info ("CONVERT PROJS %s" , util .json_dump (new_json ["branches" ][br ].get ("projects" , {})))
612610 if "projects" not in data :
613611 continue
612+ new_json ["branches" ][br ] = util .order_dict (data , ["name" , "isMain" , "projects" ])
614613 new_json ["branches" ][br ]["projects" ] = util .dict_to_list (new_json ["branches" ][br ]["projects" ], "key" , "branch" )
615614 for proj_data in new_json ["branches" ][br ]["projects" ]:
616615 if proj_data .get ("branch" , None ) in ("__default__" , c .DEFAULT_BRANCH ):
617616 proj_data .pop ("branch" )
618- new_json ["branches" ] = util .dict_to_list (new_json ["branches" ], "name" )
619- log .info ("RETURN %s" , util .json_dump (new_json ))
620- return new_json
617+ new_json ["branches" ] = util .sort_list_by_key (util .dict_to_list (new_json ["branches" ], "name" ), "name" , "isMain" )
618+ return util .order_dict (new_json , ["key" , "name" , "visibility" , "tags" , "branches" , "permissions" ])
621619
622620
623621def convert_apps_json (old_json : dict [str , Any ]) -> dict [str , Any ]:
0 commit comments