Skip to content

Commit a742bdf

Browse files
authored
Merge branch 'main' into dcalavrezo_clippy
2 parents 3844458 + 209bfa1 commit a742bdf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1192
-138
lines changed

.bazelrc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ build --@rules_rust//rust/settings:clippy.toml=@score_rust_policies//clippy/stri
2222

2323
# Flags needed by score_baselibs and communication modules.
2424
# Do not add more!
25-
build --@score_baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False
2625
build --@score_baselibs//score/mw/log/flags:KRemote_Logging=False
2726
build --@score_baselibs//score/json:base_library=nlohmann
2827
build --@score_communication//score/mw/com/flags:tracing_library=stub
@@ -47,6 +46,13 @@ build:bl-x86_64-qnx --config=_bl_common
4746
build:bl-x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx
4847
build:bl-x86_64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64
4948

49+
# This config is for internal module usage ONLY.
50+
build:bl-x86_64-linux-autosd --config=_bl_common
51+
build:bl-x86_64-linux-autosd --define=score_sw_platform=autosd
52+
build:bl-x86_64-linux-autosd --platforms=@score_bazel_platforms//:x86_64-linux
53+
build:bl-x86_64-linux-autosd --extra_toolchains=@autosd_10_gcc_repo//:gcc_toolchain_linux_x86_64
54+
build:bl-x86_64-linux-autosd --force_pic
55+
5056
# This config is for internal module usage ONLY.
5157
test:bl-x86_64-linux --config=_bl_common
5258
test:bl-x86_64-linux --build_tests_only

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"name": "eclipse-s-core",
3-
"image": "ghcr.io/eclipse-score/devcontainer:1.0.0",
3+
"image": "ghcr.io/eclipse-score/devcontainer:v1.1.0",
4+
"postCreateCommand": "bash .devcontainer/prepare_workspace.sh",
45
"postStartCommand": "ssh-keygen -f '/home/vscode/.ssh/known_hosts' -R '[localhost]:2222' || true"
56
}

.devcontainer/prepare_workspace.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Install pipx
5+
sudo apt update
6+
sudo apt install -y pipx
7+
8+
# Install gita
9+
pipx install gita
10+
11+
# Enable bash autocompletion for gita
12+
echo "eval \"\$(register-python-argcomplete gita -s bash)\"" >> ~/.bashrc
13+
14+
# Set GITA_PROJECT_HOME environment variable
15+
echo "export GITA_PROJECT_HOME=$(pwd)/.gita" >> ~/.bashrc
16+
GITA_PROJECT_HOME=$(pwd)/.gita
17+
mkdir -p "$GITA_PROJECT_HOME"
18+
export GITA_PROJECT_HOME
19+
20+
# Generate workspace metadata files from known_good.json:
21+
# - .gita-workspace.csv
22+
python3 tools/known_good_to_workspace_metadata.py --known-good known_good.json --gita-workspace .gita-workspace.csv

.github/codeql/codeql-config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: "Custom CodeQL Configuration for MISRA"
2+
3+
paths-ignore:
4+
- "**/*test*"
5+
- "**/*mock*"
6+
- "**/test/**"
7+
- "**/mock/**"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
deviations: []
2+
guideline-recategorizations: []
3+
deviation-permits: []

.github/workflows/build_and_test_autosd.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ jobs:
2323
build:
2424
name: build-and-test-autosd
2525
runs-on: ubuntu-latest
26-
defaults:
27-
run:
28-
working-directory: autosd/build
2926

3027
steps:
3128
- name: Checkout repository
@@ -37,31 +34,46 @@ jobs:
3734
- name: Install System Dependencies
3835
run: |
3936
sudo apt-get update -y
40-
sudo apt-get install -y podman curl qemu-system
37+
sudo apt-get install -y podman curl qemu-system createrepo-c
38+
39+
- name: Build Lola Demo
40+
run: |
41+
bazel build --config=bl-x86_64-linux-autosd //:lola-demo
42+
working-directory: ./autosd
43+
44+
- name: Copy RPMs
45+
run: |
46+
set -e
47+
mkdir -p ./build/rpms
48+
cp bazel-out/k8-fastbuild/bin/lola-demo-1.0.0-1.x86_64.rpm ./build/rpms
49+
cp bazel-out/k8-fastbuild/bin/lola-demo-1.0.0-1.src.rpm ./build/rpms
50+
createrepo_c ./build/rpms/
51+
ls -l ./build/rpms/
52+
working-directory: ./autosd
4153

4254
- name: Install AIB Tools
4355
run: |
44-
curl -o auto-image-builder.sh "https://gitlab.com/CentOS/automotive/src/automotive-image-builder/-/raw/main/auto-image-builder.sh"
56+
curl -o auto-image-builder.sh "https://gitlab.com/lrossett/automotive-image-builder/-/raw/script-fix/auto-image-builder.sh?ref_type=heads"
4557
chmod +x auto-image-builder.sh
4658
4759
curl -o automotive-image-runner "https://gitlab.com/CentOS/automotive/src/automotive-image-builder/-/raw/main/automotive-image-runner"
4860
chmod +x automotive-image-runner
61+
working-directory: ./autosd/build
4962

