Commit c7e18033 authored by Boris Baldassari's avatar Boris Baldassari
Browse files

Merge branch 'dev' into 'main'

#24 Fix wrong links in website errors page.

See merge request !9
parents 67bd9f0f 1433abdb
......@@ -331,6 +331,12 @@ projects = {}
#files = tree[dir_results]["files"]
re_runs_pattern = re.compile("^(?P<project>.+)_(?P<repo>.+)_(?P<time>\d+)\.log$")
# Initialise counting vars
nb_projs = 0
nb_repos = 0
nb_runs = 0
for dir in tree:
files = tree[dir]["files"]
for f in sorted(files):
......@@ -347,8 +353,10 @@ for dir in tree:
if dir_run in tree:
if project not in projects:
projects[project] = {}
nb_projs += 1
if repo not in projects[project]:
projects[project][repo] = []
nb_repos += 1
#status[project] = {}
run = {}
# run = {
......@@ -378,6 +386,7 @@ for dir in tree:
if "bom.spdx.yml" in run["files"]:
run["status"] = "Success: Published"
projects[project][repo].append(run)
nb_runs += 1
#else:
#print(f"No match for {f}.")
......@@ -387,6 +396,8 @@ for dir in tree:
# Publish analysis
########################
print(f"Statistics: found {nb_projs} projects, {nb_repos} repositories, {nb_runs} runs.")
if dir_output:
publish_analysis(dir_pub=dir_output, projects=projects)
......@@ -434,7 +445,7 @@ for rule in errors.keys():
for v in error:
date_path = datetime.strftime(v['run'], "%Y%m%d%H%M")
# content.append(f"- {v}\n")
content.append(f"- [{v['project']} - {v['repo']}](/projects/{v['project']}) - [{v['run']}](/runs/v['repo']_{v['project']}_{date_path}) - {v['pkg']} - {v['license']}\n")
content.append(f"- [{v['project']} - {v['repo']}](/projects/{v['project']}) - [{v['run']}](/runs/{v['project']}_{v['repo']}_{date_path}) - {v['pkg']} - {v['license']}\n")
# Create errors directory if it doesn't exist.
dir_error = os.path.join(dir_output, "errors", rule)
try:
......@@ -448,3 +459,4 @@ for rule in errors.keys():
print("# Extraction finished.")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment