Skip to content

Commit fb6535c

Browse files
committed
add capability to pin modules to branches
1 parent 22dd5aa commit fb6535c

File tree

9 files changed

+79
-71
lines changed

9 files changed

+79
-71
lines changed

.bazelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ common --registry=https://bcr.bazel.build
2020
build --@score_baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False
2121
build --@score_baselibs//score/mw/log/flags:KRemote_Logging=False
2222
build --@score_baselibs//score/json:base_library=nlohmann
23-
build --@communication//score/mw/com/flags:tracing_library=stub
23+
build --@score_communication//score/mw/com/flags:tracing_library=stub
2424

2525
# stop legacy behavior of creating __init__.py files
2626
build --incompatible_default_to_explicit_init_py

.github/workflows/test_integration.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
name: build latest mains
1818
on:
1919
workflow_dispatch:
20-
push:
2120
pull_request:
21+
schedule:
22+
- cron: '30 2 * * *' # Every night at 02:30 UTC on main branch
2223
jobs:
2324
integration_test:
2425
runs-on: ubuntu-latest
@@ -53,7 +54,7 @@ jobs:
5354
repository-cache: true
5455
- name: Update known good commits
5556
run: |
56-
echo "::group::get latest commits from main branches"
57+
echo "::group::get latest commits from module branches"
5758
python3 tools/update_module_latest.py --output known_good.updated.json
5859
cat known_good.updated.json
5960
echo "::endgroup::"

MODULE.bazel

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,15 @@ use_repo(pip, "pip_score_venv_test")
4747

4848
# communication module dependencies
4949
# archive_override are not forwarded by bazel_dep, so we need to redefine it here
50-
# archive_override(
51-
# module_name = "rules_boost",
52-
# strip_prefix = "rules_boost-master",
53-
# urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"],
54-
# )
50+
bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
51+
archive_override(
52+
module_name = "rules_boost",
53+
strip_prefix = "rules_boost-master",
54+
urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"],
55+
)
5556

