Skip to content

Commit 3d3e8c2

Browse files
committed
add repo label to org libyear graph
Signed-off-by: Isaac Milarsky <[email protected]>
1 parent ad9ce01 commit 3d3e8c2

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

scripts/gen_graphs.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,12 +317,20 @@ def parse_libyear_list(dependency_list):
317317
#print(dep)
318318
if dep[-2] >= 0:
319319
date = datetime.datetime.strptime(dep[-1], '%Y-%m-%dT%H:%M:%S.%f')
320+
321+
dep_dict = {
322+
"dep_name": dep[-3],
323+
"libyear_value": dep[-2],
324+
"libyear_date_last_updated": date
325+
}
326+
327+
if len(dep) > 3:
328+
dep_dict['repo_name'] = dep[0]
329+
else:
330+
dep_dict['repo_name'] = ''
331+
320332
to_return.append(
321-
{
322-
"dep_name": dep[-3],
323-
"libyear_value": dep[-2],
324-
"libyear_date_last_updated": date
325-
}
333+
dep_dict
326334
)
327335

328336
#return list sorted by date
@@ -362,7 +370,10 @@ def generate_libyears_graph(oss_entity):
362370
#We are going to treat the y-axis as having one dep per level in the graph
363371
elevation = 0
364372
for dep in dep_list:
365-
dateline.add(dep["dep_name"], [
373+
374+
label = f"{dep["dep_name"]}/{dep["repo_name"]}"
375+
376+
dateline.add(label, [
366377
(timedelta(), elevation),
367378
(timedelta(days=dep["libyear_value"] * 365), elevation),
368379
])

0 commit comments

Comments
 (0)