Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
64049ad
AZB #101279: Add Bazel targets for unit/component tests and coverage
GabrielPinheiro7891 Aug 5, 2026
7444a7c
Update to match module_template
GabrielPinheiro7891 Aug 6, 2026
627b8c4
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Aug 20, 2026
1cd949b
Update to match module_template and build
GabrielPinheiro7891 Aug 20, 2026
f4be4e9
Fix alphabetical attribute ordering
GabrielPinheiro7891 Aug 20, 2026
8355239
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Aug 21, 2026
9f1840e
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Aug 25, 2026
8ff340f
Fix Copyright
GabrielPinheiro7891 Aug 25, 2026
31ad9b9
Add feature_requirements to index.rst
GabrielPinheiro7891 Aug 25, 2026
19d50d6
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Aug 25, 2026
5040f47
Merge branch 'main' into feature/AZB-101279-Quality-pack-targets
BjoernAtBosch Aug 27, 2026
8897879
Remove feature requirements
GabrielPinheiro7891 Aug 27, 2026
aa16b3c
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Aug 27, 2026
b1240de
Create new comp_req based on previous created feat_req
GabrielPinheiro7891 Aug 27, 2026
96aa4c6
Describe reqs in more high-level detail
GabrielPinheiro7891 Aug 28, 2026
9df2434
Describe req in more high-level detail
GabrielPinheiro7891 Aug 28, 2026
bb05ce5
Change unified clock facade reqtype from Interface to Functional
GabrielPinheiro7891 Sep 1, 2026
1c30585
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Sep 1, 2026
32acd56
Apply batched suggestions from code review
GabrielPinheiro7891 Sep 1, 2026
16c009b
Simplify documentation
GabrielPinheiro7891 Sep 1, 2026
356186b
Add AoU for user-side backend initialization
GabrielPinheiro7891 Sep 3, 2026
36a3061
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Sep 3, 2026
8e33371
Add comp_req for Linux/QNX platform support
GabrielPinheiro7891 Sep 3, 2026
1774d2e
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Sep 4, 2026
635d30e
Merge requirements.rst into index.rst
GabrielPinheiro7891 Sep 4, 2026
7df6383
Clarify always-ready clock reqs: "prior initialization"
GabrielPinheiro7891 Sep 4, 2026
1a63a6a
Apply batched suggestions from code review
GabrielPinheiro7891 Sep 15, 2026
a243508
Align high-res steady clock test tags and requirement verification
GabrielPinheiro7891 Sep 15, 2026
f02d560
add traceability gate and PR comment workflows
GabrielPinheiro7891 Sep 15, 2026
2f414b1
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Sep 15, 2026
22ef7b5
Undo change to requirement name
GabrielPinheiro7891 Sep 16, 2026
205ccb0
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Sep 16, 2026
dbd43e9
satisfy clang-format for high_res_steady_clock_adapter_test
GabrielPinheiro7891 Sep 16, 2026
9114dd8
Merge remote-tracking branch 'origin/main' into feature/AZB-101279-Qu…
GabrielPinheiro7891 Sep 17, 2026
923d7e8
Merge branch 'main' into feature/AZB-101279-Quality-pack-targets
GabrielPinheiro7891 Sep 18, 2026
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
84 changes: 84 additions & 0 deletions .github/tools/coverage.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
#!/usr/bin/env bash
# *******************************************************************************
# 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
# *******************************************************************************
#
# Runs unit + component tests with code coverage and generates HTML +
# Cobertura XML reports.
#
# Prerequisites (install once):
# sudo apt-get install -y lcov
# pipx install lcov-cobertura
#
# Usage:
# .github/tools/coverage.sh [<bazel-target>] [--config <bazel-config>] [--output-dir <dir>]
#
# Options:
# <bazel-target> Bazel target to collect coverage for (default: //score/...)
# --config <bazel-config> Bazel config to use (default: time-x86_64-linux)
# --output-dir <dir> Directory for generated reports (default: cpp_coverage)

set -euo pipefail

OUTPUT_DIR="cpp_coverage"
BAZEL_CONFIG="time-x86_64-linux"
BAZEL_TARGET="${1:-//score/...}"

