Skip to content

Commit 882df5e

Browse files
committed
add typing
1 parent 0244911 commit 882df5e

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
@@ -103,6 +103,9 @@ echo "" >> "${SUMMARY_FILE}"
103103
overall_warn_total=0
104104
overall_depr_total=0
105105

106+
# Track if any build group failed
107+
any_failed=0
108+
106109
for group in "${!BUILD_TARGET_GROUPS[@]}"; do
107110
targets="${BUILD_TARGET_GROUPS[$group]}"
108111
log_file="${LOG_DIR}/${group}.log"
@@ -116,6 +119,10 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do
116119
set +e
117120
bazel build --config "${CONFIG}" ${targets} --verbose_failures 2>&1 | tee "$log_file"
118121
build_status=${PIPESTATUS[0]}
122+
# Track if any build group failed
123+
if [[ ${build_status} -ne 0 ]]; then
124+
any_failed=1
125+
fi
119126
set -e
120127
echo "::endgroup::" # End Bazel build group
121128
end_ts=$(date +%s)
@@ -157,4 +164,9 @@ echo "| TOTAL | | | ${overall_warn_total} | ${overall_depr_total} | |" >> "${
157164
echo '::group::Build Summary'
158165
echo '=== Build Summary (echo) ==='
159166
cat "${SUMMARY_FILE}" || echo "(Could not read summary file ${SUMMARY_FILE})"
160-
echo '::endgroup::'
167+
echo '::endgroup::'
168+
169+
# Report to GitHub Actions if any build group failed
170+
if [[ ${any_failed} -eq 1 ]]; then
171+
echo "::error::One or more build groups failed. See summary above."
172+
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)