Skip to content
Draft
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
2c70089
poc: CodeQL findings in the module verification reports (DO NOT MERGE)
antonkri Nov 19, 2026
06db3e6
poc: commit the path-mapped CodeQL SARIF of main so the PR docs previ…
antonkri Nov 19, 2026
791092b
poc: produce the CodeQL SARIF in the preview run instead of committin…
antonkri Nov 19, 2026
6a4e26d
poc: analyse the modules with the Bazel based CodeQL tooling of score…
antonkri Nov 20, 2026
0b56259
poc: exclude targets without a toolchain or visible dependency from t…
antonkri Nov 20, 2026
b914082
poc: positive target patterns only, the compile-commands aquery ignor…
antonkri Nov 20, 2026
b65df8b
poc: use the Bazel output base as CodeQL source root so module findin…
antonkri Nov 20, 2026
c3844e6
Merge main; poc: analyse each module as root with score_tools CodeQL
antonkri Nov 23, 2026
c472704
poc: nested CodeQL bazel calls update the lockfile, loosen extraction…
antonkri Nov 23, 2026
7397f9d
poc: docs-as-code backport with type fixes, fetch CodeQL packs from r…
antonkri Nov 23, 2026
c7a172d
poc: test system_python bootstrap for CodeQL, preview only communicat…
antonkri Nov 23, 2026
684f6df
poc: keep system_python bootstrap for CodeQL, all modules again, docs…
antonkri Nov 23, 2026
29c673f
poc: analyse modules with score_tools codeql_analysis (traced LLVM bu…
antonkri Nov 24, 2026
a88cae1
poc: nested CodeQL build through the module bazel wrapper
antonkri Nov 24, 2026
3426cb7
poc: analyse only non-testonly targets, keep going on build failures
antonkri Nov 24, 2026
dc6ab18
poc: score_tools with C/C++-only target selection and optional recate…
antonkri Nov 24, 2026
ae4fcde
poc: lint every module with the central clang-tidy, clippy and ruff p…
antonkri Nov 24, 2026
b16205f
poc: export the module's lint configs from its root package
antonkri Nov 24, 2026
c469a6f
poc: pass score_cpp_policies' clang-tidy baseline explicitly to modul…
antonkri Nov 24, 2026
6375e52
poc: skip internal macro targets when linting
antonkri Nov 24, 2026
8cfe429
poc: map bazel-out header copies back to module sources, drop toolcha…
antonkri Nov 24, 2026
a8c9232
poc: use the clang-tidy baseline when the module config defines no ch…
antonkri Nov 24, 2026
6023d77
poc: treat ../<repo> SARIF paths as external
antonkri Nov 24, 2026
0c08a1f
poc: score_tools with communication's codeql_lint options
antonkri Nov 25, 2026
1adc113
poc: score_tools at the current tools head
antonkri Nov 25, 2026
381ff6b
poc: docs-as-code with SARIF uriBaseId resolution and order-independe…
antonkri Nov 25, 2026
2bff050
poc: score_tools with Copilot review fixes, compliance reports per ou…
antonkri Nov 25, 2026
e2edd9d
poc: static analysis contract from module patches instead of generate…
antonkri Nov 25, 2026
929758a
poc: hand raw SARIF/lint reports per repository to docs-as-code
antonkri Nov 25, 2026
00c14bb
poc: modules provide --config=lint_sarif, RI no longer sets SARIF lin…
antonkri Nov 25, 2026
d90fe17
module_tests: lint only targets a wildcard build builds (skip manual …
antonkri Nov 25, 2026
df9c466
patches: use make_clang_tidy_aspect with the fixed score_cpp_policies…
antonkri Nov 25, 2026
87d0039
Merge remote-tracking branch 'origin/main' into poc/static-analysis-c…
antonkri Nov 25, 2026
f4a8c1b
known_good: pin score_cpp_policies to the baseline fix instead of pat…
antonkri Nov 25, 2026
6d5a4b1
module_tests: static analysis like coverage (module list, results, re…
antonkri Nov 25, 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
83 changes: 81 additions & 2 deletions .github/workflows/module_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
# Runs every target_sw module's own unit tests against the dependency versions ref_int resolves
# (known_good.json pins + Bazel MVS for everything else), with ref_int's unified bazelrc config.
# (known_good.json pins + Bazel MVS for everything else), with ref_int's unified bazelrc config, and
# the CodeQL and lint analyses of the modules in STATIC_ANALYSIS_MODULES the same way.
# See scripts/module_tests.py. Called by test_and_docs.yml, which feeds the reports into the docs.
name: Module Tests
on:
Expand All @@ -29,6 +30,8 @@ jobs:
runs-on: ubuntu-24.04
outputs:
modules: ${{ steps.modules.outputs.modules }}
codeql: ${{ steps.modules.outputs.codeql }}
lint: ${{ steps.modules.outputs.lint }}
steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
Expand All @@ -38,7 +41,9 @@ jobs:
allow-unsafe-pr-checkout: true
- name: List modules
id: modules
run: echo "modules=$(jq -c '.modules.target_sw | keys' known_good.json)" >> "$GITHUB_OUTPUT"
run: |
echo "modules=$(jq -c '.modules.target_sw | keys' known_good.json)" >> "$GITHUB_OUTPUT"
python3 scripts/module_tests.py static-analysis-modules >> "$GITHUB_OUTPUT"
test:
name: Test ${{ matrix.module }}
needs: modules
Expand Down Expand Up @@ -93,3 +98,77 @@ jobs:
# The reports/ root keeps the <module>/ folder, so a merged download has one per module.
path: _module_tests/reports/
if-no-files-found: warn
codeql:
name: CodeQL ${{ matrix.module }}
needs: modules
if: ${{ needs.modules.outputs.codeql != '[]' }}
runs-on: ubuntu-24.04
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
module: ${{ fromJSON(needs.modules.outputs.codeql) }}
steps:
- name: Clean disk space
uses: eclipse-score/more-disk-space@v1.1
with:
level: 4
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.head_ref || github.event.pull_request.head.ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
allow-unsafe-pr-checkout: true
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.19.1
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}-codeql-${{ matrix.module }}
repository-cache: true
cache-save: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: CodeQL (//quality/static_analysis:codeql of the module)
run: python3 scripts/module_tests.py codeql ${{ matrix.module }}
- name: Upload CodeQL results
if: always()
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
with:
name: module-codeql-${{ matrix.module }}
path: _module_codeql/reports/
if-no-files-found: warn
lint:
name: Lint ${{ matrix.module }}
needs: modules
if: ${{ needs.modules.outputs.lint != '[]' }}
runs-on: ubuntu-24.04
timeout-minutes: 240
strategy:
fail-fast: false
matrix:
module: ${{ fromJSON(needs.modules.outputs.lint) }}
steps:
- name: Clean disk space
uses: eclipse-score/more-disk-space@v1.1
with:
level: 4
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ github.head_ref || github.event.pull_request.head.ref || github.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
allow-unsafe-pr-checkout: true
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.19.1
with:
bazelisk-cache: true
disk-cache: ${{ github.workflow }}-lint-${{ matrix.module }}
repository-cache: true
cache-save: ${{ github.event_name == 'push' && github.ref_name == 'main' }}
- name: Lint (--config=lint_sarif of the module)
run: python3 scripts/module_tests.py lint ${{ matrix.module }}
- name: Upload lint results
if: always()
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
with:
name: module-lint-${{ matrix.module }}
path: _module_lint/reports/
if-no-files-found: warn
94 changes: 94 additions & 0 deletions .github/workflows/static_analysis_preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# *******************************************************************************
# 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
# *******************************************************************************
# POC, delete before merge: PR runs of test_and_docs.yml use main's workflows (pull_request_target),
# so this runs this branch's module_tests.yml and the report/docs steps of test_and_docs.yml on push.
name: Static Analysis Report Preview (temporary)
permissions:
contents: read
actions: read
on:
push:
branches:
- poc/static-analysis-codeql
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
module_tests:
uses: ./.github/workflows/module_tests.yml
secrets: inherit
docs:
needs: module_tests
if: ${{ !cancelled() }}
runs-on: ubuntu-24.04
timeout-minutes: 120
steps:
- name: Clean disk space
uses: eclipse-score/more-disk-space@v1.1
with:
level: 4
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup Bazel
uses: bazel-contrib/setup-bazel@0.19.1
with:
bazelisk-cache: true
# Reuse (read only) the disk cache of "Code Quality & Documentation" on main.
disk-cache: Code Quality & Documentation
repository-cache: |
- MODULE.bazel
- known_good.json
- bazel_common/*.MODULE.bazel
- patches/**
- .bazelrc
cache-save: false
- name: Set up Python 3
uses: actions/setup-python@v7
with:
python-version: '3.12'
- name: Install Graphviz
uses: eclipse-score/apt-install@main
with:
packages: graphviz
cache: false
- name: Download module test reports
uses: actions/download-artifact@v4.1.8
with:
pattern: module-*
path: _module_reports
merge-multiple: true
- name: Write unit test, coverage and static analysis summaries
run: python ./scripts/module_tests.py report _module_reports
- name: Collect test reports for the documentation
run: |
for report in _module_reports/*; do
module="${report##*/}"
[ -d "$report/tests" ] || continue
mkdir -p "tests-report/external/$module+"
cp -r "$report/tests/." "tests-report/external/$module+/"
done
- name: Build documentation
run: |
bazel run \
--lockfile_mode=error \
//:docs_shim -- \
--github_user=${{ github.repository_owner }} \
--github_repo=${{ github.event.repository.name }}
tar -cf docs-preview.tar _build
- name: Upload documentation
uses: actions/upload-artifact@604373da6381bf24206979c74d06a550515601b9 # v4.4.1
with:
name: static-analysis-preview-docs
path: docs-preview.tar
retention-days: 7
10 changes: 6 additions & 4 deletions .github/workflows/test_and_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,16 @@ jobs:
- name: Download module test reports
uses: actions/download-artifact@v4.1.8
with:
pattern: module-tests-*
# module-tests-*, module-codeql-* and module-lint-*: one <module>/ folder each, merged.
pattern: module-*
path: _module_reports
merge-multiple: true
- name: Write unit test and coverage summaries
- name: Write unit test, coverage and static analysis summaries
# Module unit tests and their coverage come only from module_tests.yml, which runs each
# module's own tests against ref_int's resolved dependency versions. The report command
# also combines their rebased LCOV into coverage-report/coverage_report.dat, the input
# read by docs-as-code when //:docs_shim runs in this workspace below.
# also combines their rebased LCOV into coverage-report/coverage_report.dat and copies the
# modules' SARIF into static-analysis-report/, the inputs read by docs-as-code when
# //:docs_shim runs in this workspace below.
run: python ./scripts/module_tests.py report _module_reports
- name: Collect test reports for the documentation
# The source code linker reads tests-report/ instead of bazel-testlogs/ when it exists, so
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ubproject.toml
/docs/_collections
/tests-report
/coverage-report
/static-analysis-report

# Workspace files
/score_*/
Expand All @@ -34,3 +35,5 @@ artifacts
#Macos
.DS_Store
_module_tests/
_module_codeql/
_module_lint/
6 changes: 0 additions & 6 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions bazel_common/score_modules_target_sw.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ single_version_override(
"//patches/baselibs:001-restore-trace-library-mock-visibility.patch",
"//patches/baselibs:002-restore-qnx8-poll-workaround.patch",
"//patches/baselibs:003-export-aou-requirements.patch",
"//patches/baselibs:004-static-analysis-contract.patch",
],
version = "0.2.19",
)
Expand All @@ -34,6 +35,7 @@ git_override(
patches = [
"//patches/communication:001-expose-comm-examples.patch",
"//patches/communication:002-bazel-cpp-toolchains-1.1-qnx-sdp-pkg.patch",
"//patches/communication:003-static-analysis-contract.patch",
],
remote = "https://github.com/eclipse-score/communication.git",
)
Expand All @@ -46,6 +48,7 @@ single_version_override(
"//patches/persistency:003-undev-deps-for-root-module.patch",
"//patches/persistency:004-bazel-cpp-toolchains-1.1-qnx-sdp-pkg.patch",
"//patches/persistency:005-undev-integration-test-deps.patch",
"//patches/persistency:006-static-analysis-contract.patch",
],
version = "0.5.0",
)
Expand All @@ -54,6 +57,10 @@ bazel_dep(name = "score_kyron")
git_override(
module_name = "score_kyron",
commit = "85219c4d71e8ec33297534b63143b042f1a41818",
patch_strip = 1,
patches = [
"//patches/kyron:001-static-analysis-contract.patch",
],
remote = "https://github.com/eclipse-score/kyron.git",
)