# Consume the target argument if it was provided positionally
[[ $# -gt 0 && "$1" != --* ]] && shift

while [[ $# -gt 0 ]]; do
case "$1" in
--config)
BAZEL_CONFIG="$2"
shift 2
;;
--output-dir)
OUTPUT_DIR="$2"
shift 2
;;
--target)
BAZEL_TARGET="$2"
shift 2
;;
*)
echo "Unknown option: $1" >&2
exit 1
;;
esac
done

echo "==> Running tests with coverage..."
bazel coverage --config="${BAZEL_CONFIG}" -- "${BAZEL_TARGET}"

OUTPUT_PATH="$(bazel info output_path)"
EXEC_ROOT="$(bazel info execution_root)"
DAT_FILE="${OUTPUT_PATH}/_coverage/_coverage_report.dat"

echo "==> Generating HTML report in '${OUTPUT_DIR}'..."
genhtml "${DAT_FILE}" \
--output-directory="${OUTPUT_DIR}" \
--show-details \
--source-directory="${EXEC_ROOT}" \
--legend \
--function-coverage \
--branch-coverage

echo "==> Generating Cobertura XML report at '${OUTPUT_DIR}/coverage.xml'..."
lcov_cobertura "${DAT_FILE}" \
--base-dir "${EXEC_ROOT}" \
--output "${OUTPUT_DIR}/coverage.xml"

echo ""
echo "Coverage reports written to '${OUTPUT_DIR}/'."
echo " HTML: ${OUTPUT_DIR}/index.html"
echo " Cobertura: ${OUTPUT_DIR}/coverage.xml"
4 changes: 4 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,7 @@ jobs:
# the bazel-target depends on your repo specific docs_targets configuration (e.g. "suffix")
bazel-target: "//:docs -- --github_user=${{ github.repository_owner }} --github_repo=${{ github.event.repository.name }}"
retention-days: 3

quality_pack:
secrets: inherit
uses: ./.github/workflows/quality_pack.yml
123 changes: 123 additions & 0 deletions .github/workflows/quality_pack-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# *******************************************************************************
# 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
# *******************************************************************************

# Waits for the Docs workflow of a pull request, downloads the traceability gate
# artifact produced by quality_pack.yml, and posts (or edits) a
# comment on the pull request with the gate summary and pass/fail status.
#
# Runs via workflow_run so that pull requests opened from forks — which get a
# read-only GITHUB_TOKEN and cannot write comments themselves — still get a
# comment posted by this workflow, which runs with the base repo's token.

name: Publish Quality Pack Comment

on:
workflow_run:
workflows: ["Docs / Build & Deploy"]
types:
- completed

jobs:
quality-pack-comment:
name: Comment traceability gate on the pull request
if: github.event.workflow_run.event == 'pull_request' || github.event.workflow_run.event == 'pull_request_target'
runs-on: ubuntu-latest
permissions:
actions: read # list + download the artifacts of the triggering workflow run
pull-requests: write # comment on the pull request
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
RUN_ID: ${{ github.event.workflow_run.id }}
steps:
- name: Resolve pull request number
id: metadata
env:
HEAD_REPO_OWNER: ${{ github.event.workflow_run.head_repository.owner.login }}
PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number || '' }}
REF_NAME: ${{ github.event.workflow_run.head_branch }}
run: |
set -euo pipefail

if [[ "$PR_NUMBER" == "null" ]]; then
PR_NUMBER=""
fi

# fork-origin workflow_run payloads do not include pull_requests[]
if [[ -z "$PR_NUMBER" && -n "$HEAD_REPO_OWNER" && -n "$REF_NAME" ]]; then
PR_NUMBER="$(gh api \
"repos/${REPO}/pulls?state=all&head=${HEAD_REPO_OWNER}:${REF_NAME}" \
--jq '.[0].number // empty' || true)"
fi

if [[ -z "$PR_NUMBER" ]]; then
echo "Could not determine PR number for pull request event." >&2
exit 1
fi

echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"

- name: Download quality pack artifact
id: download
continue-on-error: true
uses: actions/download-artifact@v4
with:
name: quality-pack-metrics
path: _quality_pack_dl
github-token: ${{ github.token }}
repository: ${{ github.repository }}
run-id: ${{ github.event.workflow_run.id }}

- name: Render comment body
id: render
run: |
set -euo pipefail

