0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-24 00:17:37 +01:00
mongodb/buildscripts/util/generate_co_jira_map.py
Zac 458bc96f8a SERVER-95738 Fix Headers (#28504)
GitOrigin-RevId: e9fdcd09c9d513c07cc69ddc316eef2f63a746e7
2024-11-08 22:48:46 +00:00

20 lines
630 B
Python

import glob
import yaml
if __name__ == "__main__":
approvers = set()
owners_paths = glob.glob("**/OWNERS.yml", recursive=True)
print(len(owners_paths))
for path in owners_paths:
with open(path, "r") as owner_file:
contents = yaml.safe_load(owner_file)
if "filters" not in contents:
continue
for file_filter in contents["filters"]:
assert "approvers" in file_filter
approvers.update(set(file_filter["approvers"]))
f = open("co_jira_map.yml", "w+")
yaml.dump({approver: "jira_team" for approver in approvers}, f)