Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ documentation set that downstream product distributions can build on.

Reference Integration workflow and health overview with links to
:doc:`Integration Process <integration_process/integration_process>` and
`Integration Status <https://eclipse-score.github.io/reference_integration/main/status_dashboard.html>`_.
`Integration Status <status_dashboard.html>`_.

.. grid-item-card:: 🧩 Modules
:link: modules/index
Expand All @@ -77,7 +77,7 @@ documentation set that downstream product distributions can build on.

Modules <modules/index>
Verification Reports <verification_report/index>
Integration Status <https://eclipse-score.github.io/reference_integration/main/status_dashboard.html>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep the link at the top bar as before

Integration Status <status_dashboard>
S-Core v1.0 <s_core_v_1/index>
Releases <s_core_v_1/releases/releases>
Integration Process <integration_process/integration_process>
Expand Down
2 changes: 1 addition & 1 deletion docs/integration_process/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -145,4 +145,4 @@ The consolidated outputs published by the integration. They are built by
- `docs/s_core_v_1/roadmap/overall_status.rst <https://github.com/eclipse-score/reference_integration/blob/main/docs/s_core_v_1/roadmap/overall_status.rst>`_
* - Integration status dashboard
- Live build/health overview of the integration.
- `status_dashboard.html <https://eclipse-score.github.io/reference_integration/main/status_dashboard.html>`_
- `status_dashboard.html <../status_dashboard.html>`_
18 changes: 18 additions & 0 deletions docs/status_dashboard.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
..
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

Integration Status
==================

The generated integration status dashboard is published at this location.
4 changes: 2 additions & 2 deletions scripts/tooling/cli/misc/assets/report_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ <h3 style="font-size:0.95rem; margin-bottom:0.4rem;">Requirements & Architecture
<div class="trace-links">
<ul style="padding-left:1.2rem; margin-top:0.25rem;">
<li><a href="https://eclipse-score.github.io/reference_integration" target="_blank" rel="noopener">Reference Integration Docs</a></li>
<li><a href="https://eclipse-score.github.io/score/main/" target="_blank" rel="noopener">S-CORE Project Documentation</a></li>
<li><a href="https://eclipse-score.github.io/score/{{ branch }}/" target="_blank" rel="noopener">S-CORE Project Documentation</a></li>
</ul>
</div>
</div>
Expand Down Expand Up @@ -449,7 +449,7 @@ <h3 style="font-size:0.95rem; margin-bottom:0.4rem;">Tool Qualification (ISO 262
<h4 style="font-size:0.9rem; margin-bottom:0.35rem;">Static Analysis & Code Quality</h4>
<div class="trace-links">
<ul style="padding-left:1.2rem; margin-top:0.25rem;">
<li><a href="https://eclipse-score.github.io/score/main/score_tools/tools_static_analysis_code_quality/index.html" target="_blank" rel="noopener">Static Analysis & Code Quality Tools</a></li>
<li><a href="https://eclipse-score.github.io/score/{{ branch }}/score_tools/tools_static_analysis_code_quality/index.html" target="_blank" rel="noopener">Static Analysis & Code Quality Tools</a></li>
</ul>
</div>
</div>
Expand Down
26 changes: 26 additions & 0 deletions scripts/tooling/cli/misc/html_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import json
import logging
import os
import subprocess
import sys
from pathlib import Path
from typing import Any, Optional
Expand Down Expand Up @@ -128,6 +129,28 @@ def _parse_sbom_packages(sbom_path: Path) -> list[dict[str, Any]]:
return packages


def _get_current_branch() -> str:
# 1. Prefer the pull request head branch, then the standard GitHub Actions ref name
ref_name = os.environ.get("GITHUB_HEAD_REF") or os.environ.get("GITHUB_REF_NAME")
if ref_name:
return ref_name
# 2. Try running git command to get current branch
try:
result = subprocess.run(
["git", "rev-parse", "--abbrev-ref", "HEAD"],
capture_output=True,
text=True,
check=True,
)
branch = result.stdout.strip()
if branch and branch != "HEAD":
return branch
except Exception:
pass
# 3. Default to main
return "main"


def generate_report(
known_good: KnownGood,
token: str | None = None,
Expand All @@ -137,6 +160,8 @@ def generate_report(
if token:
_enrich_with_compare_data(entries, token)

branch = _get_current_branch()

env = Environment(
loader=FileSystemLoader(TEMPLATE_DIR),
autoescape=select_autoescape(["html"]),
Expand All @@ -146,6 +171,7 @@ def generate_report(
modules_json=json.dumps(entries, indent=2),
sbom_packages_json=json.dumps(sbom_packages or [], indent=2),
timestamp=known_good.timestamp,
branch=branch,
)


Expand Down
29 changes: 29 additions & 0 deletions scripts/tooling/tests/test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,35 @@ def test_creates_parent_dirs_via_path(self, tmp_path, minimal_known_good):
assert out.exists()


# ---------------------------------------------------------------------------
# generate_report – branch selection and environment variable overrides
# ---------------------------------------------------------------------------


class TestGenerateReportBranchSelection:
def test_prefers_github_head_ref(self, monkeypatch, minimal_known_good):
monkeypatch.setenv("GITHUB_HEAD_REF", "feature/my-head-branch")
monkeypatch.setenv("GITHUB_REF_NAME", "main")
html = generate_report(minimal_known_good, TEMPLATE_DIR)
assert "https://eclipse-score.github.io/score/feature/my-head-branch/" in html

def test_falls_back_to_github_ref_name(self, monkeypatch, minimal_known_good):
monkeypatch.delenv("GITHUB_HEAD_REF", raising=False)
monkeypatch.setenv("GITHUB_REF_NAME", "releases/v1.0")
html = generate_report(minimal_known_good, TEMPLATE_DIR)
assert "https://eclipse-score.github.io/score/releases/v1.0/" in html

def test_falls_back_to_git_or_main_when_no_env(self, monkeypatch, minimal_known_good):
monkeypatch.delenv("GITHUB_HEAD_REF", raising=False)
monkeypatch.delenv("GITHUB_REF_NAME", raising=False)
html = generate_report(minimal_known_good, TEMPLATE_DIR)
# Verify it falls back to either current git branch or "main"
assert (
"https://eclipse-score.github.io/score/feature/dashboard-branch-links/" in html
or "https://eclipse-score.github.io/score/main/" in html
)


# ---------------------------------------------------------------------------
# Integration: real known_good.json
# ---------------------------------------------------------------------------
Expand Down
Loading