diff --git a/.bazelignore b/.bazelignore index ee0205ffc2..c795b054e5 100644 --- a/.bazelignore +++ b/.bazelignore @@ -1,3 +1 @@ -autosd -ebclfsa -qnx_qemu +build \ No newline at end of file diff --git a/.bazelrc b/.bazelrc index ddd24a4ed9..5c30faacb1 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,81 +1,64 @@ -# ******************************************************************************* -# Copyright (c) 2025 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 -# ******************************************************************************* - common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/ common --registry=https://bcr.bazel.build +common --credential_helper=*.qnx.com=%workspace%/scripts/qnx_credential_helper.py +common --credential_helper_timeout="60s" +# Java +build --java_language_version=17 +build --tool_java_language_version=17 +build --java_runtime_version=remotejdk_17 +build --tool_java_runtime_version=remotejdk_17 -# Flags needed by score_baselibs and communication modules. -# Do not add more! -common --@score_baselibs//score/mw/log/flags:KRemote_Logging=False -common --@score_baselibs//score/json:base_library=nlohmann -common --@score_communication//score/mw/com/flags:tracing_library=stub -common --@score_baselibs//score/memory/shared/flags:use_typedshmd=False -common --@score_logging//score/datarouter/build_configuration_flags:persistent_logging=False -common --@score_logging//score/datarouter/build_configuration_flags:persistent_config_feature_enabled=False -common --@score_logging//score/datarouter/build_configuration_flags:enable_nonverbose_dlt=False -common --@score_logging//score/datarouter/build_configuration_flags:enable_dynamic_configuration_in_datarouter=False -common --@score_logging//score/datarouter/build_configuration_flags:use_local_vlan=True -common --@score_logging//score/mw/log/flags:KRemote_Logging=False +build:_common --@score_baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False +build:_common --@score_baselibs//score/mw/log/flags:KRemote_Logging=False +build:_common --@score_baselibs//score/json:base_library=nlohmann +build:_common --@score_baselibs//score/memory/shared/flags:use_typedshmd=False +build:_common --@score_communication//score/mw/com/flags:tracing_library=stub +build:_common --cxxopt=-Wno-error=mismatched-new-delete +build:_common --host_platform=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix +build:_common --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu +build:_common --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix -# stop legacy behavior of creating __init__.py files -build --incompatible_default_to_explicit_init_py -build --incompatible_strict_action_env -build --experimental_retain_test_configuration_across_testonly #https://github.com/bazelbuild/bazel/issues/6842 +build:qnx-x86_64 --config=_common +build:qnx-x86_64 --noexperimental_merged_skyframe_analysis_execution +build:qnx-x86_64 --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 +build:qnx-x86_64 --incompatible_enable_cc_toolchain_resolution +build:qnx-x86_64 --incompatible_strict_action_env +build:qnx-x86_64 --sandbox_writable_path=/var/tmp +build:qnx-x86_64 --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix +build:qnx-x86_64 --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0-posix +build:qnx-x86_64 --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64 +build:qnx-x86_64 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800 -test --test_tag_filters=-manual -test --test_output=errors +build:itf-qnx-x86_64 --config=qnx-x86_64 +build:itf-qnx-x86_64 --run_under=@score_itf//scripts:run_under_qemu +build:itf-qnx-x86_64 --test_arg="--qemu" +build:itf-qnx-x86_64 --test_arg="--os=qnx" -build:shared --sandbox_writable_path=/var/tmp -build:shared --host_platform=@score_bazel_platforms//:x86_64-linux -build:x86_64-linux --config=shared -build:x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix -build:x86_64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu -build:x86_64-linux --features=-treat_warnings_as_errors # due to baselibs deprecations +build:linux-x86_64 --config=_common +build:linux-x86_64 --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix +build:linux-x86_64 --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix -# this is deprecated, use build:x86_64-linux instead -build:_bl_common --host_platform=@score_bazel_platforms//:x86_64-linux +build:eb-aarch64 --config=_common +build:eb-aarch64 --extra_toolchains=@gcc_toolchain//:aarch64_gcc_13 +build:eb-aarch64 --platforms=@score_toolchains_gcc//platforms:aarch64-linux +build:eb-aarch64 --spawn_strategy=local -# This config is for internal module usage ONLY. -build:bl-x86_64-qnx --config=_bl_common -build:bl-x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx -build:bl-x86_64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64 -# This config is for internal module usage ONLY. -build:bl-x86_64-linux-autosd --config=_bl_common -build:bl-x86_64-linux-autosd --define=score_sw_platform=autosd -build:bl-x86_64-linux-autosd --platforms=@score_bazel_platforms//:x86_64-linux -build:bl-x86_64-linux-autosd --extra_toolchains=@autosd_10_gcc_repo//:gcc_toolchain_linux_x86_64 -build:bl-x86_64-linux-autosd --force_pic +build:autosd-x86_64 --config=_common +build:autosd-x86_64 --platforms=@score_bazel_platforms//:x86_64-linux +build:autosd-x86_64 --force_pic +build:autosd-x86_64 --extra_toolchains=@autosd_10_gcc_repo//:gcc_toolchain_linux_x86_64 +build:autosd-x86_64 --extra_toolchains=@rules_rpm//toolchains:linux_x86_64 -# This config is for internal module usage ONLY. -test:bl-x86_64-linux --config=_bl_common -test:bl-x86_64-linux --build_tests_only -test:bl-x86_64-linux --test_tag_filters=-manual -test:bl-x86_64-linux --test_output=errors -# config from communication .bazelrc file -# unshare /dev/shm and /tmp -test --sandbox_tmpfs_path=/dev/shm -test --sandbox_tmpfs_path=/tmp +test:unit-tests --config=linux-x86_64 -# Java -build --java_language_version=17 -build --tool_java_language_version=17 -build --java_runtime_version=remotejdk_17 -build --tool_java_runtime_version=remotejdk_17 +# Coverage configuration for C++ +coverage --features=coverage +coverage --combined_report=lcov # user specific overrides (like proxy settings) -try-import %workspace%/user.bazelrc +try-import %workspace%/user.bazelrc \ No newline at end of file diff --git a/.bazelversion b/.bazelversion index 56b6be4ebb..e7fdef7e2e 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -8.3.1 +8.4.2 diff --git a/.github/workflows/build_and_test_autosd.yml b/.github/workflows/build_and_test_autosd.yml index 6ad6a755d7..48c71a29cb 100644 --- a/.github/workflows/build_and_test_autosd.yml +++ b/.github/workflows/build_and_test_autosd.yml @@ -16,12 +16,9 @@ name: AutoSD - Build & Test on: pull_request: types: [opened, reopened, synchronize] - paths: - - 'integration/**' + merge_group: types: [checks_requested] - paths: - - 'integration/**' jobs: build: @@ -43,7 +40,7 @@ jobs: - name: Build Showcases RPMs run: | bazel build --config autosd-x86_64 //images/autosd_x86_64:score-reference-integration - working-directory: ./integration/images/autosd_x86_64 + working-directory: ./images/autosd_x86_64 - name: Copy RPMs run: | @@ -52,13 +49,12 @@ jobs: cp bazel-bin/images/autosd_x86_64/score-reference-integration-0.6.0-1.x86_64.rpm ./images/autosd_x86_64/build/rpms createrepo_c ./images/autosd_x86_64/build/rpms/ ls -l ./images/autosd_x86_64/build/rpms/ - working-directory: ./integration - name: Install AIB Tools run: | curl -o auto-image-builder.sh "https://gitlab.com/CentOS/automotive/src/automotive-image-builder/-/raw/main/auto-image-builder.sh?ref_type=heads" chmod +x auto-image-builder.sh - working-directory: ./integration/images/autosd_x86_64/build + working-directory: ./images/autosd_x86_64/build - name: Build AutoSD QEMU (x86_64) run: | @@ -78,7 +74,7 @@ jobs: sudo -E ./auto-image-builder.sh to-disk-image localhost/score:latest _build/disk.qcow2 sudo chown $(id -u):$(id -u) _build/disk.qcow2 - working-directory: ./integration/images/autosd_x86_64/build + working-directory: ./images/autosd_x86_64/build - name: Enable KVM group perms run: | @@ -95,7 +91,7 @@ jobs: ./scripts/run_qemu sshcmd 'cat /etc/os-release' - working-directory: ./integration/images/autosd_x86_64/build + working-directory: ./images/autosd_x86_64/build env: SSH_PASSWORD: password @@ -103,4 +99,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: autosd10-score-reference_integration-x86_64.qcow2 - path: integration/images/autosd_x86_64/build/_build/disk.qcow2 + path: images/autosd_x86_64/build/_build/disk.qcow2 diff --git a/.github/workflows/build_and_test_ebclfsa.yml b/.github/workflows/build_and_test_ebclfsa.yml index 1d644ab69d..afa3d003e8 100644 --- a/.github/workflows/build_and_test_ebclfsa.yml +++ b/.github/workflows/build_and_test_ebclfsa.yml @@ -16,12 +16,8 @@ name: EB Corbos Linux for Safety Applications - Build & Test on: pull_request: types: [opened, reopened, synchronize] - paths: - - 'integration/**' merge_group: types: [checks_requested] - paths: - - 'integration/**' jobs: build: @@ -37,7 +33,6 @@ jobs: - name: Build for EB corbos Linux for Safety Applications and run tests run: | bazel build --config=eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:run - working-directory: ./integration - name: Upload test logs uses: actions/upload-artifact@v5 diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/build_and_test_linux.yml similarity index 77% rename from .github/workflows/unit_tests.yml rename to .github/workflows/build_and_test_linux.yml index 4675e727e6..1a5460a74e 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/build_and_test_linux.yml @@ -11,7 +11,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -name: Execute Unit Tests +name: Quality check on x86_64 Linux on: workflow_dispatch: pull_request: @@ -21,7 +21,7 @@ on: branches: - main jobs: - integration_test: + quality_checks: runs-on: ubuntu-latest permissions: contents: write # required to upload release assets @@ -57,18 +57,31 @@ jobs: disk-cache: ${{ github.workflow }} repository-cache: true - - name: Bazel build targets + - name: Build image run: | - scripts/run_unit_tests.sh - cat _logs/ut_summary.md + bazel build --config=linux-x86_64 //images/linux_x86_64:image + + - name: Execute Unit Tests + run: | + python3 ./scripts/quality_runners.py --unit-tests + + - name: Execute Coverage Analysis + run: | + python3 ./scripts/quality_runners.py --coverage - name: Publish build summary if: always() run: | - if [ -f _logs/ut_summary.md ]; then - cat _logs/ut_summary.md >> "$GITHUB_STEP_SUMMARY" + if [ -f docs/verification/unit_test_summary.md ]; then + cat docs/verification/unit_test_summary.md >> "$GITHUB_STEP_SUMMARY" + else + echo "No build summary file found (docs/verification/unit_test_summary.md)" >> "$GITHUB_STEP_SUMMARY" + fi + echo "" >> "$GITHUB_STEP_SUMMARY" # Add a newline for better formatting + if [ -f docs/verification/coverage_summary.md ]; then + cat docs/verification/coverage_summary.md >> "$GITHUB_STEP_SUMMARY" else - echo "No build summary file found (_logs/ut_summary.md)" >> "$GITHUB_STEP_SUMMARY" + echo "No coverage summary file found (docs/verification/coverage_summary.md)" >> "$GITHUB_STEP_SUMMARY" fi - name: Upload logs artifact diff --git a/.github/workflows/build_and_test_qnx.yml b/.github/workflows/build_and_test_qnx.yml index a1509c5120..2df5464d78 100644 --- a/.github/workflows/build_and_test_qnx.yml +++ b/.github/workflows/build_and_test_qnx.yml @@ -15,12 +15,9 @@ name: QNX8 - Build & Test on: pull_request_target: types: [opened, reopened, synchronize] - paths: - - 'integration/**' + merge_group: types: [checks_requested] - paths: - - 'integration/**' jobs: qnx-build-x86_64: @@ -62,7 +59,6 @@ jobs: SCORE_QNX_PASSWORD: ${{ secrets.SCORE_QNX_PASSWORD }} run: | bazel build --config qnx-x86_64 //images/qnx_x86_64:image - working-directory: ./integration - name: Cleanup QNX license if: always() diff --git a/.github/workflows/known_good_correct.yml b/.github/workflows/known_good_correct.yml new file mode 100644 index 0000000000..83c7e88cf4 --- /dev/null +++ b/.github/workflows/known_good_correct.yml @@ -0,0 +1,42 @@ +# ******************************************************************************* +# Copyright (c) 2025 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 +# ******************************************************************************* + +name: Known Good Matches Bazel + +on: + pull_request: + types: [opened, reopened, synchronize] + merge_group: + types: [checks_requested] + +permissions: + contents: write + +jobs: + check-known-good-matches-bazel: + name: Check Known Good Matches with Bazel + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + - name: Check + run: | + ls -la + scripts/known_good/update_module_from_known_good.py --known known_good.json --output-dir integration/bazel_common + if git diff --quiet; then + echo "No changes" + else + echo "You have committed not aligned known_good.json to the code. Please run scripts/known_good/update_module_from_known_good.py and commit the changes to the code. Here are the differences:" + git diff + exit 1 + fi diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index f1e67e95ab..96850ed2d2 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -23,6 +23,7 @@ on: # - cron: '30 2 * * *' # Every night at 02:30 UTC on main branch jobs: integration_test: + if: false # Temporarily disabled until we get things sorted out uses: ./.github/workflows/reusable_smoke-test.yml secrets: inherit with: diff --git a/.gitignore b/.gitignore index 379315e0cc..a135a99038 100644 --- a/.gitignore +++ b/.gitignore @@ -27,4 +27,5 @@ __pycache__/ /score_*/ /.gita/ /.gita-workspace.csv -integration/build +build +artifacts diff --git a/BUILD b/BUILD index 2d6570fe8e..f8273c8126 100644 --- a/BUILD +++ b/BUILD @@ -19,16 +19,9 @@ docs( #"@score_persistency//:needs_json", # cannot be included, as it does not contain any needs? #"@score_orchestrator//:needs_json", # some issue about score_toolchains_qnx? #"@score_communication//:needs_json", # no docs yet? - "@score_feo//:needs_json", + # "@score_feo//:needs_json", "@score_docs_as_code//:needs_json", "@score_process//:needs_json", ], source_dir = "docs", ) - -# Simple filegroup target to demonstrate the build system works -filegroup( - name = "readme", - srcs = ["README.md"], - visibility = ["//visibility:public"], -) diff --git a/MODULE.bazel b/MODULE.bazel index 2b7e74e276..02649e7c24 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -10,53 +10,55 @@ # # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* - module( - name = "score_reference_integration", - version = "0.5.0-beta", + name = "score_ref_int", + version = "0.0.1", compatibility_level = 0, ) -include("//:score_modules.MODULE.bazel") -include("//:score_toolchains.MODULE.bazel") +# Include common modules +include("//bazel_common:score_basic_bazel.MODULE.bazel") -## Python -bazel_dep(name = "rules_python", version = "1.8.3") +# GCC toolchains +include ("//bazel_common:score_gcc_toolchains.MODULE.bazel") # WIP: Not used yet as have problems with IFS toolchain -PYTHON_VERSION = "3.12" +# GCC toolchains +include ("//bazel_common:score_qnx_toolchains.MODULE.bazel") # WIP: Not used yet as have problems with IFS toolchain -python = use_extension("@rules_python//python/extensions:python.bzl", "python") -python.toolchain( - configure_coverage_tool = True, - is_default = True, - python_version = PYTHON_VERSION, -) -use_repo(python) +# Rust toolchains +include ("//bazel_common:score_rust_toolchains.MODULE.bazel") + +# Python support +include("//bazel_common:score_python.MODULE.bazel") + +# Score modules tools +include("//bazel_common:score_modules_tooling.MODULE.bazel") -# Special imports for certain modules +# Score modules +include("//bazel_common:score_modules_target_sw.MODULE.bazel") -# communication module dependencies -# archive_override are not forwarded by bazel_dep, so we need to redefine it here bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") archive_override( module_name = "rules_boost", - strip_prefix = "rules_boost-master", urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"], + strip_prefix = "rules_boost-master", ) -# git_override are not forwarded by bazel_dep, so we need to redefine it here -bazel_dep(name = "trlc") +# TRLC dependency for requirements traceability +bazel_dep(name = "trlc", version = "0.0.0") git_override( module_name = "trlc", - remote = "https://github.com/bmw-software-engineering/trlc.git", commit = "650b51a47264a4f232b3341f473527710fc32669", # trlc-2.0.2 release + remote = "https://github.com/bmw-software-engineering/trlc.git", ) -# imports for the feature showcase module -bazel_dep(name = "rules_rust", version = "0.67.0") -bazel_dep(name = "score_itf", version = "0.1.0") -bazel_dep(name = "score_crates", version = "0.0.6") -single_version_override( - module_name = "score_crates", - version = "0.0.6", +# Currently required for ifs tooling +bazel_dep(name = "score_toolchains_qnx", version = "0.0.7") +toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx", dev_dependency=True) +toolchains_qnx.sdp( + sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63", + strip_prefix = "installation", + url = "https://www.qnx.com/download/download/79858/installation.tgz", ) +use_repo(toolchains_qnx, "toolchains_qnx_sdp") +use_repo(toolchains_qnx, "toolchains_qnx_ifs") diff --git a/README.md b/README.md index 8a1e2712c0..c58358601f 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,11 @@ The reference integration workspace serves as a single Bazel build environment t - Prepare for release validation workflows -## Structure of integration folder +## Get started -> [!NOTE] -> For more details about the integration folder structure and deployment showcases, see [integration/README.md](integration/README.md). +Simply run `./score_starter` and select which integration You want to run. Once running, You will be guided by our welcome cli to run selected examples. + +## Structure of repo Intention for each folder is described below @@ -34,7 +35,7 @@ Used to keep `S-CORE` wide **showcases** implementation to showcase S-CORE in ce #### cli Contains a CLI tool to be used on runner that is showcasing the S-CORE functionality. It will provide superior user experience and will guide user to run examples. -How to use it in Your image, look [here](./integration/showcases/cli/README.md) +How to use it in Your image, look [here](./showcases/cli/README.md) ### images Used to keep concrete `images` for given target platform as bazel modules. Each platform shall have it's own folder with name `{platform}_{arch}` ie. `qnx_aarch64`. @@ -46,74 +47,21 @@ This `images` shall: ### runners Used to keep thin logic ro reuse `runners` between images, like docker runner etc. - - - - ## Docs To generate a full documentation of all integrated modules, run: ```bash bazel run //:docs_combo_experimental ``` -## Working Builds ✅ - -The following modules build successfully with the `x86_64-linux` configuration: - -### Baselibs -```bash -bazel build --config x86_64-linux @score_baselibs//score/... --verbose_failures -bazel build --config x86_64-linux @score_baselibs//score/... --verbose_failures -``` - -### Communication -```bash -bazel build --config x86_64-linux @score_communication//score/mw/com:com --verbose_failures -``` - -### Persistency -```bash -bazel build --config x86_64-linux \ - @score_persistency//src/cpp/src/... \ - @score_persistency//src/rust/... \ - --verbose_failures -``` - -> Note: Python tests for `@score_persistency` cannot be built from this integration workspace due to Bazel external repository visibility limitations. The pip extension and Python dependencies must be accessed within their defining module. - -### Orchestration and `kyron` - async runtime for Rust - -```bash -bazel build --config x86_64-linux @score_orchestrator//src/... -``` - -### Lifecycle - -```bash -bazel build --config x86_64-linux @score_lifecycle_health//src/... --verbose_failures -``` - - -## Feature showcase examples -The examples that are aiming to showcase features provided by S-CORE are located in `feature_showcase` folder. -You can run them currently for host platform using `--config x86_64-linux`. - -Execute `bazel query //feature_showcase/...` to obtain list of targets that You can run. - - -```bash -bazel build --config x86_64-linux @score_orchestrator//src/... --verbose_failures -``` - ## Operating system integrations > [!NOTE] -> Integrations of Eclipse S-CORE into reference operating systems are currently realized as **independent Bazel projects**. > Please refer to the README documents in the respective sub-directories for details about the specific integration. -* [QNX](./qnx_qemu/README.md) -* [Red Hat AutoSD](./autosd/build/README.md) -* [Elektrobit corbos Linux for Safety Applications](./ebclfsa/README.md) +* [QNX](./images/qnx_x86_64//README.md) +* [Red Hat AutoSD](./images/autosd_x86_64/build/README.md) +* [Elektrobit corbos Linux for Safety Applications](./images/ebclfsa_aarch64/README.md) +* [Linux x86_64]() ## Workspace support @@ -268,4 +216,4 @@ local_path_override(module_name = "score_tooling", path = "../tooling") Use `scripts/generate_rust_analyzer_support.sh` to generate rust_analyzer settings that will let VS Code work. ## 🗂 Notes -Keep this file updated as integration issues are resolved. Prefer converting ad-hoc shell steps into Bazel rules or documented scripts under `scripts/` for repeatability. +Keep this file updated as integration issues are resolved. Prefer converting ad-hoc shell steps into Bazel rules or documented scripts under `scripts/` for repeatability. \ No newline at end of file diff --git a/integration/BUILD b/bazel_common/BUILD similarity index 100% rename from integration/BUILD rename to bazel_common/BUILD diff --git a/integration/bazel_common/bundlers.bzl b/bazel_common/bundlers.bzl similarity index 100% rename from integration/bazel_common/bundlers.bzl rename to bazel_common/bundlers.bzl diff --git a/integration/bazel_common/score_basic_tools.MODULE.bazel b/bazel_common/score_basic_bazel.MODULE.bazel similarity index 65% rename from integration/bazel_common/score_basic_tools.MODULE.bazel rename to bazel_common/score_basic_bazel.MODULE.bazel index 765853afd0..65b9eeca8b 100644 --- a/integration/bazel_common/score_basic_tools.MODULE.bazel +++ b/bazel_common/score_basic_bazel.MODULE.bazel @@ -1,15 +1,6 @@ bazel_dep(name = "rules_shell", version = "0.6.0") bazel_dep(name = "rules_cc", version = "0.1.1") bazel_dep(name = "rules_pkg", version = "1.2.0") -bazel_dep(name = "score_bazel_platforms", version = "0.0.4") -bazel_dep(name = "score_crates", version = "0.0.6") -git_override( - module_name = "score_crates", - remote = "https://github.com/eclipse-score/score-crates.git", - commit = "ff8f312cd8ac221ff7562496c7f4d6b9b5c8ebb9", -) - - bazel_dep(name = "rules_rpm", version = "0.1.0") git_override( module_name = "rules_rpm", diff --git a/integration/bazel_common/score_gcc_toolchains.MODULE.bazel b/bazel_common/score_gcc_toolchains.MODULE.bazel similarity index 100% rename from integration/bazel_common/score_gcc_toolchains.MODULE.bazel rename to bazel_common/score_gcc_toolchains.MODULE.bazel diff --git a/bazel_common/score_modules.MODULE.bazel b/bazel_common/score_modules.MODULE.bazel new file mode 100644 index 0000000000..3f2ff2d6cc --- /dev/null +++ b/bazel_common/score_modules.MODULE.bazel @@ -0,0 +1,5 @@ + + + + + diff --git a/bazel_common/score_modules_target_sw.MODULE.bazel b/bazel_common/score_modules_target_sw.MODULE.bazel new file mode 100644 index 0000000000..efe73e69f8 --- /dev/null +++ b/bazel_common/score_modules_target_sw.MODULE.bazel @@ -0,0 +1,74 @@ +# ******************************************************************************* +# Copyright (c) 2025 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 +# ******************************************************************************* + +# Generated from known_good.json at 2026-02-10T21:12:42+00:00Z +# Do not edit manually - use scripts/known_good/update_module_from_known_good.py + +bazel_dep(name = "score_baselibs") +single_version_override( + module_name = "score_baselibs", + version = "0.1.3", + patches = [ + "//patches/baselibs:003-acl-fixes-for-aarch64.patch", + "//patches/baselibs:0001-RH-exception-header.patch", + "//patches/baselibs:0002-RH-algorithm-header.patch", + ], + patch_strip = 1, +) + +bazel_dep(name = "score_baselibs_rust") +git_override( + module_name = "score_baselibs_rust", + remote = "https://github.com/eclipse-score/baselibs_rust.git", + commit = "0eba2934fa8b0e1a343ec6bf6f7ff00cec27d81c", +) + +bazel_dep(name = "score_communication") +single_version_override( + module_name = "score_communication", + version = "0.1.1", +) + +bazel_dep(name = "score_persistency") +git_override( + module_name = "score_persistency", + remote = "https://github.com/eclipse-score/persistency.git", + commit = "0037034bf853e5f955f028fab54ed319fb0441c3", +) + +bazel_dep(name = "score_orchestrator") +git_override( + module_name = "score_orchestrator", + remote = "https://github.com/eclipse-score/orchestrator.git", + commit = "18e136c34750c5db707f27f917d52efc7541e087", +) + +bazel_dep(name = "score_kyron") +git_override( + module_name = "score_kyron", + remote = "https://github.com/eclipse-score/kyron.git", + commit = "ed312bdc6a50abc73f97b8c7e2ad4726fed06e81", +) + +bazel_dep(name = "score_lifecycle_health") +git_override( + module_name = "score_lifecycle_health", + remote = "https://github.com/eclipse-score/lifecycle.git", + commit = "84303c2e48c7e8e2481752170efe82d0afd45f1e", +) + +bazel_dep(name = "score_scrample") +single_version_override( + module_name = "score_scrample", + version = "0.1.0", +) diff --git a/bazel_common/score_modules_tooling.MODULE.bazel b/bazel_common/score_modules_tooling.MODULE.bazel new file mode 100644 index 0000000000..a816b8eaa9 --- /dev/null +++ b/bazel_common/score_modules_tooling.MODULE.bazel @@ -0,0 +1,68 @@ +# ******************************************************************************* +# Copyright (c) 2025 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 +# ******************************************************************************* + +# Generated from known_good.json at 2026-02-10T21:12:42+00:00Z +# Do not edit manually - use scripts/known_good/update_module_from_known_good.py + +bazel_dep(name = "score_crates") +single_version_override( + module_name = "score_crates", + version = "0.0.7", +) + +bazel_dep(name = "score_itf") +single_version_override( + module_name = "score_itf", + version = "0.1.0", +) + +bazel_dep(name = "score_tooling") +git_override( + module_name = "score_tooling", + remote = "https://github.com/eclipse-score/tooling.git", + commit = "17671026150db4b4cc1b35e48af81b97e13685e5", +) + +bazel_dep(name = "score_platform") +git_override( + module_name = "score_platform", + remote = "https://github.com/eclipse-score/score.git", + commit = "22aed6f3bb7339fa50cc7e004de3c5af3d2eab6e", +) + +bazel_dep(name = "score_bazel_platforms") +single_version_override( + module_name = "score_bazel_platforms", + version = "0.0.4", +) + +bazel_dep(name = "score_test_scenarios") +git_override( + module_name = "score_test_scenarios", + remote = "https://github.com/eclipse-score/testing_tools.git", + commit = "6b5e85863e8fb5687251c19f5bb81e0a3afdf581", +) + +bazel_dep(name = "score_docs_as_code") +git_override( + module_name = "score_docs_as_code", + remote = "https://github.com/eclipse-score/docs-as-code.git", + commit = "ba006429268e6bd9b856088f7a4217742ed09025", +) + +bazel_dep(name = "score_process") +git_override( + module_name = "score_process", + remote = "https://github.com/eclipse-score/process_description.git", + commit = "6c772cf05a493218a5ac6071361bf0b66c5427b2", +) diff --git a/integration/bazel_common/score_python.MODULE.bazel b/bazel_common/score_python.MODULE.bazel similarity index 100% rename from integration/bazel_common/score_python.MODULE.bazel rename to bazel_common/score_python.MODULE.bazel diff --git a/integration/bazel_common/score_qnx_toolchains.MODULE.bazel b/bazel_common/score_qnx_toolchains.MODULE.bazel similarity index 100% rename from integration/bazel_common/score_qnx_toolchains.MODULE.bazel rename to bazel_common/score_qnx_toolchains.MODULE.bazel diff --git a/integration/bazel_common/score_rust_toolchains.MODULE.bazel b/bazel_common/score_rust_toolchains.MODULE.bazel similarity index 100% rename from integration/bazel_common/score_rust_toolchains.MODULE.bazel rename to bazel_common/score_rust_toolchains.MODULE.bazel diff --git a/build_config.json b/build_config.json deleted file mode 100644 index 0c9c0e7005..0000000000 --- a/build_config.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "modules": { - "score_baselibs": { - "build_targets": "@score_baselibs//score/..." - }, - "score_baselibs_rust": { - "build_targets": "@score_baselibs_rust//src/..." - }, - "score_communication": { - "build_targets": "@score_communication//score/mw/com:com" - }, - "score_persistency": { - "build_targets": "@score_persistency//src/cpp/src/... @score_persistency//src/rust/..." - }, - "score_kyron": { - "build_targets": "@score_kyron//src/..." - }, - "score_orchestrator": { - "build_targets": "@score_orchestrator//src/..." - }, - "score_test_scenarios": { - "build_targets": "@score_test_scenarios//test_scenarios_rust:test_scenarios_rust @score_test_scenarios//test_scenarios_cpp:test_scenarios_cpp" - }, - "score_feo": { - "build_targets": "-- @score_feo//feo/... @score_feo//feo-com/... @score_feo//feo-cpp-build/... @score_feo//feo-cpp-macros/... -@score_feo//feo:libfeo_rust -@score_feo//feo:libfeo_recording_rust -@score_feo//feo-com:libfeo_com_rust -@score_feo//examples/rust/..." - }, - "score_logging": { - "build_targets": "@score_logging//score/mw/log" - }, - "score_lifecycle_health": { - "build_targets": "@score_lifecycle_health//src/..." - } - } -} diff --git a/docs/conf.py b/docs/conf.py index f4e526ffc1..f205767343 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,3 +24,9 @@ "sphinxcontrib.plantuml", "score_sphinx_bundle", ] + +# Enable markdown rendering +source_suffix = { + ".rst": "restructuredtext", + ".md": "markdown", +} diff --git a/docs/index.rst b/docs/index.rst index 2969ed29fa..2365a45c3f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -17,6 +17,11 @@ Reference Integration Documentation Newest Release Notes: :need:`doc__score_v05_beta_release_note` +Verification Reports Summaries +------------------------------ + +.. toctree:: + verification/verification .. if-collection:: score_platform @@ -29,7 +34,7 @@ Newest Release Notes: :need:`doc__score_v05_beta_release_note` place_holder/persistency place_holder/orchestrator place_holder/communication - FEO <_collections/score_feo/docs/index> + .. FEO <_collections/score_feo/docs/index> .. toctree:: :maxdepth: 1 diff --git a/docs/verification/coverage_summary.md b/docs/verification/coverage_summary.md new file mode 100644 index 0000000000..3c03acd6b7 --- /dev/null +++ b/docs/verification/coverage_summary.md @@ -0,0 +1,6 @@ +# Coverage Analysis Summary + +| module | lines | functions | branches | +| --- | --- | --- | --- | +| score_baselibs | 93.0% | 83.1% | 63.5% | +| score_persistency | 95.3% | 96.5% | 63.4% | diff --git a/docs/verification/unit_test_summary.md b/docs/verification/unit_test_summary.md new file mode 100644 index 0000000000..f23d5752ad --- /dev/null +++ b/docs/verification/unit_test_summary.md @@ -0,0 +1,9 @@ +# Unit Test Execution Summary + +| module | passed | failed | skipped | total | +| --- | --- | --- | --- | --- | +| score_baselibs | 24576 | 0 | 29 | 24605 | +| score_baselibs_rust | 7 | 0 | 0 | 7 | +| score_persistency | 1 | 0 | 0 | 1 | +| score_orchestrator | 1 | 0 | 0 | 1 | +| score_kyron | 3 | 0 | 0 | 3 | diff --git a/docs/verification/verification.rst b/docs/verification/verification.rst new file mode 100644 index 0000000000..7005f8a90a --- /dev/null +++ b/docs/verification/verification.rst @@ -0,0 +1,22 @@ +.. + # ******************************************************************************* + # Copyright (c) 2025 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 + # ******************************************************************************* + +Verification Reports Summaries +============================== + +.. toctree:: + :titlesonly: + + Unit Tests Summary + Coverage Analysis Summary diff --git a/integration/bazel_common/BUILD b/feature_integration_tests/BUILD similarity index 100% rename from integration/bazel_common/BUILD rename to feature_integration_tests/BUILD diff --git a/integration/feature_integration_tests/README.md b/feature_integration_tests/README.md similarity index 100% rename from integration/feature_integration_tests/README.md rename to feature_integration_tests/README.md diff --git a/integration/feature_integration_tests/configs/BUILD b/feature_integration_tests/configs/BUILD similarity index 100% rename from integration/feature_integration_tests/configs/BUILD rename to feature_integration_tests/configs/BUILD diff --git a/integration/feature_integration_tests/configs/etc/logging.json b/feature_integration_tests/configs/etc/logging.json similarity index 100% rename from integration/feature_integration_tests/configs/etc/logging.json rename to feature_integration_tests/configs/etc/logging.json diff --git a/integration/feature_integration_tests/configs/etc/mw_com_config.json b/feature_integration_tests/configs/etc/mw_com_config.json similarity index 100% rename from integration/feature_integration_tests/configs/etc/mw_com_config.json rename to feature_integration_tests/configs/etc/mw_com_config.json diff --git a/integration/feature_integration_tests/configs/qemu_target_config.json b/feature_integration_tests/configs/qemu_target_config.json similarity index 100% rename from integration/feature_integration_tests/configs/qemu_target_config.json rename to feature_integration_tests/configs/qemu_target_config.json diff --git a/integration/feature_integration_tests/itf/BUILD b/feature_integration_tests/itf/BUILD similarity index 100% rename from integration/feature_integration_tests/itf/BUILD rename to feature_integration_tests/itf/BUILD diff --git a/integration/feature_integration_tests/itf/test_persistency.py b/feature_integration_tests/itf/test_persistency.py similarity index 100% rename from integration/feature_integration_tests/itf/test_persistency.py rename to feature_integration_tests/itf/test_persistency.py diff --git a/integration/feature_integration_tests/itf/test_scrample.py b/feature_integration_tests/itf/test_scrample.py similarity index 100% rename from integration/feature_integration_tests/itf/test_scrample.py rename to feature_integration_tests/itf/test_scrample.py diff --git a/integration/feature_integration_tests/itf/test_ssh.py b/feature_integration_tests/itf/test_ssh.py similarity index 100% rename from integration/feature_integration_tests/itf/test_ssh.py rename to feature_integration_tests/itf/test_ssh.py diff --git a/integration/feature_integration_tests/test_cases/BUILD b/feature_integration_tests/test_cases/BUILD similarity index 100% rename from integration/feature_integration_tests/test_cases/BUILD rename to feature_integration_tests/test_cases/BUILD diff --git a/integration/feature_integration_tests/test_cases/conftest.py b/feature_integration_tests/test_cases/conftest.py similarity index 100% rename from integration/feature_integration_tests/test_cases/conftest.py rename to feature_integration_tests/test_cases/conftest.py diff --git a/integration/feature_integration_tests/test_cases/fit_scenario.py b/feature_integration_tests/test_cases/fit_scenario.py similarity index 100% rename from integration/feature_integration_tests/test_cases/fit_scenario.py rename to feature_integration_tests/test_cases/fit_scenario.py diff --git a/integration/feature_integration_tests/test_cases/pytest.ini b/feature_integration_tests/test_cases/pytest.ini similarity index 100% rename from integration/feature_integration_tests/test_cases/pytest.ini rename to feature_integration_tests/test_cases/pytest.ini diff --git a/integration/feature_integration_tests/test_cases/requirements.txt b/feature_integration_tests/test_cases/requirements.txt similarity index 100% rename from integration/feature_integration_tests/test_cases/requirements.txt rename to feature_integration_tests/test_cases/requirements.txt diff --git a/integration/feature_integration_tests/test_cases/requirements.txt.lock b/feature_integration_tests/test_cases/requirements.txt.lock similarity index 100% rename from integration/feature_integration_tests/test_cases/requirements.txt.lock rename to feature_integration_tests/test_cases/requirements.txt.lock diff --git a/integration/feature_integration_tests/test_cases/test_properties.py b/feature_integration_tests/test_cases/test_properties.py similarity index 100% rename from integration/feature_integration_tests/test_cases/test_properties.py rename to feature_integration_tests/test_cases/test_properties.py diff --git a/integration/feature_integration_tests/test_cases/tests/basic/test_orchestration_with_persistency.py b/feature_integration_tests/test_cases/tests/basic/test_orchestration_with_persistency.py similarity index 100% rename from integration/feature_integration_tests/test_cases/tests/basic/test_orchestration_with_persistency.py rename to feature_integration_tests/test_cases/tests/basic/test_orchestration_with_persistency.py diff --git a/integration/feature_integration_tests/test_cases/tests/persistency/test_multiple_kvs_per_app.py b/feature_integration_tests/test_cases/tests/persistency/test_multiple_kvs_per_app.py similarity index 100% rename from integration/feature_integration_tests/test_cases/tests/persistency/test_multiple_kvs_per_app.py rename to feature_integration_tests/test_cases/tests/persistency/test_multiple_kvs_per_app.py diff --git a/integration/feature_integration_tests/test_scenarios/rust/BUILD b/feature_integration_tests/test_scenarios/rust/BUILD similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/BUILD rename to feature_integration_tests/test_scenarios/rust/BUILD diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/internals/kyron/mod.rs b/feature_integration_tests/test_scenarios/rust/src/internals/kyron/mod.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/internals/kyron/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/kyron/mod.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/internals/kyron/runtime_helper.rs b/feature_integration_tests/test_scenarios/rust/src/internals/kyron/runtime_helper.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/internals/kyron/runtime_helper.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/kyron/runtime_helper.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/internals/mod.rs b/feature_integration_tests/test_scenarios/rust/src/internals/mod.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/internals/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/mod.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_instance.rs b/feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_instance.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_instance.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_instance.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_parameters.rs b/feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_parameters.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_parameters.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/persistency/kvs_parameters.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/internals/persistency/mod.rs b/feature_integration_tests/test_scenarios/rust/src/internals/persistency/mod.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/internals/persistency/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/internals/persistency/mod.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/main.rs b/feature_integration_tests/test_scenarios/rust/src/main.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/main.rs rename to feature_integration_tests/test_scenarios/rust/src/main.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/scenarios/basic/mod.rs b/feature_integration_tests/test_scenarios/rust/src/scenarios/basic/mod.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/scenarios/basic/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/scenarios/basic/mod.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/scenarios/basic/orchestration_with_persistency.rs b/feature_integration_tests/test_scenarios/rust/src/scenarios/basic/orchestration_with_persistency.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/scenarios/basic/orchestration_with_persistency.rs rename to feature_integration_tests/test_scenarios/rust/src/scenarios/basic/orchestration_with_persistency.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/scenarios/mod.rs b/feature_integration_tests/test_scenarios/rust/src/scenarios/mod.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/scenarios/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/scenarios/mod.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/mod.rs b/feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/mod.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/mod.rs rename to feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/mod.rs diff --git a/integration/feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/multiple_kvs_per_app.rs b/feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/multiple_kvs_per_app.rs similarity index 100% rename from integration/feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/multiple_kvs_per_app.rs rename to feature_integration_tests/test_scenarios/rust/src/scenarios/persistency/multiple_kvs_per_app.rs diff --git a/integration/images/autosd_x86_64/BUILD.bazel b/images/autosd_x86_64/BUILD.bazel similarity index 100% rename from integration/images/autosd_x86_64/BUILD.bazel rename to images/autosd_x86_64/BUILD.bazel diff --git a/integration/images/autosd_x86_64/build/.gitignore b/images/autosd_x86_64/build/.gitignore similarity index 100% rename from integration/images/autosd_x86_64/build/.gitignore rename to images/autosd_x86_64/build/.gitignore diff --git a/integration/images/autosd_x86_64/build/README.md b/images/autosd_x86_64/build/README.md similarity index 100% rename from integration/images/autosd_x86_64/build/README.md rename to images/autosd_x86_64/build/README.md diff --git a/integration/images/autosd_x86_64/build/files/bluechi-agent-main.conf b/images/autosd_x86_64/build/files/bluechi-agent-main.conf similarity index 100% rename from integration/images/autosd_x86_64/build/files/bluechi-agent-main.conf rename to images/autosd_x86_64/build/files/bluechi-agent-main.conf diff --git a/integration/images/autosd_x86_64/build/files/bluechi-agent-qm.conf b/images/autosd_x86_64/build/files/bluechi-agent-qm.conf similarity index 100% rename from integration/images/autosd_x86_64/build/files/bluechi-agent-qm.conf rename to images/autosd_x86_64/build/files/bluechi-agent-qm.conf diff --git a/integration/images/autosd_x86_64/build/files/bluechi-controller.conf b/images/autosd_x86_64/build/files/bluechi-controller.conf similarity index 100% rename from integration/images/autosd_x86_64/build/files/bluechi-controller.conf rename to images/autosd_x86_64/build/files/bluechi-controller.conf diff --git a/integration/images/autosd_x86_64/build/files/lola-ipc-pub.service b/images/autosd_x86_64/build/files/lola-ipc-pub.service similarity index 100% rename from integration/images/autosd_x86_64/build/files/lola-ipc-pub.service rename to images/autosd_x86_64/build/files/lola-ipc-pub.service diff --git a/integration/images/autosd_x86_64/build/files/lola-ipc-sub.service b/images/autosd_x86_64/build/files/lola-ipc-sub.service similarity index 100% rename from integration/images/autosd_x86_64/build/files/lola-ipc-sub.service rename to images/autosd_x86_64/build/files/lola-ipc-sub.service diff --git a/integration/images/autosd_x86_64/build/files/lola-ipc-test b/images/autosd_x86_64/build/files/lola-ipc-test similarity index 100% rename from integration/images/autosd_x86_64/build/files/lola-ipc-test rename to images/autosd_x86_64/build/files/lola-ipc-test diff --git a/integration/images/autosd_x86_64/build/files/lola-ipc-test.service b/images/autosd_x86_64/build/files/lola-ipc-test.service similarity index 100% rename from integration/images/autosd_x86_64/build/files/lola-ipc-test.service rename to images/autosd_x86_64/build/files/lola-ipc-test.service diff --git a/integration/images/autosd_x86_64/build/image.aib.yml b/images/autosd_x86_64/build/image.aib.yml similarity index 100% rename from integration/images/autosd_x86_64/build/image.aib.yml rename to images/autosd_x86_64/build/image.aib.yml diff --git a/integration/images/autosd_x86_64/build/scripts/run_qemu b/images/autosd_x86_64/build/scripts/run_qemu similarity index 100% rename from integration/images/autosd_x86_64/build/scripts/run_qemu rename to images/autosd_x86_64/build/scripts/run_qemu diff --git a/integration/images/autosd_x86_64/build/vars-devel.yml b/images/autosd_x86_64/build/vars-devel.yml similarity index 100% rename from integration/images/autosd_x86_64/build/vars-devel.yml rename to images/autosd_x86_64/build/vars-devel.yml diff --git a/integration/images/autosd_x86_64/build/vars.yml b/images/autosd_x86_64/build/vars.yml similarity index 100% rename from integration/images/autosd_x86_64/build/vars.yml rename to images/autosd_x86_64/build/vars.yml diff --git a/integration/images/ebclfsa_aarch64/BUILD b/images/ebclfsa_aarch64/BUILD similarity index 100% rename from integration/images/ebclfsa_aarch64/BUILD rename to images/ebclfsa_aarch64/BUILD diff --git a/integration/images/ebclfsa_aarch64/README.md b/images/ebclfsa_aarch64/README.md similarity index 100% rename from integration/images/ebclfsa_aarch64/README.md rename to images/ebclfsa_aarch64/README.md diff --git a/integration/images/ebclfsa_aarch64/docs/system_setup.drawio.png b/images/ebclfsa_aarch64/docs/system_setup.drawio.png similarity index 100% rename from integration/images/ebclfsa_aarch64/docs/system_setup.drawio.png rename to images/ebclfsa_aarch64/docs/system_setup.drawio.png diff --git a/integration/images/ebclfsa_aarch64/persistency_integration/BUILD b/images/ebclfsa_aarch64/persistency_integration/BUILD similarity index 100% rename from integration/images/ebclfsa_aarch64/persistency_integration/BUILD rename to images/ebclfsa_aarch64/persistency_integration/BUILD diff --git a/integration/images/ebclfsa_aarch64/persistency_integration/run_qemu.sh b/images/ebclfsa_aarch64/persistency_integration/run_qemu.sh similarity index 100% rename from integration/images/ebclfsa_aarch64/persistency_integration/run_qemu.sh rename to images/ebclfsa_aarch64/persistency_integration/run_qemu.sh diff --git a/integration/images/ebclfsa_aarch64/persistency_integration/scripts/cpp_tests_persistency.sh b/images/ebclfsa_aarch64/persistency_integration/scripts/cpp_tests_persistency.sh similarity index 100% rename from integration/images/ebclfsa_aarch64/persistency_integration/scripts/cpp_tests_persistency.sh rename to images/ebclfsa_aarch64/persistency_integration/scripts/cpp_tests_persistency.sh diff --git a/integration/images/ebclfsa_aarch64/scrample_integration/BUILD b/images/ebclfsa_aarch64/scrample_integration/BUILD similarity index 100% rename from integration/images/ebclfsa_aarch64/scrample_integration/BUILD rename to images/ebclfsa_aarch64/scrample_integration/BUILD diff --git a/integration/images/ebclfsa_aarch64/scrample_integration/etc/logging.json b/images/ebclfsa_aarch64/scrample_integration/etc/logging.json similarity index 100% rename from integration/images/ebclfsa_aarch64/scrample_integration/etc/logging.json rename to images/ebclfsa_aarch64/scrample_integration/etc/logging.json diff --git a/integration/images/ebclfsa_aarch64/scrample_integration/etc/mw_com_config.json b/images/ebclfsa_aarch64/scrample_integration/etc/mw_com_config.json similarity index 100% rename from integration/images/ebclfsa_aarch64/scrample_integration/etc/mw_com_config.json rename to images/ebclfsa_aarch64/scrample_integration/etc/mw_com_config.json diff --git a/integration/images/ebclfsa_aarch64/scrample_integration/run_qemu.sh b/images/ebclfsa_aarch64/scrample_integration/run_qemu.sh similarity index 100% rename from integration/images/ebclfsa_aarch64/scrample_integration/run_qemu.sh rename to images/ebclfsa_aarch64/scrample_integration/run_qemu.sh diff --git a/integration/images/ebclfsa_aarch64/scrample_integration/src/main.cc b/images/ebclfsa_aarch64/scrample_integration/src/main.cc similarity index 100% rename from integration/images/ebclfsa_aarch64/scrample_integration/src/main.cc rename to images/ebclfsa_aarch64/scrample_integration/src/main.cc diff --git a/integration/images/linux_x86_64/BUILD b/images/linux_x86_64/BUILD similarity index 100% rename from integration/images/linux_x86_64/BUILD rename to images/linux_x86_64/BUILD diff --git a/integration/images/qnx_x86_64/BUILD b/images/qnx_x86_64/BUILD similarity index 100% rename from integration/images/qnx_x86_64/BUILD rename to images/qnx_x86_64/BUILD diff --git a/integration/images/qnx_x86_64/build/BUILD b/images/qnx_x86_64/build/BUILD similarity index 100% rename from integration/images/qnx_x86_64/build/BUILD rename to images/qnx_x86_64/build/BUILD diff --git a/integration/images/qnx_x86_64/build/init.build b/images/qnx_x86_64/build/init.build similarity index 100% rename from integration/images/qnx_x86_64/build/init.build rename to images/qnx_x86_64/build/init.build diff --git a/integration/images/qnx_x86_64/build/system.build b/images/qnx_x86_64/build/system.build similarity index 100% rename from integration/images/qnx_x86_64/build/system.build rename to images/qnx_x86_64/build/system.build diff --git a/integration/images/qnx_x86_64/configs/BUILD b/images/qnx_x86_64/configs/BUILD similarity index 100% rename from integration/images/qnx_x86_64/configs/BUILD rename to images/qnx_x86_64/configs/BUILD diff --git a/integration/images/qnx_x86_64/configs/dhcpcd.conf b/images/qnx_x86_64/configs/dhcpcd.conf similarity index 100% rename from integration/images/qnx_x86_64/configs/dhcpcd.conf rename to images/qnx_x86_64/configs/dhcpcd.conf diff --git a/integration/images/qnx_x86_64/configs/group b/images/qnx_x86_64/configs/group similarity index 100% rename from integration/images/qnx_x86_64/configs/group rename to images/qnx_x86_64/configs/group diff --git a/integration/images/qnx_x86_64/configs/hostname b/images/qnx_x86_64/configs/hostname similarity index 100% rename from integration/images/qnx_x86_64/configs/hostname rename to images/qnx_x86_64/configs/hostname diff --git a/integration/images/qnx_x86_64/configs/network_capture.sh b/images/qnx_x86_64/configs/network_capture.sh similarity index 100% rename from integration/images/qnx_x86_64/configs/network_capture.sh rename to images/qnx_x86_64/configs/network_capture.sh diff --git a/integration/images/qnx_x86_64/configs/network_setup.sh b/images/qnx_x86_64/configs/network_setup.sh similarity index 100% rename from integration/images/qnx_x86_64/configs/network_setup.sh rename to images/qnx_x86_64/configs/network_setup.sh diff --git a/integration/images/qnx_x86_64/configs/network_setup_dhcp.sh b/images/qnx_x86_64/configs/network_setup_dhcp.sh similarity index 100% rename from integration/images/qnx_x86_64/configs/network_setup_dhcp.sh rename to images/qnx_x86_64/configs/network_setup_dhcp.sh diff --git a/integration/images/qnx_x86_64/configs/passwd b/images/qnx_x86_64/configs/passwd similarity index 100% rename from integration/images/qnx_x86_64/configs/passwd rename to images/qnx_x86_64/configs/passwd diff --git a/integration/images/qnx_x86_64/configs/pci_hw.cfg b/images/qnx_x86_64/configs/pci_hw.cfg similarity index 100% rename from integration/images/qnx_x86_64/configs/pci_hw.cfg rename to images/qnx_x86_64/configs/pci_hw.cfg diff --git a/integration/images/qnx_x86_64/configs/pci_server.cfg b/images/qnx_x86_64/configs/pci_server.cfg similarity index 100% rename from integration/images/qnx_x86_64/configs/pci_server.cfg rename to images/qnx_x86_64/configs/pci_server.cfg diff --git a/integration/images/qnx_x86_64/configs/profile b/images/qnx_x86_64/configs/profile similarity index 100% rename from integration/images/qnx_x86_64/configs/profile rename to images/qnx_x86_64/configs/profile diff --git a/integration/images/qnx_x86_64/configs/qcrypto.conf b/images/qnx_x86_64/configs/qcrypto.conf similarity index 100% rename from integration/images/qnx_x86_64/configs/qcrypto.conf rename to images/qnx_x86_64/configs/qcrypto.conf diff --git a/integration/images/qnx_x86_64/configs/ssh_host_rsa_key b/images/qnx_x86_64/configs/ssh_host_rsa_key similarity index 100% rename from integration/images/qnx_x86_64/configs/ssh_host_rsa_key rename to images/qnx_x86_64/configs/ssh_host_rsa_key diff --git a/integration/images/qnx_x86_64/configs/ssh_host_rsa_key.pub b/images/qnx_x86_64/configs/ssh_host_rsa_key.pub similarity index 100% rename from integration/images/qnx_x86_64/configs/ssh_host_rsa_key.pub rename to images/qnx_x86_64/configs/ssh_host_rsa_key.pub diff --git a/integration/images/qnx_x86_64/configs/sshd_config b/images/qnx_x86_64/configs/sshd_config similarity index 100% rename from integration/images/qnx_x86_64/configs/sshd_config rename to images/qnx_x86_64/configs/sshd_config diff --git a/integration/images/qnx_x86_64/configs/startup.sh b/images/qnx_x86_64/configs/startup.sh similarity index 100% rename from integration/images/qnx_x86_64/configs/startup.sh rename to images/qnx_x86_64/configs/startup.sh diff --git a/integration/.bazelrc b/integration/.bazelrc deleted file mode 100644 index f03197f6ef..0000000000 --- a/integration/.bazelrc +++ /dev/null @@ -1,47 +0,0 @@ -common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/ -common --registry=https://bcr.bazel.build -common --credential_helper=*.qnx.com=%workspace%/scripts/qnx_credential_helper.py -common --credential_helper_timeout="60s" - -build:_common --@score_baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False -build:_common --@score_baselibs//score/mw/log/flags:KRemote_Logging=False -build:_common --@score_baselibs//score/json:base_library=nlohmann -build:_common --@score_baselibs//score/memory/shared/flags:use_typedshmd=False -build:_common --@score_communication//score/mw/com/flags:tracing_library=stub -build:_common --cxxopt=-Wno-error=mismatched-new-delete -build:_common --host_platform=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix -build:_common --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu -build:_common --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix - -build:qnx-x86_64 --config=_common -build:qnx-x86_64 --noexperimental_merged_skyframe_analysis_execution -build:qnx-x86_64 --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1 -build:qnx-x86_64 --incompatible_enable_cc_toolchain_resolution -build:qnx-x86_64 --incompatible_strict_action_env -build:qnx-x86_64 --sandbox_writable_path=/var/tmp -build:qnx-x86_64 --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix -build:qnx-x86_64 --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0-posix -build:qnx-x86_64 --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64 -build:qnx-x86_64 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800 - -build:itf-qnx-x86_64 --config=qnx-x86_64 -build:itf-qnx-x86_64 --run_under=@score_itf//scripts:run_under_qemu -build:itf-qnx-x86_64 --test_arg="--qemu" -build:itf-qnx-x86_64 --test_arg="--os=qnx" - - -build:linux-x86_64 --config=_common -build:linux-x86_64 --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix -build:linux-x86_64 --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix - -build:eb-aarch64 --config=_common -build:eb-aarch64 --extra_toolchains=@gcc_toolchain//:aarch64_gcc_13 -build:eb-aarch64 --platforms=@score_toolchains_gcc//platforms:aarch64-linux -build:eb-aarch64 --spawn_strategy=local - - -build:autosd-x86_64 --config=_common -build:autosd-x86_64 --platforms=@score_bazel_platforms//:x86_64-linux -build:autosd-x86_64 --force_pic -build:autosd-x86_64 --extra_toolchains=@autosd_10_gcc_repo//:gcc_toolchain_linux_x86_64 -build:autosd-x86_64 --extra_toolchains=@rules_rpm//toolchains:linux_x86_64 diff --git a/integration/.bazelversion b/integration/.bazelversion deleted file mode 100644 index e7fdef7e2e..0000000000 --- a/integration/.bazelversion +++ /dev/null @@ -1 +0,0 @@ -8.4.2 diff --git a/integration/MODULE.bazel b/integration/MODULE.bazel deleted file mode 100644 index 66edd21e04..0000000000 --- a/integration/MODULE.bazel +++ /dev/null @@ -1,61 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2025 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 -# ******************************************************************************* -module( - name = "score_ref_int_qnx_x86_64", - version = "0.0.1", - compatibility_level = 0, -) - -# Include common modules -include("//bazel_common:score_basic_tools.MODULE.bazel") - -# GCC toolchains -include ("//bazel_common:score_gcc_toolchains.MODULE.bazel") # WIP: Not used yet as have problems with IFS toolchain - -# GCC toolchains -include ("//bazel_common:score_qnx_toolchains.MODULE.bazel") # WIP: Not used yet as have problems with IFS toolchain - -# Rust toolchains -include ("//bazel_common:score_rust_toolchains.MODULE.bazel") - -# Python support -include("//bazel_common:score_python.MODULE.bazel") - -# Score modules -include("//bazel_common:score_modules.MODULE.bazel") - -bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost") -archive_override( - module_name = "rules_boost", - urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"], - strip_prefix = "rules_boost-master", -) - -# TRLC dependency for requirements traceability -bazel_dep(name = "trlc", version = "0.0.0") -git_override( - module_name = "trlc", - commit = "650b51a47264a4f232b3341f473527710fc32669", # trlc-2.0.2 release - remote = "https://github.com/bmw-software-engineering/trlc.git", -) - -# Currently required for ifs tooling -bazel_dep(name = "score_toolchains_qnx", version = "0.0.7") -toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx", dev_dependency=True) -toolchains_qnx.sdp( - sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63", - strip_prefix = "installation", - url = "https://www.qnx.com/download/download/79858/installation.tgz", -) -use_repo(toolchains_qnx, "toolchains_qnx_sdp") -use_repo(toolchains_qnx, "toolchains_qnx_ifs") diff --git a/integration/README.md b/integration/README.md deleted file mode 100644 index d9cd398267..0000000000 --- a/integration/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Integration directory - -## Get started - -Simply run `./score_starter` and select which integration You want to run. Once running, You will be guided by our welcome cli to run selected examples. \ No newline at end of file diff --git a/integration/bazel_common/score_modules.MODULE.bazel b/integration/bazel_common/score_modules.MODULE.bazel deleted file mode 100644 index 1d665001d3..0000000000 --- a/integration/bazel_common/score_modules.MODULE.bazel +++ /dev/null @@ -1,43 +0,0 @@ -bazel_dep(name = "score_baselibs", version = "0.1.3") -bazel_dep(name = "score_communication", version = "0.1.1",) # EB needs 0.1.2 but others does not work with it -bazel_dep(name = "score_persistency", version = "0.2.1") -bazel_dep(name = "score_scrample", version = "0.1.0") -bazel_dep(name = "score_itf", version = "0.1.0") -bazel_dep(name = "score_orchestrator") -git_override( - module_name = "score_orchestrator", - remote = "https://github.com/eclipse-score/orchestrator.git", - commit = "18e136c34750c5db707f27f917d52efc7541e087", -) - -bazel_dep(name = "score_kyron") -git_override( - module_name = "score_kyron", - remote = "https://github.com/eclipse-score/kyron.git", - commit = "ed312bdc6a50abc73f97b8c7e2ad4726fed06e81", -) - -git_override( - module_name = "score_persistency", - remote = "https://github.com/eclipse-score/persistency.git", - commit = "0037034bf853e5f955f028fab54ed319fb0441c3", -) - - -single_version_override( - module_name = "score_baselibs", - version = "0.1.3", - patch_strip = 1, - patches = [ - "//patches/baselibs:003-acl-fixes-for-aarch64.patch", - "//patches/baselibs:0001-RH-exception-header.patch", - "//patches/baselibs:0002-RH-algorithm-header.patch", - ], -) - -bazel_dep(name = "score_lifecycle_health") -git_override( - module_name = "score_lifecycle_health", - commit = "84303c2e48c7e8e2481752170efe82d0afd45f1e", - remote = "https://github.com/eclipse-score/lifecycle.git", -) diff --git a/integration/patches/baselibs/BUILD b/integration/patches/baselibs/BUILD deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/integration/scripts/qnx_credential_helper.py b/integration/scripts/qnx_credential_helper.py deleted file mode 120000 index 6b0b73f578..0000000000 --- a/integration/scripts/qnx_credential_helper.py +++ /dev/null @@ -1 +0,0 @@ -../../.github/tools/qnx_credential_helper.py \ No newline at end of file diff --git a/known_good.json b/known_good.json index 8aefbcce54..6cf30a4709 100644 --- a/known_good.json +++ b/known_good.json @@ -1,66 +1,118 @@ { "modules": { - "score_baselibs": { - "repo": "https://github.com/eclipse-score/baselibs.git", - "hash": "ffd1c812213c66a436ed982632f6942528b58be8" + "target_sw": { + "score_baselibs": { + "repo": "https://github.com/eclipse-score/baselibs.git", + "hash": "ffd1c812213c66a436ed982632f6942528b58be8", + "version": "0.1.3", + "bazel_patches": [ + "//patches/baselibs:003-acl-fixes-for-aarch64.patch", + "//patches/baselibs:0001-RH-exception-header.patch", + "//patches/baselibs:0002-RH-algorithm-header.patch" + ], + "metadata": { + "exclude_test_targets": [ + "//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test", + "//score/containers:dynamic_array_test", + "//score/mw/log/configuration:*", + "//score/json/examples:*" + ], + "langs": ["cpp"] + } + }, + "score_baselibs_rust": { + "repo": "https://github.com/eclipse-score/baselibs_rust.git", + "hash": "0eba2934fa8b0e1a343ec6bf6f7ff00cec27d81c", + "metadata": { + "code_root_path": "//src/...", + "langs": ["rust"] + } + }, + "score_communication": { + "repo": "https://github.com/eclipse-score/communication.git", + "hash": "0c0ea032995eaa766f5bdcec031bc02ee10d4587", + "version": "0.1.1", + "metadata": { + "exclude_test_targets": [ + "//score/*" + ] + } + }, + "score_persistency": { + "repo": "https://github.com/eclipse-score/persistency.git", + "hash": "0037034bf853e5f955f028fab54ed319fb0441c3", + "metadata": { + "code_root_path": "//src/...", + "exclude_test_targets": [ + "//src/cpp/tests:bm_kvs_cpp" + ] + } + }, + "score_orchestrator": { + "repo": "https://github.com/eclipse-score/orchestrator.git", + "hash": "18e136c34750c5db707f27f917d52efc7541e087", + "metadata": { + "code_root_path": "//src/...", + "langs": ["rust"] + } + }, + "score_kyron": { + "repo": "https://github.com/eclipse-score/kyron.git", + "hash": "ed312bdc6a50abc73f97b8c7e2ad4726fed06e81", + "metadata": { + "code_root_path": "//src/...", + "langs": ["rust"] + } + }, + "score_lifecycle_health": { + "repo": "https://github.com/eclipse-score/lifecycle.git", + "hash": "84303c2e48c7e8e2481752170efe82d0afd45f1e", + "metadata": { + "code_root_path": "//src/..." + } + }, + "score_scrample": { + "repo": "https://github.com/eclipse-score/scrample.git", + "version": "0.1.0" + } }, - "score_baselibs_rust": { - "repo": "https://github.com/eclipse-score/baselibs_rust.git", - "hash": "0eba2934fa8b0e1a343ec6bf6f7ff00cec27d81c" - }, - "score_communication": { - "repo": "https://github.com/eclipse-score/communication.git", - "hash": "0c0ea032995eaa766f5bdcec031bc02ee10d4587" - }, - "score_logging": { - "repo": "https://github.com/eclipse-score/logging.git", - "hash": "2b3e56cf12cf582d0c0a235cad3d1d9b9fc1e494" - }, - "score_persistency": { - "repo": "https://github.com/eclipse-score/persistency.git", - "hash": "9c1f0c1b1cd9b49621ecf4f9d541ded100fe2c08" - }, - "score_orchestrator": { - "repo": "https://github.com/eclipse-score/orchestrator.git", - "hash": "fd6e21820a361b0c5ab69553f01bd68174d89ffd" - }, - "score_kyron": { - "repo": "https://github.com/eclipse-score/kyron.git", - "hash": "d146401db4557d840850a7b5fc21b0f4fc8aac20" - }, - "score_feo": { - "repo": "https://github.com/eclipse-score/feo.git", - "hash": "4841281ab81aad114cfc86a19a69c029a274f28d", - "branch": "candidate_v0.5" - }, - "score_tooling": { - "repo": "https://github.com/eclipse-score/tooling.git", - "hash": "17671026150db4b4cc1b35e48af81b97e13685e5" - }, - "score_platform": { - "repo": "https://github.com/eclipse-score/score.git", - "hash": "22aed6f3bb7339fa50cc7e004de3c5af3d2eab6e" - }, - "score_bazel_platforms": { - "repo": "https://github.com/eclipse-score/bazel_platforms.git", - "hash": "3ac1b805ba42b58a13f8960f947b7866c8bcf26c" - }, - "score_test_scenarios": { - "repo": "https://github.com/eclipse-score/testing_tools.git", - "hash": "6b5e85863e8fb5687251c19f5bb81e0a3afdf581" - }, - "score_docs_as_code": { - "repo": "https://github.com/eclipse-score/docs-as-code.git", - "hash": "ba006429268e6bd9b856088f7a4217742ed09025" - }, - "score_process": { - "repo": "https://github.com/eclipse-score/process_description.git", - "hash": "6c772cf05a493218a5ac6071361bf0b66c5427b2" - }, - "score_lifecycle_health": { - "repo": "https://github.com/eclipse-score/lifecycle.git", - "hash": "297808cf7c0013e08a0982133a0add1d9b1a9d9e" + "tooling": { + "score_crates": { + "repo": "https://github.com/eclipse-score/score-crates.git", + "version": "0.0.7" + }, + "score_itf": { + "repo": "https://github.com/eclipse-score/itf.git", + "version": "0.1.0" + }, + "score_tooling": { + "repo": "https://github.com/eclipse-score/tooling.git", + "hash": "17671026150db4b4cc1b35e48af81b97e13685e5" + }, + "score_platform": { + "repo": "https://github.com/eclipse-score/score.git", + "hash": "22aed6f3bb7339fa50cc7e004de3c5af3d2eab6e" + }, + "score_bazel_platforms": { + "repo": "https://github.com/eclipse-score/bazel_platforms.git", + "hash": "3ac1b805ba42b58a13f8960f947b7866c8bcf26c", + "version": "0.0.4" + }, + "score_test_scenarios": { + "repo": "https://github.com/eclipse-score/testing_tools.git", + "hash": "6b5e85863e8fb5687251c19f5bb81e0a3afdf581" + }, + "score_docs_as_code": { + "repo": "https://github.com/eclipse-score/docs-as-code.git", + "hash": "ba006429268e6bd9b856088f7a4217742ed09025" + }, + "score_process": { + "repo": "https://github.com/eclipse-score/process_description.git", + "hash": "6c772cf05a493218a5ac6071361bf0b66c5427b2" + } } + + }, "timestamp": "2026-02-10T21:12:42+00:00Z" } diff --git a/integration/patches/baselibs/0001-RH-exception-header.patch b/patches/baselibs/0001-RH-exception-header.patch similarity index 100% rename from integration/patches/baselibs/0001-RH-exception-header.patch rename to patches/baselibs/0001-RH-exception-header.patch diff --git a/integration/patches/baselibs/0002-RH-algorithm-header.patch b/patches/baselibs/0002-RH-algorithm-header.patch similarity index 100% rename from integration/patches/baselibs/0002-RH-algorithm-header.patch rename to patches/baselibs/0002-RH-algorithm-header.patch diff --git a/integration/patches/baselibs/003-acl-fixes-for-aarch64.patch b/patches/baselibs/003-acl-fixes-for-aarch64.patch similarity index 100% rename from integration/patches/baselibs/003-acl-fixes-for-aarch64.patch rename to patches/baselibs/003-acl-fixes-for-aarch64.patch diff --git a/integration/feature_integration_tests/BUILD b/patches/baselibs/BUILD similarity index 100% rename from integration/feature_integration_tests/BUILD rename to patches/baselibs/BUILD diff --git a/integration/patches/baselibs/fix_hard_coded_amd64.patch b/patches/baselibs/fix_hard_coded_amd64.patch similarity index 100% rename from integration/patches/baselibs/fix_hard_coded_amd64.patch rename to patches/baselibs/fix_hard_coded_amd64.patch diff --git a/integration/runners/docker_x86_64/BUILD b/runners/docker_x86_64/BUILD similarity index 100% rename from integration/runners/docker_x86_64/BUILD rename to runners/docker_x86_64/BUILD diff --git a/integration/runners/docker_x86_64/scripts/BUILD b/runners/docker_x86_64/scripts/BUILD similarity index 100% rename from integration/runners/docker_x86_64/scripts/BUILD rename to runners/docker_x86_64/scripts/BUILD diff --git a/integration/runners/docker_x86_64/scripts/run_docker.sh b/runners/docker_x86_64/scripts/run_docker.sh similarity index 100% rename from integration/runners/docker_x86_64/scripts/run_docker.sh rename to runners/docker_x86_64/scripts/run_docker.sh diff --git a/integration/runners/qemu_x86_64/BUILD b/runners/qemu_x86_64/BUILD similarity index 100% rename from integration/runners/qemu_x86_64/BUILD rename to runners/qemu_x86_64/BUILD diff --git a/integration/runners/qemu_x86_64/scripts/BUILD b/runners/qemu_x86_64/scripts/BUILD similarity index 100% rename from integration/runners/qemu_x86_64/scripts/BUILD rename to runners/qemu_x86_64/scripts/BUILD diff --git a/integration/runners/qemu_x86_64/scripts/qnx_wireshark.sh b/runners/qemu_x86_64/scripts/qnx_wireshark.sh similarity index 100% rename from integration/runners/qemu_x86_64/scripts/qnx_wireshark.sh rename to runners/qemu_x86_64/scripts/qnx_wireshark.sh diff --git a/integration/runners/qemu_x86_64/scripts/run_qemu.sh b/runners/qemu_x86_64/scripts/run_qemu.sh similarity index 100% rename from integration/runners/qemu_x86_64/scripts/run_qemu.sh rename to runners/qemu_x86_64/scripts/run_qemu.sh diff --git a/integration/runners/qemu_x86_64/scripts/run_qemu_portforward.sh b/runners/qemu_x86_64/scripts/run_qemu_portforward.sh similarity index 100% rename from integration/runners/qemu_x86_64/scripts/run_qemu_portforward.sh rename to runners/qemu_x86_64/scripts/run_qemu_portforward.sh diff --git a/score_modules.MODULE.bazel b/score_modules.MODULE.bazel deleted file mode 100644 index 8c2d99b2e0..0000000000 --- a/score_modules.MODULE.bazel +++ /dev/null @@ -1,120 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2025 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 -# ******************************************************************************* - -# Generated from known_good.json at 2026-02-10T21:12:42+00:00Z -# Do not edit manually - use scripts/known_good/update_module_from_known_good.py - -bazel_dep(name = "score_baselibs") -git_override( - module_name = "score_baselibs", - remote = "https://github.com/eclipse-score/baselibs.git", - commit = "ffd1c812213c66a436ed982632f6942528b58be8", -) - -bazel_dep(name = "score_baselibs_rust") -git_override( - module_name = "score_baselibs_rust", - remote = "https://github.com/eclipse-score/baselibs_rust.git", - commit = "0eba2934fa8b0e1a343ec6bf6f7ff00cec27d81c", -) - -bazel_dep(name = "score_communication") -git_override( - module_name = "score_communication", - remote = "https://github.com/eclipse-score/communication.git", - commit = "0c0ea032995eaa766f5bdcec031bc02ee10d4587", -) - -bazel_dep(name = "score_logging") -git_override( - module_name = "score_logging", - remote = "https://github.com/eclipse-score/logging.git", - commit = "2b3e56cf12cf582d0c0a235cad3d1d9b9fc1e494", -) - -bazel_dep(name = "score_persistency") -git_override( - module_name = "score_persistency", - remote = "https://github.com/eclipse-score/persistency.git", - commit = "9c1f0c1b1cd9b49621ecf4f9d541ded100fe2c08", -) - -bazel_dep(name = "score_orchestrator") -git_override( - module_name = "score_orchestrator", - remote = "https://github.com/eclipse-score/orchestrator.git", - commit = "fd6e21820a361b0c5ab69553f01bd68174d89ffd", -) - -bazel_dep(name = "score_kyron") -git_override( - module_name = "score_kyron", - remote = "https://github.com/eclipse-score/kyron.git", - commit = "d146401db4557d840850a7b5fc21b0f4fc8aac20", -) - -bazel_dep(name = "score_feo") -git_override( - module_name = "score_feo", - remote = "https://github.com/eclipse-score/feo.git", - commit = "4841281ab81aad114cfc86a19a69c029a274f28d", -) - -bazel_dep(name = "score_tooling") -git_override( - module_name = "score_tooling", - remote = "https://github.com/eclipse-score/tooling.git", - commit = "17671026150db4b4cc1b35e48af81b97e13685e5", -) - -bazel_dep(name = "score_platform") -git_override( - module_name = "score_platform", - remote = "https://github.com/eclipse-score/score.git", - commit = "22aed6f3bb7339fa50cc7e004de3c5af3d2eab6e", -) - -bazel_dep(name = "score_bazel_platforms") -git_override( - module_name = "score_bazel_platforms", - remote = "https://github.com/eclipse-score/bazel_platforms.git", - commit = "3ac1b805ba42b58a13f8960f947b7866c8bcf26c", -) - -bazel_dep(name = "score_test_scenarios") -git_override( - module_name = "score_test_scenarios", - remote = "https://github.com/eclipse-score/testing_tools.git", - commit = "6b5e85863e8fb5687251c19f5bb81e0a3afdf581", -) - -bazel_dep(name = "score_docs_as_code") -git_override( - module_name = "score_docs_as_code", - remote = "https://github.com/eclipse-score/docs-as-code.git", - commit = "ba006429268e6bd9b856088f7a4217742ed09025", -) - -bazel_dep(name = "score_process") -git_override( - module_name = "score_process", - remote = "https://github.com/eclipse-score/process_description.git", - commit = "6c772cf05a493218a5ac6071361bf0b66c5427b2", -) - -bazel_dep(name = "score_lifecycle_health") -git_override( - module_name = "score_lifecycle_health", - remote = "https://github.com/eclipse-score/lifecycle.git", - commit = "297808cf7c0013e08a0982133a0add1d9b1a9d9e", -) diff --git a/integration/score_starter b/score_starter similarity index 100% rename from integration/score_starter rename to score_starter diff --git a/score_toolchains.MODULE.bazel b/score_toolchains.MODULE.bazel deleted file mode 100644 index f3a27898f4..0000000000 --- a/score_toolchains.MODULE.bazel +++ /dev/null @@ -1,60 +0,0 @@ -# ******************************************************************************* -# Copyright (c) 2025 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 -# ******************************************************************************* - - -bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.2.0") -gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True) - -# ******************************************************************************* -# Setting default GCC (CPU:x86_64|OS:Linux|V:12.2.0|ES:posix) -# ******************************************************************************* -gcc.toolchain( - name = "score_gcc_toolchain", - target_cpu = "x86_64", - target_os = "linux", - version = "12.2.0", - use_default_package = True, -) -gcc.toolchain( - name = "score_gcc_aarch64_toolchain", - target_cpu = "aarch64", - target_os = "linux", - use_default_package = True, - version = "12.2.0", -) -gcc.toolchain( - name = "score_qcc_x86_64_toolchain", - sdp_version = "8.0.0", - target_cpu = "x86_64", - target_os = "qnx", - use_default_package = True, - version = "12.2.0", -) -gcc.toolchain( - name = "score_qcc_aarch64_toolchain", - sdp_version = "8.0.0", - target_cpu = "aarch64", - target_os = "qnx", - use_default_package = True, - version = "12.2.0", -) -use_repo( - gcc, - "score_gcc_aarch64_toolchain", - "score_gcc_x86_64_toolchain", - "score_qcc_aarch64_toolchain", - "score_qcc_x86_64_toolchain", -) - - -bazel_dep(name = "score_toolchains_rust", version = "0.4.0", dev_dependency = True) diff --git a/scripts/known_good/models/__init__.py b/scripts/known_good/models/__init__.py index 838a6f4b29..c6600de577 100644 --- a/scripts/known_good/models/__init__.py +++ b/scripts/known_good/models/__init__.py @@ -1,5 +1,5 @@ """Models for score reference integration tools.""" -from .module import Module +from .module import Module, Metadata -__all__ = ["Module"] +__all__ = ["Module", "Metadata"] diff --git a/scripts/known_good/models/known_good.py b/scripts/known_good/models/known_good.py index 64cb50bb4d..c9e9ced139 100644 --- a/scripts/known_good/models/known_good.py +++ b/scripts/known_good/models/known_good.py @@ -13,35 +13,83 @@ @dataclass class KnownGood: - """Known good configuration with modules and metadata.""" - modules: Dict[str, Module] + """Known good configuration with modules and metadata. + + Supports both flat and grouped module structures: + - Flat: modules = {"default": {"module1": Module, "module2": Module}} + - Grouped: modules = {"group1": {"module1": Module}, "group2": {"module2": Module}} + """ + modules: Dict[str, Dict[str, Module]] timestamp: str - + is_grouped: bool = False + @classmethod def from_dict(cls, data: Dict[str, Any]) -> KnownGood: """Create a KnownGood instance from a dictionary. - + + Automatically detects flat vs grouped structure: + - Flat: {"modules": {"score_baselibs": {...}, "score_logging": {...}}} + - Grouped: {"modules": {"code": {"score_baselibs": {...}}, "abc": {"score_logging": {...}}}} + Args: data: Dictionary containing known_good.json data - + Returns: KnownGood instance """ modules_dict = data.get('modules', {}) - modules_list = Module.parse_modules(modules_dict) - modules = {m.name: m for m in modules_list} timestamp = data.get('timestamp', '') - - return cls(modules=modules, timestamp=timestamp) - + + # Detect if structure is grouped or flat + # Grouped structure: values are dicts containing module configs + # Flat structure: values are module configs directly (have 'repo' or 'version' keys) + is_grouped = False + parsed_modules: Dict[str, Dict[str, Module]] = {} + + if modules_dict: + # Check first entry to determine structure + first_key = next(iter(modules_dict)) + first_value = modules_dict[first_key] + + # If first value is a dict without 'repo' or 'version', it's likely a group + if isinstance(first_value, dict) and not ('repo' in first_value or 'version' in first_value): + # Grouped structure + is_grouped = True + for group_name, group_modules in modules_dict.items(): + if isinstance(group_modules, dict): + modules_list = Module.parse_modules(group_modules) + parsed_modules[group_name] = {m.name: m for m in modules_list} + else: + # Flat structure - use "default" as group name + is_grouped = False + modules_list = Module.parse_modules(modules_dict) + parsed_modules["default"] = {m.name: m for m in modules_list} + + return cls(modules=parsed_modules, timestamp=timestamp, is_grouped=is_grouped) + def to_dict(self) -> Dict[str, Any]: """Convert KnownGood instance to dictionary for JSON output. - + + Preserves the original structure (flat vs grouped). + Returns: Dictionary with known_good configuration """ + if self.is_grouped: + # Grouped structure + modules_output = { + group_name: {name: module.to_dict() for name, module in group_modules.items()} + for group_name, group_modules in self.modules.items() + } + else: + # Flat structure - extract from "default" group + modules_output = { + name: module.to_dict() + for name, module in self.modules.get("default", {}).items() + } + return { - "modules": {name: module.to_dict() for name, module in self.modules.items()}, + "modules": modules_output, "timestamp": self.timestamp } diff --git a/scripts/known_good/models/module.py b/scripts/known_good/models/module.py index 259f4f2861..2180b9fbc8 100644 --- a/scripts/known_good/models/module.py +++ b/scripts/known_good/models/module.py @@ -2,109 +2,186 @@ from __future__ import annotations -from dataclasses import dataclass -from urllib.parse import urlparse -from typing import Any, Dict, List import logging +from dataclasses import dataclass, field +from typing import Any, Dict, List +from urllib.parse import urlparse + + +@dataclass +class Metadata: + """Metadata configuration for a module. + + Attributes: + code_root_path: Root path to the code directory + exclude_test_targets: List of test targets to exclude + langs: List of languages supported (e.g., ["cpp", "rust"]) + """ + + code_root_path: str = "//score/..." + exclude_test_targets: list[str] = field(default_factory=lambda: []) + langs: list[str] = field(default_factory=lambda: ["cpp", "rust"]) + + @classmethod + def from_dict(cls, data: Dict[str, Any]) -> Metadata: + """Create a Metadata instance from a dictionary. + + Args: + data: Dictionary containing metadata configuration + + Returns: + Metadata instance + """ + return cls( + code_root_path=data.get("code_root_path", "//score/..."), + exclude_test_targets=data.get("exclude_test_targets", []), + langs=data.get("langs", ["cpp", "rust"]), + ) + + def to_dict(self) -> Dict[str, Any]: + """Convert Metadata instance to dictionary representation. + + Returns: + Dictionary with metadata configuration + """ + return { + "code_root_path": self.code_root_path, + "exclude_test_targets": self.exclude_test_targets, + "langs": self.langs, + } @dataclass class Module: - name: str - hash: str - repo: str - version: str | None = None - patches: list[str] | None = None - branch: str = "main" - - @classmethod - def from_dict(cls, name: str, module_data: Dict[str, Any]) -> Module: - """Create a Module instance from a dictionary representation. - - Args: - name: The module name - module_data: Dictionary containing module configuration with keys: - - repo (str): Repository URL - - hash or commit (str): Commit hash - - version (str, optional): Module version - - patches (list[str], optional): List of patch files - - branch (str, optional): Git branch name (default: main) - - Returns: - Module instance - """ - repo = module_data.get("repo", "") - # Support both 'hash' and 'commit' keys - commit_hash = module_data.get("hash") or module_data.get("commit", "") - version = module_data.get("version") - patches = module_data.get("patches", []) - branch = module_data.get("branch", "main") - - return cls( - name=name, - hash=commit_hash, - repo=repo, - version=version, - patches=patches if patches else None, - branch=branch - ) - - @classmethod - def parse_modules(cls, modules_dict: Dict[str, Any]) -> List[Module]: - """Parse modules dictionary into Module dataclass instances. - - Args: - modules_dict: Dictionary mapping module names to their configuration data - - Returns: - List of Module instances, skipping invalid modules - """ - modules = [] - for name, module_data in modules_dict.items(): - module = cls.from_dict(name, module_data) - - # Skip modules with missing repo and no version - if not module.repo and not module.version: - logging.warning("Skipping module %s with missing repo", name) - continue - - modules.append(module) - - return modules - - @property - def owner_repo(self) -> str: - """Return owner/repo part extracted from HTTPS GitHub URL.""" - # Examples: - # https://github.com/eclipse-score/logging.git -> eclipse-score/logging - parsed = urlparse(self.repo) - if parsed.netloc != "github.com": - raise ValueError(f"Not a GitHub URL: {self.repo}") - - # Extract path, remove leading slash and .git suffix - path = parsed.path.lstrip("/").removesuffix(".git") - - # Split and validate owner/repo format - parts = path.split("/", 2) # Split max 2 times to get owner and repo - if len(parts) < 2 or not parts[0] or not parts[1]: - raise ValueError(f"Cannot parse owner/repo from: {self.repo}") - - return f"{parts[0]}/{parts[1]}" - - def to_dict(self) -> Dict[str, Any]: - """Convert Module instance to dictionary representation for JSON output. - - Returns: - Dictionary with module configuration - """ - result: Dict[str, Any] = { - "repo": self.repo, - "hash": self.hash - } - if self.version: - result["version"] = self.version - if self.patches: - result["patches"] = self.patches - if self.branch and self.branch != "main": - result["branch"] = self.branch - return result + name: str + hash: str + repo: str + version: str | None = None + bazel_patches: list[str] | None = None + metadata: Metadata = field(default_factory=Metadata) + branch: str = "main" + pin_version: bool = False + + @classmethod + def from_dict(cls, name: str, module_data: Dict[str, Any]) -> Module: + """Create a Module instance from a dictionary representation. + + Args: + name: The module name + module_data: Dictionary containing module configuration with keys: + - repo (str): Repository URL + - hash or commit (str): Commit hash + - version (str, optional): Module version (when present, hash is ignored) + - bazel_patches (list[str], optional): List of patch files for Bazel + - metadata (dict, optional): Metadata configuration + Example: { + "code_root_path": "path/to/code/root", + "exclude_test_targets": [""], + "langs": ["cpp", "rust"] + } + If not present, uses default Metadata values. + - branch (str, optional): Git branch name (default: main) + - pin_version (bool, optional): If true, module hash is not updated + to latest HEAD by update scripts (default: false) + + Returns: + Module instance + """ + repo = module_data.get("repo", "") + # Support both 'hash' and 'commit' keys + commit_hash = module_data.get("hash") or module_data.get("commit", "") + version = module_data.get("version") + # Support both 'bazel_patches' and legacy 'patches' keys + bazel_patches = module_data.get("bazel_patches") or module_data.get( + "patches", [] + ) + + # Parse metadata - if not present or is None/empty dict, use defaults + metadata_data = module_data.get("metadata") + if metadata_data is not None: + metadata = Metadata.from_dict(metadata_data) + # if any("*" in target for target in metadata.exclude_test_targets): + # raise Exception( + # f"Module {name} has wildcard '*' in exclude_test_targets, which is not allowed. " + # "Please specify explicit test targets to exclude or remove the key if no exclusions are needed." + # ) + else: + # If metadata key is missing, create with defaults + metadata = Metadata() + + branch = module_data.get("branch", "main") + pin_version = module_data.get("pin_version", False) + + return cls( + name=name, + hash=commit_hash, + repo=repo, + version=version, + bazel_patches=bazel_patches if bazel_patches else None, + metadata=metadata, + branch=branch, + pin_version=pin_version, + ) + + @classmethod + def parse_modules(cls, modules_dict: Dict[str, Any]) -> List[Module]: + """Parse modules dictionary into Module dataclass instances. + + Args: + modules_dict: Dictionary mapping module names to their configuration data + + Returns: + List of Module instances, skipping invalid modules + """ + modules = [] + for name, module_data in modules_dict.items(): + module = cls.from_dict(name, module_data) + + # Skip modules with missing repo and no version + if not module.repo and not module.version: + logging.warning("Skipping module %s with missing repo", name) + continue + + modules.append(module) + + return modules + + @property + def owner_repo(self) -> str: + """Return owner/repo part extracted from HTTPS GitHub URL.""" + # Examples: + # https://github.com/eclipse-score/logging.git -> eclipse-score/logging + parsed = urlparse(self.repo) + if parsed.netloc != "github.com": + raise ValueError(f"Not a GitHub URL: {self.repo}") + + # Extract path, remove leading slash and .git suffix + path = parsed.path.lstrip("/").removesuffix(".git") + + # Split and validate owner/repo format + parts = path.split("/", 2) # Split max 2 times to get owner and repo + if len(parts) < 2 or not parts[0] or not parts[1]: + raise ValueError(f"Cannot parse owner/repo from: {self.repo}") + + return f"{parts[0]}/{parts[1]}" + + def to_dict(self) -> Dict[str, Any]: + """Convert Module instance to dictionary representation for JSON output. + + Returns: + Dictionary with module configuration + """ + result: Dict[str, Any] = { + "repo": self.repo, + "hash": self.hash, + "metadata": self.metadata.to_dict(), + } + if self.version: + result["version"] = self.version + if self.bazel_patches: + result["bazel_patches"] = self.bazel_patches + if self.branch and self.branch != "main": + result["branch"] = self.branch + if self.pin_version: + result["pin_version"] = True + return result diff --git a/scripts/known_good/update_module_from_known_good.py b/scripts/known_good/update_module_from_known_good.py index 17cd796e01..0b19dc4b64 100755 --- a/scripts/known_good/update_module_from_known_good.py +++ b/scripts/known_good/update_module_from_known_good.py @@ -38,11 +38,11 @@ def generate_git_override_blocks(modules: List[Module], repo_commit_dict: Dict[s if module.repo in repo_commit_dict: commit = repo_commit_dict[module.repo] - # Generate patches lines if patches exist + # Generate patches lines if bazel_patches exist patches_lines = "" - if module.patches: + if module.bazel_patches: patches_lines = " patches = [\n" - for patch in module.patches: + for patch in module.bazel_patches: patches_lines += f' "{patch}",\n' patches_lines += " ],\n patch_strip = 1,\n" @@ -143,22 +143,28 @@ def generate_file_content(args: argparse.Namespace, modules: List[Module], repo_ def main() -> None: parser = argparse.ArgumentParser( - description="Generate score_modules.MODULE.bazel from known_good.json", + description="Generate score_modules.MODULE.bazel file(s) from known_good.json", formatter_class=argparse.RawDescriptionHelpFormatter, epilog=""" Examples: # Generate MODULE.bazel from known_good.json python3 scripts/known_good/update_module_from_known_good.py - # Use a custom input and output file + # Use a custom input file (generates score_modules_{group}.MODULE.bazel for each group) python3 scripts/known_good/update_module_from_known_good.py \\ - --known custom_known_good.json \\ - --output custom_modules.MODULE.bazel + --known custom_known_good.json + + # Specify output directory for grouped modules + python3 scripts/known_good/update_module_from_known_good.py \\ + --output-dir ./bazel_modules # Preview without writing python3 scripts/known_good/update_module_from_known_good.py --dry-run -Note: To override repository commits, use scripts/known_good/override_known_good_repo.py first. +Note: + - For grouped structure, generates score_modules_{group}.MODULE.bazel for each group + - For flat structure, generates score_modules.MODULE.bazel + - To override repository commits, use scripts/known_good/override_known_good_repo.py first. """ ) parser.add_argument( @@ -168,8 +174,13 @@ def main() -> None: ) parser.add_argument( "--output", - default="score_modules.MODULE.bazel", - help="Output file path (default: score_modules.MODULE.bazel)" + default=None, + help="Output file path (only for flat structure, default: score_modules.MODULE.bazel)" + ) + parser.add_argument( + "--output-dir", + default=".", + help="Output directory for grouped structure files (default: current directory)" ) parser.add_argument( "--dry-run", @@ -192,18 +203,17 @@ def main() -> None: default="git", help="Type of override to use (default: git)" ) - + args = parser.parse_args() - + if args.verbose: logging.getLogger().setLevel(logging.INFO) - + known_path = os.path.abspath(args.known) - output_path = os.path.abspath(args.output) - + if not os.path.exists(known_path): raise SystemExit(f"known_good.json not found at {known_path}") - + # Parse repo overrides repo_commit_dict = {} if args.repo_override: @@ -216,7 +226,7 @@ def main() -> None: ) repo_url, commit_hash = entry.split("@", 1) repo_commit_dict[repo_url] = commit_hash - + # Load known_good.json try: known_good = load_known_good(Path(known_path)) @@ -224,26 +234,52 @@ def main() -> None: raise SystemExit(f"ERROR: {e}") except ValueError as e: raise SystemExit(f"ERROR: {e}") - + if not known_good.modules: raise SystemExit("No modules found in known_good.json") - - # Get modules list - modules = list(known_good.modules.values()) - - # Generate file content - content = generate_file_content(args, modules, repo_commit_dict, known_good.timestamp) - - if args.dry_run: - print(f"Dry run: would write to {output_path}\n") - print("---- BEGIN GENERATED CONTENT ----") - print(content) - print("---- END GENERATED CONTENT ----") - print(f"\nGenerated {len(modules)} git_override entries") - else: - with open(output_path, "w", encoding="utf-8") as f: - f.write(content) - print(f"Generated {output_path} with {len(modules)} {args.override_type}_override entries") + + # Generate files based on structure (flat vs grouped) + output_dir = os.path.abspath(args.output_dir) + os.makedirs(output_dir, exist_ok=True) + + generated_files = [] + total_module_count = 0 + + for group_name, group_modules in known_good.modules.items(): + modules = list(group_modules.values()) + + if not modules: + logging.warning(f"Skipping empty group: {group_name}") + continue + + # Determine output filename + if known_good.is_grouped: + # Grouped structure: score_modules_{group}.MODULE.bazel + output_filename = f"score_modules_{group_name}.MODULE.bazel" + else: + # Flat structure: use --output or default + output_filename = args.output if args.output else "score_modules.MODULE.bazel" + + output_path = os.path.join(output_dir, output_filename) + + # Generate file content + content = generate_file_content(args, modules, repo_commit_dict, known_good.timestamp) + + if args.dry_run: + print(f"\nDry run: would write to {output_path}\n") + print("---- BEGIN GENERATED CONTENT ----") + print(content) + print("---- END GENERATED CONTENT ----") + print(f"\nGenerated {len(modules)} {args.override_type}_override entries for group '{group_name}'") + else: + with open(output_path, "w", encoding="utf-8") as f: + f.write(content) + generated_files.append(output_path) + total_module_count += len(modules) + print(f"Generated {output_path} with {len(modules)} {args.override_type}_override entries") + + if not args.dry_run and generated_files: + print(f"\nSuccessfully generated {len(generated_files)} file(s) with {total_module_count} total modules") if __name__ == "__main__": diff --git a/scripts/known_good/update_module_latest.py b/scripts/known_good/update_module_latest.py index 44006afe60..d5184bd2f0 100755 --- a/scripts/known_good/update_module_latest.py +++ b/scripts/known_good/update_module_latest.py @@ -132,6 +132,10 @@ def main(argv: list[str]) -> int: print("INFO: --no-gh specified; ignoring installed 'gh' CLI", file=sys.stderr) for mod in known_good.modules.values(): + if mod.pin_version: + print(f"{mod.name}: pinned, skipping") + continue + try: branch = mod.branch if mod.branch else args.branch if use_gh: diff --git a/scripts/quality_runners.py b/scripts/quality_runners.py new file mode 100644 index 0000000000..8ea73ddf4d --- /dev/null +++ b/scripts/quality_runners.py @@ -0,0 +1,337 @@ +import argparse +import re +import select +import sys +from dataclasses import dataclass +from pprint import pprint +from subprocess import PIPE, Popen + +from known_good.models.known_good import KnownGood, Path, load_known_good +from known_good.models.module import Module + + +@dataclass +class ProcessResult: + stdout: str + stderr: str + exit_code: int + + +def run_unit_test(known: KnownGood, output_path: Path) -> int: + print("Running unit tests...") + unit_tests_summary = {} + + CURERNTLY_DISABLED_MODULES = [ + "score_communication", + "score_scrample", + "score_logging", + "score_lifecycle_health", + "score_feo", + ] + + for module in known.modules["target_sw"].values(): + if module.name in CURERNTLY_DISABLED_MODULES: + print( + f"Skipping module {module.name} as it is currently disabled for unit tests." + ) + continue + else: + print(f"Testing module: {module.name}") + call = [ + "bazel", + "test", + "--config=unit-tests", + "--test_summary=testcase", + "--test_output=errors", + # "--nocache_test_results", + f"@{module.name}{module.metadata.code_root_path}", + "--", + ] + [ + # Exclude test targets specified in module metadata, if any + f"-@{module.name}{target}" + for target in module.metadata.exclude_test_targets + ] + + result = run_command(call) + unit_tests_summary[module.name] = extract_ut_summary(result.stdout) + unit_tests_summary[module.name] |= {"exit_code": result.exit_code} + + generate_markdown_report( + unit_tests_summary, + title="Unit Test Execution Summary", + columns=["module", "passed", "failed", "skipped", "total"], + output_path=output_path / "unit_test_summary.md", + ) + print("UNIT TEST EXECUTION SUMMARY".center(120, "=")) + pprint(unit_tests_summary, width=120) + + return sum(result["exit_code"] for result in unit_tests_summary.values()) + + +def run_coverage(known: KnownGood, output_path: Path) -> int: + print("Running coverage analysis...") + coverage_summary = {} + + CURERNTLY_DISABLED_MODULES = [ + "score_communication", + "score_scrample", + "score_logging", + "score_lifecycle_health", + "score_feo", + ] + + for module in known.modules["target_sw"].values(): + if module.name in CURERNTLY_DISABLED_MODULES: + print( + f"Skipping module {module.name} as it is currently disabled for coverage analysis." + ) + continue + else: + print(f"Analyzing coverage in module: {module.name}") + + if "cpp" in module.metadata.langs: + result_cpp = cpp_coverage(module, output_path) + coverage_summary[module.name] = extract_coverage_summary(result_cpp.stdout) + coverage_summary[module.name] |= {"exit_code": result_cpp.exit_code} + + generate_markdown_report( + coverage_summary, + title="Coverage Analysis Summary", + columns=["module", "lines", "functions", "branches"], + output_path=Path(__file__).parent.parent + / "docs/verification/coverage_summary.md", + ) + print("COVERAGE ANALYSIS SUMMARY".center(120, "=")) + pprint(coverage_summary, width=120) + + return sum(result["exit_code"] for result in coverage_summary.values()) + + +def cpp_coverage(module: Module, artifact_dir: Path) -> ProcessResult: + # First we need to run bazel coverage to generate the coverage data files + bazel_call = [ + "bazel", + "coverage", + "--config=unit-tests", + f"--instrumentation_filter=@{module.name}", + "--", + f"@{module.name}{module.metadata.code_root_path}", + ] + [ + # Exclude test targets specified in module metadata, if any + f"-@{module.name}{target}" + for target in module.metadata.exclude_test_targets + ] + bazel_result = run_command(bazel_call) + + # Second we need to run genhtml to generate the HTML report and get the summary + # Create dedicated output directory for this module's coverage reports + output_dir = artifact_dir / "cpp" / module.name + output_dir.mkdir(parents=True, exist_ok=True) + # Find input locations + bazel_coverage_output_directory = run_command( + ["bazel", "info", "output_path"] + ).stdout.strip() + bazel_source_directory = run_command( + ["bazel", "info", "output_base"] + ).stdout.strip() + + genhtml_call = [ + "genhtml", + f"{bazel_coverage_output_directory}/_coverage/_coverage_report.dat", + f"--output-directory={output_dir}", + f"--source-directory={bazel_source_directory}", + "--synthesize-missing", + "--show-details", + "--legend", + "--function-coverage", + "--branch-coverage", + ] + genhtml_result = run_command(genhtml_call) + + return genhtml_result + + +def generate_markdown_report( + data: dict[str, dict[str, int]], + title: str, + columns: list[str], + output_path: Path = Path("unit_test_summary.md"), +) -> None: + # Build header and separator + title = f"# {title}\n" + header = "| " + " | ".join(columns) + " |" + separator = "| " + " | ".join("---" for _ in columns) + " |" + + # Build rows + rows = [] + for name, stats in data.items(): + rows.append( + "| " + + " | ".join([name] + [str(stats.get(col, "")) for col in columns[1:]]) + + " |" + ) + + md = "\n".join([title, header, separator] + rows + [""]) + output_path.write_text(md) + + +def extract_ut_summary(logs: str) -> dict[str, int]: + summary = {"passed": 0, "failed": 0, "skipped": 0, "total": 0} + + pattern_summary_line = re.compile(r"Test cases: finished.*") + if match := pattern_summary_line.search(logs): + summary_line = match.group(0) + else: + print("Summary line not found in logs.") + return summary + + pattern_passed = re.compile(r"(\d+) passing") + pattern_skipped = re.compile(r"(\d+) skipped") + pattern_failed = re.compile(r"(\d+) failing") + pattern_total = re.compile(r"out of (\d+) test cases") + + if match := pattern_passed.search(summary_line): + summary["passed"] = int(match.group(1)) + if match := pattern_skipped.search(summary_line): + summary["skipped"] = int(match.group(1)) + if match := pattern_failed.search(summary_line): + summary["failed"] = int(match.group(1)) + if match := pattern_total.search(summary_line): + summary["total"] = int(match.group(1)) + return summary + + +def extract_coverage_summary(logs: str) -> dict[str, str]: + """ + Extract coverage summary from genhtml output. + + Args: + logs: Output from genhtml command + + Returns: + Dictionary with coverage percentages for lines, functions, and branches + """ + summary = {"lines": "", "functions": "", "branches": ""} + + # Pattern to match coverage percentages in genhtml output + # Example: " lines......: 93.0% (1234 of 1327 lines)" + pattern_lines = re.compile(r"lines\.+:\s+([\d.]+%)") + pattern_functions = re.compile(r"functions\.+:\s+([\d.]+%)") + pattern_branches = re.compile(r"branches\.+:\s+([\d.]+%)") + + if match := pattern_lines.search(logs): + summary["lines"] = match.group(1) + if match := pattern_functions.search(logs): + summary["functions"] = match.group(1) + if match := pattern_branches.search(logs): + summary["branches"] = match.group(1) + + return summary + + +def run_command(command: list[str]) -> ProcessResult: + """ + Run a command and print output live while storing it. + + Args: + command: Command and arguments to execute + + Returns: + ProcessResult containing stdout, stderr, and exit code + """ + + stdout_data = [] + stderr_data = [] + + print(f"Running command: `{' '.join(command)}`") + with Popen(command, stdout=PIPE, stderr=PIPE, text=True, bufsize=1) as p: + # Use select to read from both streams without blocking + streams = { + p.stdout: (stdout_data, sys.stdout), + p.stderr: (stderr_data, sys.stderr), + } + + try: + while p.poll() is None or streams: + # Check which streams have data available + readable, _, _ = select.select(list(streams.keys()), [], [], 0.1) + + for stream in readable: + line = stream.readline() + if line: + storage, output_stream = streams[stream] + print(line, end="", file=output_stream, flush=True) + storage.append(line) + else: + # Stream closed + del streams[stream] + + exit_code = p.returncode + + except Exception: + p.kill() + p.wait() + raise + + return ProcessResult( + stdout="".join(stdout_data), stderr="".join(stderr_data), exit_code=exit_code + ) + + +def parse_arguments() -> argparse.Namespace: + import argparse + + parser = argparse.ArgumentParser(description="Run quality checks on modules.") + parser.add_argument( + "--known-good-path", + type=Path, + default="known_good.json", + help="Path to the known good JSON file", + ) + parser.add_argument( + "--unit-tests", + action="store_true", + help="Run unit tests for all modules specified in the known good file", + ) + parser.add_argument( + "--unit-tests-output-dir", + type=Path, + default=Path(__file__).parent.parent / "docs/verification", + help="Path to the directory for unit test summary output file", + ) + parser.add_argument( + "--coverage", + action="store_true", + help="Run coverage analysis for all modules specified in the known good file", + ) + parser.add_argument( + "--coverage-output-dir", + type=Path, + default=Path(__file__).parent.parent / "artifacts/coverage", + help="Path to the directory for coverage output files", + ) + return parser.parse_args() + + +def main() -> int: + args = parse_arguments() + + known = load_known_good(args.known_good_path.resolve()) + + return_codes = [] + if args.unit_tests: + return_codes.append( + run_unit_test(known=known, output_path=args.unit_tests_output_dir) + ) + if args.coverage: + args.coverage_output_dir.mkdir(parents=True, exist_ok=True) + return_codes.append( + run_coverage(known=known, output_path=args.coverage_output_dir) + ) + + # Return 0 only if all checks passed, 1 if any failed + return 1 if any(return_codes) else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/integration/showcases/BUILD b/showcases/BUILD similarity index 100% rename from integration/showcases/BUILD rename to showcases/BUILD diff --git a/integration/showcases/cli/BUILD b/showcases/cli/BUILD similarity index 100% rename from integration/showcases/cli/BUILD rename to showcases/cli/BUILD diff --git a/integration/showcases/cli/README.md b/showcases/cli/README.md similarity index 100% rename from integration/showcases/cli/README.md rename to showcases/cli/README.md diff --git a/integration/showcases/cli/main.rs b/showcases/cli/main.rs similarity index 100% rename from integration/showcases/cli/main.rs rename to showcases/cli/main.rs diff --git a/integration/showcases/kyron/BUILD b/showcases/kyron/BUILD similarity index 100% rename from integration/showcases/kyron/BUILD rename to showcases/kyron/BUILD diff --git a/integration/showcases/kyron/kyron.score.json b/showcases/kyron/kyron.score.json similarity index 100% rename from integration/showcases/kyron/kyron.score.json rename to showcases/kyron/kyron.score.json diff --git a/integration/showcases/kyron/main.rs b/showcases/kyron/main.rs similarity index 100% rename from integration/showcases/kyron/main.rs rename to showcases/kyron/main.rs diff --git a/integration/showcases/orchestration_persistency/BUILD b/showcases/orchestration_persistency/BUILD similarity index 100% rename from integration/showcases/orchestration_persistency/BUILD rename to showcases/orchestration_persistency/BUILD diff --git a/integration/showcases/orchestration_persistency/main.rs b/showcases/orchestration_persistency/main.rs similarity index 100% rename from integration/showcases/orchestration_persistency/main.rs rename to showcases/orchestration_persistency/main.rs diff --git a/integration/showcases/orchestration_persistency/orch_per.score.json b/showcases/orchestration_persistency/orch_per.score.json similarity index 100% rename from integration/showcases/orchestration_persistency/orch_per.score.json rename to showcases/orchestration_persistency/orch_per.score.json diff --git a/integration/showcases/simple_lifecycle/BUILD b/showcases/simple_lifecycle/BUILD similarity index 100% rename from integration/showcases/simple_lifecycle/BUILD rename to showcases/simple_lifecycle/BUILD diff --git a/integration/showcases/simple_lifecycle/configs/BUILD b/showcases/simple_lifecycle/configs/BUILD similarity index 100% rename from integration/showcases/simple_lifecycle/configs/BUILD rename to showcases/simple_lifecycle/configs/BUILD diff --git a/integration/showcases/simple_lifecycle/configs/cpp_supervised_app_demo.json b/showcases/simple_lifecycle/configs/cpp_supervised_app_demo.json similarity index 100% rename from integration/showcases/simple_lifecycle/configs/cpp_supervised_app_demo.json rename to showcases/simple_lifecycle/configs/cpp_supervised_app_demo.json diff --git a/integration/showcases/simple_lifecycle/configs/hm_demo.json b/showcases/simple_lifecycle/configs/hm_demo.json similarity index 100% rename from integration/showcases/simple_lifecycle/configs/hm_demo.json rename to showcases/simple_lifecycle/configs/hm_demo.json diff --git a/integration/showcases/simple_lifecycle/configs/lm_demo.json b/showcases/simple_lifecycle/configs/lm_demo.json similarity index 100% rename from integration/showcases/simple_lifecycle/configs/lm_demo.json rename to showcases/simple_lifecycle/configs/lm_demo.json diff --git a/integration/showcases/simple_lifecycle/configs/rust_supervised_app_demo.json b/showcases/simple_lifecycle/configs/rust_supervised_app_demo.json similarity index 100% rename from integration/showcases/simple_lifecycle/configs/rust_supervised_app_demo.json rename to showcases/simple_lifecycle/configs/rust_supervised_app_demo.json diff --git a/integration/showcases/simple_lifecycle/lifecycle_signal.sh b/showcases/simple_lifecycle/lifecycle_signal.sh similarity index 100% rename from integration/showcases/simple_lifecycle/lifecycle_signal.sh rename to showcases/simple_lifecycle/lifecycle_signal.sh diff --git a/integration/showcases/simple_lifecycle/simple_lifecycle.score.json b/showcases/simple_lifecycle/simple_lifecycle.score.json similarity index 100% rename from integration/showcases/simple_lifecycle/simple_lifecycle.score.json rename to showcases/simple_lifecycle/simple_lifecycle.score.json diff --git a/integration/showcases/standalone/BUILD b/showcases/standalone/BUILD similarity index 100% rename from integration/showcases/standalone/BUILD rename to showcases/standalone/BUILD