Merge branches of the same release tree into the same row

This commit is contained in:
Jack Grigg 2024-11-01 18:44:13 +13:00
parent ffe262ff3d
commit fc99f7418e
1 changed files with 12 additions and 3 deletions

View File

@ -3,6 +3,7 @@
import networkx as nx import networkx as nx
from str2bool import str2bool as strtobool from str2bool import str2bool as strtobool
import itertools
import os import os
import re import re
from textwrap import wrap from textwrap import wrap
@ -41,9 +42,17 @@ def build_release_matrix_from(dg, issue, repo_id):
acc = [] acc = []
for child in dg.neighbors(issue): for child in dg.neighbors(issue):
if child.repo_id == repo_id and 'C-release' in child.labels: if child.repo_id == repo_id and 'C-release' in child.labels:
child_releases = [] # Fetch the rows that each child's downstreams need rendered.
for dep_repo in RELEASE_MATRIX.get(repo_id): child_deps = [
child_releases.extend(build_release_matrix_from(dg, child, dep_repo)) build_release_matrix_from(dg, child, dep_repo)
for dep_repo in RELEASE_MATRIX.get(repo_id)
]
# Merge the rows from each downstream repo together.
child_releases = [
{k: v for d in prod for k, v in d.items()}
for prod in itertools.product(*child_deps)
]
if len(child_releases) > 0: if len(child_releases) > 0:
for rec in child_releases: for rec in child_releases: