Skip to content

Commit 22dd5aa

Browse files
committed
add typing
1 parent 7f9011b commit 22dd5aa

File tree

4 files changed

+22
-8
lines changed

4 files changed

+22
-8
lines changed

.github/workflows/test_integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# Workflow configuration for S-CORE CI - Bazel Build & Test baselibs
1515
# This workflow runs Bazel build and test when triggered by specific pull request events.
1616

17-
name: Bazel Build some repositories
17+
name: build latest mains
1818
on:
1919
workflow_dispatch:
2020
push:

integration_test.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ echo "" >> "${SUMMARY_FILE}"
104104
overall_warn_total=0
105105
overall_depr_total=0
106106

107+
# Track if any build group failed
108+
any_failed=0
109+
107110
for group in "${!BUILD_TARGET_GROUPS[@]}"; do
108111
targets="${BUILD_TARGET_GROUPS[$group]}"
109112
log_file="${LOG_DIR}/${group}.log"
@@ -117,6 +120,10 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do
117120
set +e
118121
bazel build --config "${CONFIG}" ${targets} --verbose_failures 2>&1 | tee "$log_file"
119122
build_status=${PIPESTATUS[0]}
123+
# Track if any build group failed
124+
if [[ ${build_status} -ne 0 ]]; then
125+
any_failed=1
126+
fi
120127
set -e
121128
echo "::endgroup::" # End Bazel build group
122129
end_ts=$(date +%s)
@@ -158,4 +165,9 @@ echo "| TOTAL | | | ${overall_warn_total} | ${overall_depr_total} | |" >> "${
158165
echo '::group::Build Summary'
159166
echo '=== Build Summary (echo) ==='
160167
cat "${SUMMARY_FILE}" || echo "(Could not read summary file ${SUMMARY_FILE})"
161-
echo '::endgroup::'
168+
echo '::endgroup::'
169+
170+
# Report to GitHub Actions if any build group failed
171+
if [[ ${any_failed} -eq 1 ]]; then
172+
echo "::error::One or more build groups failed. See summary above."
173+
fi

tools/get_module_info.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
import json
55
import sys
6+
from typing import Dict, Any
67

78

8-
def load_module_data(known_good_file, module_name):
9+
def load_module_data(known_good_file: str, module_name: str) -> Dict[str, Any]:
910
"""
1011
Load module data from known_good.json.
1112
@@ -25,7 +26,7 @@ def load_module_data(known_good_file, module_name):
2526
return {}
2627

2728

28-
def get_module_field(module_data, field='hash'):
29+
def get_module_field(module_data: Dict[str, Any], field: str = 'hash') -> str:
2930
"""
3031
Extract a specific field from module data.
3132

tools/update_module_from_known_good.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
import re
1717
from datetime import datetime
1818
import logging
19+
from typing import Dict, List, Any, Optional
1920

2021

21-
def load_known_good(path):
22+
def load_known_good(path: str) -> Dict[str, Any]:
2223
"""Load and parse the known_good.json file."""
2324
with open(path, "r", encoding="utf-8") as f:
2425
data = json.load(f)
@@ -31,7 +32,7 @@ def load_known_good(path):
3132
)
3233

3334

34-
def generate_git_override_blocks(modules_dict, repo_commit_dict):
35+
def generate_git_override_blocks(modules_dict: Dict[str, Any], repo_commit_dict: Dict[str, str]) -> List[str]:
3536
"""Generate bazel_dep and git_override blocks for each module."""
3637
blocks = []
3738

@@ -90,7 +91,7 @@ def generate_git_override_blocks(modules_dict, repo_commit_dict):
9091
return blocks
9192

9293

93-
def generate_file_content(modules, repo_commit_dict, timestamp=None):
94+
def generate_file_content(modules: Dict[str, Any], repo_commit_dict: Dict[str, str], timestamp: Optional[str] = None) -> str:
9495
"""Generate the complete content for score_modules.MODULE.bazel."""
9596
# License header assembled with parenthesis grouping (no indentation preserved in output).
9697
header = (
@@ -124,7 +125,7 @@ def generate_file_content(modules, repo_commit_dict, timestamp=None):
124125
return header + "\n".join(blocks)
125126

126127

127-
def main():
128+
def main() -> None:
128129
parser = argparse.ArgumentParser(
129130
description="Generate score_modules.MODULE.bazel from known_good.json"
130131
)

0 commit comments

Comments
 (0)