Expand All @@ -68,6 +75,7 @@ git_override(
"//patches/lifecycle:005-bazel-cpp-toolchains-1.1-qnx-sdp-pkg.patch",
"//patches/lifecycle:006-undev-cpp-policies.patch",
"//patches/lifecycle:007-integration-image-without-sanitizer-runtimes.patch",
"//patches/lifecycle:008-static-analysis-contract.patch",
],
remote = "https://github.com/eclipse-score/lifecycle.git",
)
Expand All @@ -82,6 +90,7 @@ git_override(
"//patches/logging:003-relative-verification-report-links.patch",
"//patches/logging:006-bazel-cpp-toolchains-1.1-qnx-sdp-pkg.patch",
"//patches/logging:007-docs-drop-generated-dependency-pages.patch",
"//patches/logging:008-static-analysis-contract.patch",
],
remote = "https://github.com/eclipse-score/logging.git",
)
Expand All @@ -93,6 +102,7 @@ single_version_override(
patches = [
"//patches/time:007-bazel-cpp-toolchains-1.1-qnx-sdp-pkg.patch",
"//patches/time:003-undev-rules-imagefs.patch",
"//patches/time:008-static-analysis-contract.patch",
],
version = "0.3.3",
)
Expand All @@ -106,6 +116,7 @@ single_version_override(
"//patches/config_management:004-bazel-cpp-toolchains-1.1-qnx-sdp-pkg.patch",
"//patches/config_management:005-persistency-0.5-shared-kvs.patch",
"//patches/config_management:006-config-daemon-remote-logging.patch",
"//patches/config_management:007-static-analysis-contract.patch",
],
version = "0.3.5",
)
17 changes: 13 additions & 4 deletions bazel_common/score_modules_tooling.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,17 @@ single_version_override(
)

