Skip to content

Commit 9d2fef2

Browse files
committed
link to full report
1 parent 21a3693 commit 9d2fef2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/rattlesnake/cicd/report_pytest.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ def get_report_html(
103103
timestamp_ext = extend_timestamp(timestamp)
104104
score_color: str = get_score_color(f"{10 * coverage_metric.coverage:.2f}") # scale
105105

106+
# Programmatically construct the full report URL
107+
try:
108+
owner, repo_name = github_repo.split('/')
109+
full_report_url = f"https://{owner}.github.io/{repo_name}/reports/coverage/htmlcov/index.html"
110+
except ValueError:
111+
# Fallback or default URL in case the repo format is unexpected
112+
full_report_url = "#"
113+
106114
html_content = f"""<!DOCTYPE html>
107115
<html lang="en">
108116
<head>
@@ -161,7 +169,7 @@ def get_report_html(
161169
<div><strong>Commit:</strong> <a href="https://github.com/{github_repo}/commit/{github_sha}"> {github_sha[:7]}</a></div>
162170
<div><strong>Repository:</strong> <a href="https://github.com/{github_repo}">{github_repo}</a></div>
163171
<div>&nbsp;</div>
164-
<div><strong>Full report:</strong> <a href="https://sandialabs.github.io/rattlesnake-vibration-controller/reports/coverage/htmlcov/index.html">HTML</a></div>
172+
<div><strong>Full report:</strong> <a href="{full_report_url}">HTML</a></div>
165173
</div>
166174
</div>
167175
</div>

0 commit comments

Comments
 (0)