mirror of
https://github.com/nolen777/eagle0.git
synced 2026-07-28 21:35:42 +00:00
Move ShardokBattle boundary conversion to ShardokInterfaceGrpcClient (#5471)
* Remove stale proto_converter deps from library/ BUILD files Library code should not depend on proto_converters - those belong at the service layer boundary. Removed 9 stale proto_converter deps that were no longer used by any Scala code. The only remaining proto_converter dep is shardok_battle_converter, which is actually used by ResolveBattleAction.scala (to be fixed in a follow-up PR). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Move ShardokBattle boundary conversion to ShardokInterfaceGrpcClient Previously, BattleResolution contained a proto ShardokBattle, requiring ResolveBattleAction in library/ to depend on ShardokBattleConverter. This violated the boundary principle where proto conversions should happen at the service layer, not in library code. This change: - Updates BattleResolution.battle to use Scala ShardokBattle - Moves the proto-to-Scala conversion into ShardokInterfaceGrpcClient - Removes ShardokBattleConverter dependency from library/ code - Updates tests to use the scalaBattle() helper for conversion This completely removes proto_converters dependencies from library/ (the last one was shardok_battle_converter). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add linter check for library/ proto_converters boundary Adds Rule 3 to check_build_deps.sh that verifies library/ code does not depend on proto_converters. Proto conversions should happen at service boundaries (ShardokInterfaceGrpcClient, EagleServiceImpl, etc.), not in library code. Also updates baseline from 167 to 75 proto deps reflecting recent cleanup. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
# BUILD dependency baseline - updated Sun Jan 18 16:17:22 PST 2026
|
||||
# BUILD dependency baseline - updated Mon Jan 19 22:38:21 PST 2026
|
||||
# Do not increase these numbers - only decrease!
|
||||
library_proto_deps=167
|
||||
library_proto_deps=75
|
||||
|
||||
@@ -75,6 +75,27 @@ check_library_depends_on_proto() {
|
||||
fi
|
||||
}
|
||||
|
||||
# Rule 3: library/ should not depend on proto_converters
|
||||
# Proto conversions should happen at service boundaries, not in library code
|
||||
check_library_depends_on_proto_converters() {
|
||||
echo -e "${YELLOW}Checking: library/ should not depend on proto_converters...${NC}"
|
||||
|
||||
violations=$(bazel query 'deps(//src/main/scala/net/eagle0/eagle/library/...) intersect //src/main/scala/net/eagle0/eagle/model/proto_converters/...' 2>/dev/null | grep "^//" || true)
|
||||
|
||||
if [ -n "$violations" ]; then
|
||||
count=$(echo "$violations" | wc -l | tr -d ' ')
|
||||
echo -e "${RED}VIOLATION: library/ depends on $count proto_converters targets:${NC}"
|
||||
echo "$violations"
|
||||
echo ""
|
||||
echo "Proto conversions should happen at service boundaries (ShardokInterfaceGrpcClient,"
|
||||
echo "EagleServiceImpl, etc.), not in library code."
|
||||
return 1
|
||||
else
|
||||
echo -e "${GREEN}✓ No proto_converters dependencies in library/${NC}"
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
# Count proto deps for tracking deproto progress
|
||||
count_proto_deps() {
|
||||
echo -e "${YELLOW}=== Proto dependency counts ===${NC}"
|
||||
@@ -132,10 +153,12 @@ case "$MODE" in
|
||||
--ci)
|
||||
check_main_depends_on_test || EXIT_CODE=1
|
||||
check_library_depends_on_proto || EXIT_CODE=1
|
||||
check_library_depends_on_proto_converters || EXIT_CODE=1
|
||||
;;
|
||||
--strict)
|
||||
check_main_depends_on_test || EXIT_CODE=1
|
||||
check_proto_baseline || EXIT_CODE=1
|
||||
check_library_depends_on_proto_converters || EXIT_CODE=1
|
||||
;;
|
||||
--update-baseline)
|
||||
update_baseline
|
||||
@@ -143,6 +166,7 @@ case "$MODE" in
|
||||
*)
|
||||
check_main_depends_on_test || EXIT_CODE=1
|
||||
check_library_depends_on_proto
|
||||
check_library_depends_on_proto_converters || EXIT_CODE=1
|
||||
echo ""
|
||||
count_proto_deps
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user