bazel_dep(name = "score_tools")
single_version_override(
git_override(
module_name = "score_tools",
version = "0.0.4",
commit = "31427b6d3200fa966212fc9d80db7bb0407ea711",
remote = "https://github.com/eclipse-score/tools.git",
)

bazel_dep(name = "score_cpp_policies")
git_override(
module_name = "score_cpp_policies",
commit = "c8fb812e85a971ac083b28219ce86d3f7a1cf9be",
remote = "https://github.com/eclipse-score/score_cpp_policies.git",
)

bazel_dep(name = "score_tooling")
Expand Down Expand Up @@ -76,9 +84,10 @@ single_version_override(
)

bazel_dep(name = "score_docs_as_code")
single_version_override(
git_override(
module_name = "score_docs_as_code",
version = "9.1.1",
commit = "dfbfeebd7f727980540d11f15af67891aad13197",
remote = "https://github.com/eclipse-score/docs-as-code.git",
)

bazel_dep(name = "score_process_description")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ Architecture and Inspection statistics.

Unit Tests Summary <unit_test_summary>
Coverage Analysis Summary <coverage_summary>
Static Analysis Summary <static_analysis_summary>
3 changes: 3 additions & 0 deletions docs/verification_report/static_analysis_summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Static Analysis Execution Summary

## Template for a table with Static Analysis execution summary
Loading
Loading