From 0c6e2269b53b86cb89efac472dc47e25fa261fac Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Mon, 27 Apr 2026 16:08:56 -0400 Subject: [PATCH] script/ptl-tool: source githumap from main branch To make it authoritative. Signed-off-by: Patrick Donnelly --- src/script/ptl-tool.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/script/ptl-tool.py b/src/script/ptl-tool.py index 4848190f12b5..f729247402fd 100755 --- a/src/script/ptl-tool.py +++ b/src/script/ptl-tool.py @@ -237,14 +237,6 @@ while not os.path.exists(git_dir + '/.git'): CONTRIBUTORS = {} NEW_CONTRIBUTORS = {} -with open(git_dir + "/.githubmap", mode='r', encoding='utf-8') as f: - comment = re.compile(r"\s*#") - patt = re.compile(r"([\w-]+)\s+(.*)") - for line in f: - if comment.match(line): - continue - m = patt.match(line) - CONTRIBUTORS[m.group(1)] = m.group(2) BZ_MATCH = re.compile("(.*https?://bugzilla.redhat.com/.*)") TRACKER_MATCH = re.compile("(.*https?://tracker.ceph.com/.*)") @@ -363,6 +355,21 @@ def build_branch(args): G = git.Repo(args.git) + try: + log.info("Fetching .githubmap from %s main branch", BASE_REMOTE_URL) + G.git.fetch(BASE_REMOTE_URL, "main") + githubmap_content = G.git.show("FETCH_HEAD:.githubmap") + comment = re.compile(r"\s*#") + patt = re.compile(r"([\w-]+)\s+(.*)") + for line in githubmap_content.splitlines(): + if comment.match(line): + continue + m = patt.match(line) + if m: + CONTRIBUTORS[m.group(1)] = m.group(2) + except git.exc.GitCommandError as e: + raise SystemExit(f"Could not fetch .githubmap from {BASE_REMOTE_URL}:main:\n{e}") + if args.create_qa or args.update_qa: log.info("connecting to %s", REDMINE_ENDPOINT) R = Redmine(REDMINE_ENDPOINT, username=REDMINE_USER, key=REDMINE_API_KEY) -- 2.47.3