5063
- name: Build lola-demo.aib.yml
5164
run: |
52-
sudo ./auto-image-builder.sh build \
65+
sudo ./auto-image-builder.sh build-deprecated \
5366
--distro autosd10 \
5467
--mode package \
5568
--target qemu \
5669
--export qcow2 \
5770
--define-file vars.yml \
5871
--define-file vars-devel.yml \
59-
lola-demo.aib.yml \
72+
image.aib.yml \
6073
disk.qcow2
6174
6275
sudo chown $(id -u) disk.qcow2
63-
64-
mv disk.qcow2 ../disk.qcow2
76+
working-directory: ./autosd/build
6577

6678
- name: Enable KVM group perms
6779
run: |
@@ -80,6 +92,12 @@ jobs:
8092
sshcmd 'bluechictl start agent-qm lola-ipc-sub.service'
8193
sleep 5
8294
sshcmd '/usr/bin/lola-ipc-test'
83-
working-directory: ./autosd
95+
working-directory: ./autosd/build
8496
env:
8597
SSH_PASSWORD: password
98+
99+
- name: Archive QEMU disk image
100+
uses: actions/upload-artifact@v4
101+
with:
102+
name: autosd10-score-reference_integration-x86_64.qcow2
103+
path: autosd/build/disk.qcow2

