From 5b526e5175621fc8ea0be69a6a81646804e23ab4 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 19 Nov 2024 14:11:31 +1300 Subject: [PATCH 1/2] Show tracked issues without assigned releases in the Zashi pipeline --- zashi-pipeline.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/zashi-pipeline.py b/zashi-pipeline.py index a6ba116e..ad110db4 100644 --- a/zashi-pipeline.py +++ b/zashi-pipeline.py @@ -263,8 +263,11 @@ def main(): for issue in tracked_issues.values(): rows = [ReleasePipeline(row) for row in build_release_matrix_from(dg, issue, RUST)] + + # If we traversed the entire graph and there are no releases downstream of the + # issue, show this as an empty row. if len(rows) == 0: - continue + rows = [ReleasePipeline({})] # Deduplicate rows rows = list(dict.fromkeys(rows)) From c93ce9d58eae46af8e6518ce02676f93e0f1a444 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Tue, 19 Nov 2024 14:45:08 +1300 Subject: [PATCH 2/2] Enable more than one repo within a single Zashi pipeline column --- helpers/repos.py | 3 ++- zashi-pipeline.py | 54 +++++++++++++++++++++++++++-------------------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/helpers/repos.py b/helpers/repos.py index ce3c547b..494f147e 100644 --- a/helpers/repos.py +++ b/helpers/repos.py @@ -23,6 +23,7 @@ class Repo(object): # To get the GitHub ID of a repo, see . +ZIP32 = Repo(('zcash', 'zip32'), 141066493, 'Z2lkOi8vcmFwdG9yL1JlcG9zaXRvcnkvMTMzOTY2MzAy') LIBRUSTZCASH = Repo(('zcash', 'librustzcash'), 85334928, 'Z2lkOi8vcmFwdG9yL1JlcG9zaXRvcnkvMTg5MDU1NTE') ZCASH_ANDROID_WALLET_SDK = Repo(('Electric-Coin-Company', 'zcash-android-wallet-sdk'), 151763639, 'Z2lkOi8vcmFwdG9yL1JlcG9zaXRvcnkvMTg5MDI4MjE') ZCASH_LIGHT_CLIENT_FFI = Repo(('Electric-Coin-Company', 'zcash-light-client-ffi'), 439137887, 'Z2lkOi8vcmFwdG9yL1JlcG9zaXRvcnkvMTMzMTMwNjcy') @@ -43,7 +44,7 @@ CORE_REPOS = [ Repo(('zcash', 'zcash-test-vectors'), 133857578, 'Z2lkOi8vcmFwdG9yL1JlcG9zaXRvcnkvMTMyOTMxNTEx'), Repo(('zcash', 'sapling-crypto'), 111058300, 'Z2lkOi8vcmFwdG9yL1JlcG9zaXRvcnkvMTMzOTY3ODY4'), Repo(('zcash', 'orchard'), 305835578, 'Z2lkOi8vcmFwdG9yL1JlcG9zaXRvcnkvMTMyODU2MzA2'), - Repo(('zcash', 'zip32'), 141066493, 'Z2lkOi8vcmFwdG9yL1JlcG9zaXRvcnkvMTMzOTY2MzAy'), + ZIP32, ] + HALO2_REPOS TFL_REPOS = [ diff --git a/zashi-pipeline.py b/zashi-pipeline.py index ad110db4..91e9afda 100644 --- a/zashi-pipeline.py +++ b/zashi-pipeline.py @@ -14,12 +14,17 @@ from helpers import github, repos as repositories, zenhub GITHUB_TOKEN = os.environ.get('GITHUB_TOKEN') ZENHUB_TOKEN = os.environ.get('ZENHUB_TOKEN') -# IDs of repos we look for releases in. -RUST = 85334928 -ANDROID_SDK = 151763639 -SWIFT_SDK = 185480114 -ZASHI_ANDROID = 390808594 -ZASHI_IOS = 387551125 +# Repository groups we look for releases in. Each of these groups corresponds to +# a column in the pipeline table; in some cases the releases for that column may +# be spread across several repositories. +RUST = ( + repositories.LIBRUSTZCASH, + repositories.ZIP32, +) +ANDROID_SDK = (repositories.ZCASH_ANDROID_WALLET_SDK,) +SWIFT_SDK = (repositories.ZCASH_SWIFT_WALLET_SDK,) +ZASHI_ANDROID = (repositories.ZASHI_ANDROID,) +ZASHI_IOS = (repositories.ZASHI_IOS,) REPOS = github.CORE_REPOS + github.WALLET_REPOS @@ -33,14 +38,17 @@ RELEASE_MATRIX = { class Release: - def __init__(self, repo_id, child): - self.repo_id = repo_id + def __init__(self, repo_group, child): + self.repo_group = repo_group # Extract version number from title - if repo_id == RUST: - self.version = re.search(r'zcash_[^ ]+ \d+(\.\d+)+', child.title).group() - self.version_ints = tuple(int(x) for x in self.version.split(' ')[1].split('.')) - else: + self.version = None + if repo_group == RUST: + version = re.search(r'zcash_[^ ]+ \d+(\.\d+)+', child.title) + if version: + self.version = version.group() + self.version_ints = tuple(int(x) for x in self.version.split(' ')[1].split('.')) + if self.version is None: self.version = re.search(r'\d+(\.\d+)+', child.title).group() self.version_ints = tuple(int(x) for x in self.version.split('.')) @@ -51,21 +59,21 @@ class Release: return self.version def __eq__(self, other): - return (self.repo_id, self.version) == (other.repo_id, other.version) + return (self.repo_group, self.version) == (other.repo_group, other.version) def __hash__(self): - return hash((self.repo_id, self.version)) + return hash((self.repo_group, self.version)) def __lt__(self, other): return self.version_ints < other.version_ints -def build_release(row, repo_id): - child = row.get(repo_id) +def build_release(row, repo_group): + child = row.get(repo_group) if child is None: return None else: - return Release(repo_id, child) + return Release(repo_group, child) class ReleasePipeline: @@ -97,14 +105,14 @@ class ReleasePipeline: self.zashi_ios, ) -def build_release_matrix_from(dg, issue, repo_id): +def build_release_matrix_from(dg, issue, repo_group): acc = [] for child in dg.neighbors(issue): - if child.repo.gh_id == repo_id and 'C-release' in child.labels: + if child.repo in repo_group and 'C-release' in child.labels: # Fetch the rows that each child's downstreams need rendered. child_deps = [ build_release_matrix_from(dg, child, dep_repo) - for dep_repo in RELEASE_MATRIX.get(repo_id) + for dep_repo in RELEASE_MATRIX.get(repo_group) ] # Merge the rows from each downstream repo together. @@ -115,13 +123,13 @@ def build_release_matrix_from(dg, issue, repo_id): if len(child_releases) > 0: for rec in child_releases: - rec[repo_id] = child + rec[repo_group] = child else: - child_releases = [{repo_id: child}] + child_releases = [{repo_group: child}] acc.extend(child_releases) else: - acc.extend(build_release_matrix_from(dg, child, repo_id)) + acc.extend(build_release_matrix_from(dg, child, repo_group)) return acc