GATE_FILE=_quality_pack_dl/_quality_pack/gate.txt
if [[ -f "$GATE_FILE" ]]; then
if grep -q "Threshold check passed." "$GATE_FILE"; then
status="**PASS**"
else
status="**FAIL**"
fi
gate_body=$(cat "$GATE_FILE")
else
status="**UNAVAILABLE**"
gate_body="No traceability gate output was produced by the docs run."
fi

{
echo "Quality pack traceability report for this pull request:"
echo
echo "Status: $status ([workflow run](${{ github.event.workflow_run.html_url }}))"
echo
echo '```text'
echo "$gate_body"
echo '```'
} > comment.md

- name: Find existing PR comment
uses: peter-evans/find-comment@b30e6a3c0ed37e7c023ccd3f1db5c6c0b0c23aad # v4.0.0
id: fc
with:
issue-number: ${{ steps.metadata.outputs.pr_number }}
comment-author: "github-actions[bot]"
body-includes: Quality pack traceability report for this pull request

- name: Comment on PR with traceability gate summary
uses: peter-evans/create-or-update-comment@e8674b075228eee787fea43ef493e45ece1004c9 # v5.0.0
with:
issue-number: ${{ steps.metadata.outputs.pr_number }}
comment-id: ${{ steps.fc.outputs.comment-id }}
edit-mode: replace
body-path: comment.md
75 changes: 75 additions & 0 deletions .github/workflows/quality_pack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# *******************************************************************************
# 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
# *******************************************************************************

# Builds the docs and runs the upstream //:traceability_gate against the
# resulting _build/metrics.json, then uploads the gate output as an artifact.
#
# This workflow does NOT comment on the PR — see quality_pack-publish.yml for
# the elevated-permissions companion that downloads the artifact and posts.
# The split is required so that pull requests opened from forks (which get a
# read-only GITHUB_TOKEN) still get a comment.

name: Quality pack coverage

on:
workflow_call:

jobs:
quality-pack:
runs-on: ubuntu-24.04
steps:
- uses: eclipse-score/more-disk-space@v1
- name: Checkout repository
uses: actions/checkout@v4
- name: Create Bazel output base directory
run: |
sudo mkdir -p /mnt/.bazel
sudo chown -R $USER:$USER /mnt/.bazel
- name: Create config indicator file
run: echo "host" > .bazel_config
- name: Setup Bazel
uses: eclipse-score/cicd-actions/setup-bazel-cache@212bbf86267e9381da9d2daf962d12f6feafbc90 # v0.0.2
with:
unique-cache-name: ${{ github.job }}
- name: Allow linux-sandbox
uses: eclipse-score/cicd-actions/unblock-user-namespace-for-linux-sandbox@212bbf86267e9381da9d2daf962d12f6feafbc90 # v0.0.2
- name: Install Graphviz (required by PlantUML for non-sequence diagrams)
run: sudo apt-get update && sudo apt-get install -y graphviz
- name: Build unit + component tests (needed for test links)
run: bazel test //:unit_tests //:component_tests
- name: Build docs
run: bazel run //:docs
# Thresholds default to 0 while comp_req coverage is being (re-)built up
# against the SOME/IP protocol spec. Raise the --min-* flags as
# links land, so the gate never regresses without a follow-up ticket.
# --need-type=comp_req scopes the gate to component requirements;
# feat_req / stkh_req live upstream in eclipse-score/score and would
# otherwise pull the numbers to zero and flap the gate.
- name: Run traceability gate
continue-on-error: true
run: |
mkdir -p _quality_pack
bazel run //:traceability_gate -- \
--metrics-json "$PWD/_build/metrics.json" \
--need-type=comp_req \
> _quality_pack/gate.txt
- name: Upload quality pack artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: quality-pack-metrics
path: |
_build/metrics.json
_quality_pack/gate.txt
if-no-files-found: warn
retention-days: 14
11 changes: 11 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,14 @@ exports_files(
"MODULE.bazel",
],
)

test_suite(
name = "component_tests",
tests = [
"//score/time/high_res_steady_time/src:high_res_steady_clock_test",
"//score/time/steady_time/src:steady_clock_test",
"//score/time/system_time/src:system_clock_test",
"//score/time/vehicle_time/src:vehicle_clock_test",
],
visibility = ["//visibility:public"],
)
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ For a detailed concept and architectural design, please refer to the :doc:`time_

features/index
module/index
quality_pack


Project Layout
Expand Down
Loading
Loading