From 25065ec9997bbbc2c7b7d3e7afc8ea779ac3793e Mon Sep 17 00:00:00 2001 From: Sam Wu <22262939+samjwu@users.noreply.github.com> Date: Thu, 25 Apr 2024 09:48:37 -0600 Subject: [PATCH] Skip and log missing branches for release_data.py --- tools/autotag/util/release_data.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/autotag/util/release_data.py b/tools/autotag/util/release_data.py index d82cbb533..1ad94ab06 100755 --- a/tools/autotag/util/release_data.py +++ b/tools/autotag/util/release_data.py @@ -4,6 +4,7 @@ from dataclasses import dataclass, field import os import re import shutil +import sys from typing import Optional, Union, Dict, List, Tuple from github import Github, UnknownObjectException from github.Repository import Repository @@ -352,6 +353,8 @@ class ReleaseBundleFactory: """Create a release bundle of libraries.""" tag_name = f"rocm-{version}" libraries = { } + + missing_branches = [] print(f"\nLibraries for rocm-{version}:") for name, remote in names_and_remotes: @@ -365,7 +368,13 @@ class ReleaseBundleFactory: continue print(f" Defaulting to branch: {self.branch}") - commit = repo.get_branch(self.branch).commit.sha + try: + repo_branch = repo.get_branch(self.branch) + commit = repo_branch.commit.sha + except Exception: + print(f" - Could not find branch : {self.branch}") + missing_branches.append(f"{self.branch} for {name}") + continue libraries[name] = ReleaseLib( name=name, @@ -381,6 +390,9 @@ class ReleaseBundleFactory: libraries=libraries ) + for missing in missing_branches: + print(f"Could not find the following branch: {missing}") + return data def create_data_dict(