.github/workflows/build_and_test_on_every_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ jobs:
5353
done < ci/showcase_targets_run.txt
5454
- name: Feature Integration Tests
5555
run: |
56-
bazel run --config bl-x86_64-linux //feature_integration_tests/python_test_cases:fit
56+
bazel test --config bl-x86_64-linux //feature_integration_tests/python_test_cases:fit
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
name: "CodeQL - Multi-Repo Source Scan"
15+
16+
on:
17+
pull_request:
18+
types: [opened, reopened, synchronize]
19+
merge_group:
20+
types: [checks_requested]
21+
22+
permissions:
23+
contents: write
24+
25+
jobs:
26+
analyze-repos:
27+
name: Analyze Multiple Repositories
28+
runs-on: ubuntu-latest
29+
permissions:
30+
security-events: write
31+
packages: read
32+
actions: read
33+
contents: read
34+
35+
steps:
36+
- name: Checkout central repository
37+
uses: actions/checkout@v4
38+
39+
- name: Checkout CodeQL Coding Standards scripts
40+
uses: actions/checkout@v4
41+
with:
42+
repository: github/codeql-coding-standards
43+
path: codeql-coding-standards-repo # Klonen in diesen Ordner
44+
ref: main # Oder eine spezifische Release-Version, z.B. 'v2.53.0-dev'
45+
46+
# Add coding standard packages and dependencies
47+
- name: Install Python dependencies for Coding Standards scripts
48+
run: |
49+
python3 -m pip install --upgrade pip
50+
pip3 install pyyaml jsonpath-ng jsonschema jsonpatch jsonpointer pytest sarif-tools
51+
52+
- name: Parse known_good.json and create repos.json
53+
id: parse-repos
54+
run: |
55+
sudo apt-get update && sudo apt-get install -y jq
56+
JSON_FILE="./known_good.json"
57+
58+
# Check if the file exists
59+
if [ ! -f "$JSON_FILE" ]; then
60+
echo "Error file not found '$JSON_FILE' "
61+
ls -la .
62+
exit 1
63+
fi
64+
65+
# Create repos.json from known_good.json
66+
# This jq command transforms the 'modules' object into an array of repository objects
67+
# with 'name', 'url', 'version' (branch/tag/hash), and 'path'.
68+
jq '[.modules | to_entries[] | {
69+
name: .key,
70+
url: .value.repo,
71+
version: (.value.branch // .value.hash // .value.version),
72+
path: ("repos/" + .key)
73+
}]' "$JSON_FILE" > repos.json
74+
75+
echo "Generated repos.json:"
76+
cat repos.json
77+
echo "" # Add a newline for better readability
78+
79+
# The following GITHUB_OUTPUT variables are set for each module.
80+
# These might be useful for other steps, but are not directly used by the 'checkout-repos' step
81+
# which now reads 'repos.json' directly.
82+
echo "MODULE_COUNT=$(jq '.modules | length' "$JSON_FILE")" >> $GITHUB_OUTPUT
83+
84+
jq -c '.modules | to_entries[]' "$JSON_FILE" | while read -r module_entry; do
85+
module_name=$(echo "$module_entry" | jq -r '.key')
86+
repo_url=$(echo "$module_entry" | jq -r '.value.repo // empty')
87+
version=$(echo "$module_entry" | jq -r '.value.version // empty')
88+
branch=$(echo "$module_entry" | jq -r '.value.branch // empty')
89+
hash=$(echo "$module_entry" | jq -r '.value.hash // empty')
90+
91+
echo "${module_name}_url=$repo_url" >> $GITHUB_OUTPUT
92+
93+
if [ -n "$version" ]; then
94+
echo "${module_name}_version=$version" >> $GITHUB_OUTPUT
95+
fi
96+
97+
if [ -n "$branch" ]; then
98+
echo "${module_name}_branch=$branch" >> $GITHUB_OUTPUT
99+
fi
100+
101+
if [ -n "$hash" ]; then
102+
echo "${module_name}_hash=$hash" >> $GITHUB_OUTPUT
103+
fi
104+
done
105+
106+
- name: Checkout all pinned repositories
107+
id: checkout-repos
108+
run: |
109+
# jq is already installed by the previous step.
110+
111+
# Read repositories from the repos.json file created by the previous step
112+
repos=$(cat repos.json)
113+
repo_count=$(echo "$repos" | jq length)
114+
115+
# Initialize an empty string for paths to be outputted
116+
repo_paths_output=""
117+
118+
for i in $(seq 0 $((repo_count-1))); do
119+
name=$(echo "$repos" | jq -r ".[$i].name")
120+
url=$(echo "$repos" | jq -r ".[$i].url")
121+
ref=$(echo "$repos" | jq -r ".[$i].version") # This can be a branch, tag, or commit hash
122+
path=$(echo "$repos" | jq -r ".[$i].path") # e.g., "repos/score_baselibs"
123+
124+
echo "Checking out $name ($ref) to $path"
125+
126+
# Create the parent directory if it doesn't exist
127+
mkdir -p "$(dirname "$path")"
128+
129+
# Check if 'ref' looks like a commit hash (e.g., 40 hex characters)
130+
# This is a heuristic; a more robust check might involve fetching refs first.
131+
if [[ "$ref" =~ ^[0-9a-fA-F]{40}$ ]]; then
132+
echo " Detected commit hash. Cloning and then checking out."
133+
git clone "$url" "$path"
134+
(cd "$path" && git checkout "$ref")
135+
else
136+
echo " Detected branch/tag. Cloning with --branch."
137+
git clone --depth 1 --branch "$ref" "$url" "$path"
138+
fi
139+
140+
# Append the path to the list, separated by commas
141+
if [ -z "$repo_paths_output" ]; then
142+
repo_paths_output="$path"
143+
else
144+
repo_paths_output="$repo_paths_output,$path"
145+
fi
146+
done
147+
148+
# Output all paths as a single variable
149+
echo "repo_paths=$repo_paths_output" >> $GITHUB_OUTPUT
150+
151+
- name: Initialize CodeQL for all repositories
152+
uses: github/codeql-action/init@v4
153+
with:
154+
languages: cpp
155+
build-mode: none
156+
packs: codeql/misra-cpp-coding-standards
157+
config-file: ./.github/codeql/codeql-config.yml
158+
159+
- name: Perform CodeQL Analysis
160+
uses: github/codeql-action/analyze@v4
161+
with:
162+
upload-database: false # Don't upload databases for each repo
163+
output: sarif-results/
164+
category: "multi-repo-scan"
165+
166+
- name: Recategorize Guidelines
167+
if: always()
168+
run: |
169+
RECATEGORIZE_SCRIPT="codeql-coding-standards-repo/scripts/guideline_recategorization/recategorize.py"
170+
CODING_STANDARDS_CONFIG="./.github/codeql/coding-standards.yml"
171+
172+
CODING_STANDARDS_SCHEMA="codeql-coding-standards-repo/schemas/coding-standards-schema-1.0.0.json"
173+
SARIF_SCHEMA="codeql-coding-standards-repo/schemas/sarif-schema-2.1.0.json"
174+
175+
176+
SARIF_FILE="sarif-results/cpp.sarif"
177+
178+
mkdir -p sarif-results-recategorized
179+
echo "Processing $SARIF_FILE for recategorization..."
180+
python3 "$RECATEGORIZE_SCRIPT" \
181+
--coding-standards-schema-file "$CODING_STANDARDS_SCHEMA" \
182+
--sarif-schema-file "$SARIF_SCHEMA" \
183+
"$CODING_STANDARDS_CONFIG" \
184+
"$SARIF_FILE" \
185+
"sarif-results-recategorized/$(basename "$SARIF_FILE")"
186+
187+
rm "$SARIF_FILE"
188+
mv "sarif-results-recategorized/$(basename "$SARIF_FILE")" "$SARIF_FILE"
189+
190+
- name: Generate HTML Report from SARIF
191+
run: |
192+
SARIF_FILE="sarif-results/cpp.sarif"
193+
sarif html "$SARIF_FILE" --output codeql-report.html
194+
195+
- name: Upload SARIF results as artifact
196+
uses: actions/upload-artifact@v4
197+
with:
198+
name: codeql-sarif-results
199+
path: sarif-results/
200+
201+
202+
- name: Upload HTML Report as artifact
203+
uses: actions/upload-artifact@v4
204+
with:
205+
name: codeql-html-report
206+
path: codeql-report.html

.github/workflows/test_integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ jobs:
6666
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6767
- name: Bazel build targets
6868
run: |
69-
./integration_test.sh --known-good known_good.updated.json
69+
scripts/integration_test.sh --known-good known_good.updated.json
7070
- name: Show disk space after build
7171
if: always()
7272
run: |

0 commit comments

Comments
 (0)