Skip to content

Commit 61691b4

Browse files
authored
Manual Analysis Tooling (#147)
* Introduce CC toolchain Without specifying a cc toolchain bazel autodetects the host toolchain. This toolchain is not hermetic. Using it is very unreliable. * Introduce tooling for manual analysis Introduces a tooling for guided manual analysis runs. A manual analysis is scoped by a context. Context are injected via providers. We supply two providers that cover basic use cases. Users may create their own providers for additional use cases. The rule provides two targets, one to update and one to test. If either the context or the analysis is modified the test will fail. This prompts a user to update the analysis. The analysis steps are defined in a yaml file. Updating the analysis will interactively lead the user through the steps. * Ignore JetBrains configs in VCS * Integrate lobster * Add justification support to decision and assertion steps * Update analysis example * Simplify path resolution * Remove fallback Console UI TTYs are common on all modern systems. No need to carry around legacy non-TTY support. Removes the non-TTY support. * Add infrastructure to test lobster provider * Fix lobster status flip on results modification * Fix typo and inconsistencies in example analysis * Simplify import of Runfiles * Update analysis example * Fix path resolution for update step Hardcoding _main leads to problems if used in submodules. * Fix import Match import pattern to other modules. * Improve import of lobster Using repository_rule makes the import more modern and supports bzlmod better. * Harden results reader against malformed JSON When results cannot be read, fail gracefully. * Forward kwargs to internal rules * Add readme for manual analysis tooling * Fix documentation of context provider * Add tool requirements * Add architectural design * Set codeowners for manual_analysis * Fix copyright header in manual_analysis example * Fix formatting in manual_analysis * Add lobster dependency to integration tests Dependencies are not available in the BCR. Therefore, we use git_override to fetch them. git_override only works in the root repository. So we must duplicate it in the integration tests.
1 parent f1380eb commit 61691b4

70 files changed

Lines changed: 9735 additions & 0 deletions

File tree

Some content is hidden

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

.bazelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
66
common --registry=https://bcr.bazel.build
77

8+
common --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux
9+
810
build --java_language_version=17
911
build --tool_java_language_version=17
1012
build --java_runtime_version=remotejdk_17

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@
1717
# Syntax: https://help.github.com/articles/about-codeowners/
1818

1919
/bazel/rules/rules_score/ @castler @hoe-jo @LittleHuba @limdor @ramceb
20+
/manual_analysis/ @castler @hoe-jo @LittleHuba @limdor @ramceb
2021
/plantuml/ @castler @hoe-jo @LittleHuba @limdor @ramceb
2122
/validation/ @castler @hoe-jo @LittleHuba @limdor @ramceb

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ bazel-*
66
MODULE.bazel.lock
77
external
88
.vscode/
9+
.clwb/
910

1011
__pycache__

MODULE.bazel

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,35 @@ bazel_dep(name = "bazel_skylib", version = "1.7.1")
3434
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")
3535
bazel_dep(name = "flatbuffers", version = "25.9.23")
3636

37+
###############################################################################
38+
# CC Toolchain
39+
###############################################################################
40+
41+
bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.3.1", dev_dependency = True)
42+
43+
score_gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True)
44+
score_gcc.toolchain(
45+
name = "score_gcc_x86_64_toolchain",
46+
target_cpu = "x86_64",
47+
target_os = "linux",
48+
use_base_constraints_only = True,
49+
use_default_package = True,
50+
version = "12.2.0",
51+
)
52+
score_gcc.toolchain(
53+
name = "score_qcc_x86_64_toolchain",
54+
sdp_version = "8.0.0",
55+
target_cpu = "x86_64",
56+
target_os = "qnx",
57+
use_default_package = True,
58+
version = "12.2.0",
59+
)
60+
use_repo(
61+
score_gcc,
62+
"score_gcc_x86_64_toolchain",
63+
"score_qcc_x86_64_toolchain",
64+
)
65+
3766
###############################################################################
3867
# Rust Toolchain
3968
###############################################################################
@@ -167,3 +196,27 @@ register_toolchains(
167196
# Dev Dependencies (for testing)
168197
###############################################################################
169198
bazel_dep(name = "score_docs_as_code", version = "3.0.1", dev_dependency = True)
199+
200+
###############################################################################
201+
# Dependencies for Manual Analysis
202+
###############################################################################
203+
pip.parse(
204+
hub_name = "manual_analysis_deps",
205+
python_version = PYTHON_VERSION,
206+
requirements_lock = "//manual_analysis:requirements.txt",
207+
)
208+
use_repo(pip, "manual_analysis_deps")
209+
210+
bazel_dep(name = "trlc", version = "0.0.0")
211+
git_override(
212+
module_name = "trlc",
213+
commit = "c7750ebd0520996e05b9a9bc91eb6a4f62030f22",
214+
remote = "https://github.com/bmw-software-engineering/trlc.git",
215+
)
216+
217+
bazel_dep(name = "lobster", version = "0.0.0")
218+
git_override(
219+
module_name = "lobster",
220+
commit = "56881461f9d3fde2918d1731aa5937aaf64cd67c",
221+
remote = "https://github.com/bmw-software-engineering/lobster.git",
222+
)

bazel/rules/rules_score/test/MODULE.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,17 @@ local_path_override(
6767
register_toolchains(
6868
"//:score_toolchain",
6969
)
70+
71+
bazel_dep(name = "trlc", version = "0.0.0")
72+
git_override(
73+
module_name = "trlc",
74+
commit = "c7750ebd0520996e05b9a9bc91eb6a4f62030f22",
75+
remote = "https://github.com/bmw-software-engineering/trlc.git",
76+
)
77+
78+
bazel_dep(name = "lobster", version = "0.0.0")
79+
git_override(
80+
module_name = "lobster",
81+
commit = "56881461f9d3fde2918d1731aa5937aaf64cd67c",
82+
remote = "https://github.com/bmw-software-engineering/lobster.git",
83+
)

cr_checker/tests/MODULE.bazel

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,18 @@ local_path_override(
4646
path = "../../",
4747
)
4848

49+
bazel_dep(name = "trlc", version = "0.0.0")
50+
git_override(
51+
module_name = "trlc",
52+
commit = "c7750ebd0520996e05b9a9bc91eb6a4f62030f22",
53+
remote = "https://github.com/bmw-software-engineering/trlc.git",
54+
)
55+
56+
bazel_dep(name = "lobster", version = "0.0.0")
57+
git_override(
58+
module_name = "lobster",
59+
commit = "56881461f9d3fde2918d1731aa5937aaf64cd67c",
60+
remote = "https://github.com/bmw-software-engineering/lobster.git",
61+
)
62+
4963
# end Tests

0 commit comments

Comments
 (0)