5657
# git_override are not forwarded by bazel_dep, so we need to redefine it here
58+
bazel_dep(name = "trlc")
5759
git_override(
5860
module_name = "trlc",
5961
remote = "https://github.com/bmw-software-engineering/trlc.git",

integration_test.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ LOG_DIR=${LOG_DIR:-_logs/logs}
1212
SUMMARY_FILE=${SUMMARY_FILE:-_logs/build_summary.md}
1313
KNOWN_GOOD_FILE=""
1414

15+
# maybe move this to known_good.json or a config file later
16+
declare -A BUILD_TARGET_GROUPS=(
17+
[score_baselibs]="@score_baselibs//score/..."
18+
[score_communication]="@score_communication//score/mw/com:com"
19+
[score_persistency]="@score_persistency//src/cpp/src/... @score_persistency//src/rust/..."
20+
#[score_logging]="@score_logging//src/..."
21+
[score_orchestrator]="@score_orchestrator//src/..."
22+
[score_test_scenarios]="@score_test_scenarios//..."
23+
[score_feo]="@score_feo//..."
24+
)
25+
1526
# Parse command line arguments
1627
while [[ $# -gt 0 ]]; do
1728
case $1 in
@@ -63,16 +74,6 @@ get_module_repo() {
6374
python3 "${script_dir}/tools/get_module_info.py" "${known_good_file}" "${module_name}" "repo" 2>/dev/null || echo "N/A"
6475
}
6576

66-
declare -A BUILD_TARGET_GROUPS=(
67-
[score_baselibs]="@score_baselibs//score/..."
68-
[communication]="@communication//score/mw/com:com"
69-
[score_persistency]="@score_persistency//src/cpp/src/... @score_persistency//src/rust/..."
70-
#[score_logging]="@score_logging//src/..."
71-
[score_orchestrator]="@score_orchestrator//src/..."
72-
[score_test_scenarios]="@score_test_scenarios//..."
73-
[score_feo]="@score_feo//..."
74-
)
75-
7677
warn_count() {
7778
# Grep typical compiler and Bazel warnings; adjust patterns as needed.
7879
local file=$1

known_good.json

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@
44
"score_baselibs": {
55
"version": "0.1.3",
66
"repo": "https://github.com/eclipse-score/baselibs.git",
7-
"patches": [
8-
"//:wait_free_stack_fix.patch"
9-
]
7+
"branch": "s_core_release_v0_5_0"
108
},
11-
"communication": {
9+
"score_communication": {
1210
"version": "0.1.1",
13-
"repo": "https://github.com/eclipse-score/communication.git"
11+
"repo": "https://github.com/eclipse-score/communication.git",
12+
"branch": "s_core_release_v0_5_0"
1413
},
1514
"score_persistency": {
1615
"version": "0.2.1",
@@ -43,6 +42,11 @@
4342
"score_process": {
4443
"version": "1.3.1",
4544
"repo": "https://github.com/eclipse-score/process_description.git"
45+
},
46+
"score_feo": {
47+
"version": "1.0.2",
48+
"repo": "https://github.com/eclipse-score/feo.git",
49+
"branch": "candidate_v0.5"
4650
}
4751
},
4852
"manifest_sha256": "4c9b7f...",

known_good.updated.json

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
{
2-
"timestamp": "2025-11-13T10:12:42Z",
2+
"timestamp": "2025-11-25T12:05:14Z",
33
"modules": {
44
"score_baselibs": {
55
"repo": "https://github.com/eclipse-score/baselibs.git",
6-
"hash": "edc4f8841c2210d11ef310049a78644ff3d039a3",
6+
"hash": "9457533471c8f0d4a1bb9435e91ff12c62d19c7c",
77
"patches": [
88
"//:wait_free_stack_fix.patch"
9-
]
9+
],
10+
"branch": "s_core_release_v0_5_0"
1011
},
11-
"communication": {
12+
"score_communication": {
1213
"repo": "https://github.com/eclipse-score/communication.git",
13-
"hash": "ff40e5f1e90ce406b71c664cc6c8e902ab465305"
14+
"hash": "24d6e8916b89dbb405eae0b082348645d190dc18",
15+
"branch": "s_core_release_v0_5_0"
1416
},
1517
"score_persistency": {
1618
"repo": "https://github.com/eclipse-score/persistency.git",
17-
"hash": "7548876ed3e40ec3f3053c57634de68129287e05"
19+
"hash": "6f20545e0bbe90fcc36a0c6783e91a4fd867b110"
1820
},
1921
"score_orchestrator": {
2022
"repo": "https://github.com/eclipse-score/orchestrator.git",
21-
"hash": "7bb94ebae08805ea0a83dcc14f7c17da5ab927e6"
23+
"hash": "acd3cb614d2f97c2e140c776923c8c6623969691"
2224
},
2325
"score_tooling": {
2426
"repo": "https://github.com/eclipse-score/tooling.git",
25-
"hash": "654664dae7df2700fd5840c5ed6c07ac6c61705d"
27+
"hash": "8f025ef11f5ad3ea5b02fdff338a75cbac655ec4"
2628
},
2729
"score_platform": {
2830
"repo": "https://github.com/eclipse-score/score.git",
29-
"hash": "4277c625daca11ef1fe16ffe7670498b354baa72"
31+
"hash": "0d5e37a60ac63a8f2265660f917f7184a6763a48"
3032
},
3133
"score_bazel_platforms": {
3234
"repo": "https://github.com/eclipse-score/bazel_platforms.git",
@@ -38,11 +40,16 @@
3840
},
3941
"score_docs_as_code": {
4042
"repo": "https://github.com/eclipse-score/docs-as-code.git",
41-
"hash": "1067fb67782389b50827f8637a74b1027ece52ee"
43+
"hash": "7e747c91521417c56289eb33b55c33dd1f8e9c77"
4244
},
4345
"score_process": {
4446
"repo": "https://github.com/eclipse-score/process_description.git",
45-
"hash": "e62e4c30808436e790590845f6c297cf605d7649"
47+
"hash": "3bafefc8e81febdaf8e0468716ec2f81d3c12717"
48+
},
49+
"score_feo": {
50+
"repo": "https://github.com/eclipse-score/feo.git",
51+
"hash": "4841281ab81aad114cfc86a19a69c029a274f28d",
52+
"branch": "candidate_v0.5"
4653
}
4754
},
4855
"manifest_sha256": "4c9b7f...",

score_modules.MODULE.bazel

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,52 +11,49 @@
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
1313

14-
# Generated from known_good.json at 2025-11-13T08:26:11Z
14+
# Generated from known_good.json at 2025-11-25T12:05:14Z
1515
# Do not edit manually - use tools/update_module_from_known_good.py
1616

1717
bazel_dep(name = "score_baselibs")
1818
git_override(
1919
module_name = "score_baselibs",
2020
remote = "https://github.com/eclipse-score/baselibs.git",
21-
commit = "edc4f8841c2210d11ef310049a78644ff3d039a3",
22-
patches = [
23-
"//:wait_free_stack_fix.patch",
24-
],
25-
patch_strip = 1,
21+
commit = "9457533471c8f0d4a1bb9435e91ff12c62d19c7c",
2622
)
2723

28-
bazel_dep(name = "communication")
24+
bazel_dep(name = "score_communication")
2925
git_override(
30-
module_name = "communication",
26+
module_name = "score_communication",
3127
remote = "https://github.com/eclipse-score/communication.git",
32-
commit = "ff40e5f1e90ce406b71c664cc6c8e902ab465305",
28+
commit = "24d6e8916b89dbb405eae0b082348645d190dc18",
3329
)
3430

3531
bazel_dep(name = "score_persistency")
3632
git_override(
3733
module_name = "score_persistency",
3834
remote = "https://github.com/eclipse-score/persistency.git",
39-
commit = "7548876ed3e40ec3f3053c57634de68129287e05",
35+
commit = "6f20545e0bbe90fcc36a0c6783e91a4fd867b110",
4036
)
4137

4238
bazel_dep(name = "score_orchestrator")
4339
git_override(
4440
module_name = "score_orchestrator",
4541
remote = "https://github.com/eclipse-score/orchestrator.git",
46-
commit = "7bb94ebae08805ea0a83dcc14f7c17da5ab927e6",
42+
commit = "acd3cb614d2f97c2e140c776923c8c6623969691",
4743
)
4844

4945
bazel_dep(name = "score_tooling")
5046
git_override(
5147
module_name = "score_tooling",
5248
remote = "https://github.com/eclipse-score/tooling.git",
53-
commit = "f36904e8c3d06c0ee761b14877ce7e5f6d3d9edb",
49+
commit = "8f025ef11f5ad3ea5b02fdff338a75cbac655ec4",
5450
)
5551

5652
bazel_dep(name = "score_platform")
57-
single_version_override(
53+
git_override(
5854
module_name = "score_platform",
59-
version = "0.4.2",
55+
remote = "https://github.com/eclipse-score/score.git",
56+
commit = "0d5e37a60ac63a8f2265660f917f7184a6763a48",
6057
)
6158

6259
bazel_dep(name = "score_bazel_platforms")
@@ -77,19 +74,19 @@ bazel_dep(name = "score_docs_as_code")
7774
git_override(
7875
module_name = "score_docs_as_code",
7976
remote = "https://github.com/eclipse-score/docs-as-code.git",
80-
commit = "1067fb67782389b50827f8637a74b1027ece52ee",
77+
commit = "7e747c91521417c56289eb33b55c33dd1f8e9c77",
8178
)
8279

8380
bazel_dep(name = "score_process")
8481
git_override(
8582
module_name = "score_process",
8683
remote = "https://github.com/eclipse-score/process_description.git",
87-
commit = "ea78e6d616adf1f13236c31479a31db813086a77",
84+
commit = "3bafefc8e81febdaf8e0468716ec2f81d3c12717",
8885
)
8986

90-
bazel_dep(name = "score_feo", version = "1.0.2")
91-
single_version_override(
87+
bazel_dep(name = "score_feo")
88+
git_override(
9289
module_name = "score_feo",
93-
version = "1.0.2",
90+
remote = "https://github.com/eclipse-score/feo.git",
91+
commit = "4841281ab81aad114cfc86a19a69c029a274f28d",
9492
)
95-

tools/update_module_latest.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class Module:
5050
repo: str
5151
version: str | None = None
5252
patches: list[str] | None = None
53+
branch: str = "main"
5354

5455
@property
5556
def owner_repo(self) -> str:
@@ -124,6 +125,8 @@ def write_known_good(path: str, original: dict, modules: list[Module]) -> None:
124125
mod_dict = {"repo": m.repo, "hash": m.hash}
125126
if m.patches:
126127
mod_dict["patches"] = m.patches
128+
if m.branch:
129+
mod_dict["branch"] = m.branch
127130
out["modules"][m.name] = mod_dict
128131
with open(path, "w", encoding="utf-8") as f:
129132
json.dump(out, f, indent=4, sort_keys=False)
@@ -163,6 +166,7 @@ def main(argv: list[str]) -> int:
163166
hash_val = m.get("hash", "")
164167
patches = m.get("patches")
165168
repo = m.get("repo")
169+
branch = m.get("branch")
166170
if not repo:
167171
print(f"WARNING: skipping module {name} with missing repo", file=sys.stderr)
168172
continue
@@ -171,7 +175,8 @@ def main(argv: list[str]) -> int:
171175
hash=hash_val,
172176
repo=repo,
173177
version=version,
174-
patches=patches
178+
patches=patches,
179+
branch=branch
175180
))
176181
except KeyError as e:
177182
print(f"WARNING: skipping module {name} missing key {e}: {m}", file=sys.stderr)
@@ -198,17 +203,19 @@ def main(argv: list[str]) -> int:
198203

199204
for mod in modules:
200205
try:
206+
# Use module-specific branch if available, otherwise use command-line branch
207+
branch = mod.branch if mod.branch else args.branch
201208
if use_gh:
202-
latest = fetch_latest_commit_gh(mod.owner_repo, args.branch)
209+
latest = fetch_latest_commit_gh(mod.owner_repo, branch)
203210
else:
204-
latest = fetch_latest_commit(mod.owner_repo, args.branch, token)
205-
updated.append(Module(name=mod.name, hash=latest, repo=mod.repo, version=mod.version, patches=mod.patches))
211+
latest = fetch_latest_commit(mod.owner_repo, branch, token)
212+
updated.append(Module(name=mod.name, hash=latest, repo=mod.repo, version=mod.version, patches=mod.patches, branch=mod.branch))
206213

207214
# Display format: if version exists, show "version -> hash", otherwise "hash -> hash"
208215
if mod.version:
209-
print(f"{mod.name}: {mod.version} -> {latest[:8]} (branch {args.branch})")
216+
print(f"{mod.name}: {mod.version} -> {latest[:8]} (branch {branch})")
210217
else:
211-
print(f"{mod.name}: {mod.hash[:8]} -> {latest[:8]} (branch {args.branch})")
218+
print(f"{mod.name}: {mod.hash[:8]} -> {latest[:8]} (branch {branch})")
212219
except Exception as e: # noqa: BLE001
213220
failures += 1
214221
print(f"ERROR {mod.name}: {e}", file=sys.stderr)

wait_free_stack_fix.patch

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)