Skip to content

v0.4.0 - Multi Game Platform, Robust Engineering & CI/CD

Choose a tag to compare

@github-actions github-actions released this 20 Jan 08:05
· 253 commits to master since this release

简体中文 (Simplified Chinese)

v0.4.0 是一个重要的里程碑版本。在这个版本中,我们不仅完成了多平台架构的重构,支持了 天凤 (Tenhou)、麻雀一番街 (Riichi City) 和 天月麻雀 (Amatsuki),还对工程质量进行了全面升级,包括全新的配置系统、全自动化的 CI/CD 流水线以及近乎翻倍的测试覆盖率。

✨ 新功能

  • 多平台支持 (Multi-Platform Support):
    • 新增了对 天凤 (Tenhou)、麻雀一番街 (Riichi City) 和 天月麻雀 (Amatsuki) 的支持。
    • 通过重构 Bridge 模块,确立了统一的 BaseBridge 接口,方便未来扩展更多平台。
  • 全新配置系统 (Settings System):
    • 采用 Pydantic 完全重构了配置管理,实现了严格的类型检查和验证。
    • 支持 local_settings.py 覆盖默认配置,不再需要直接修改源码。
    • 新增 API 接口,支持通过 API 动态读取和更新配置。
  • 自动化依赖管理:
    • 引入 Dependabot,自动化管理 GitHub Actions、Python (pip) 和前端 (npm) 依赖更新。
  • CI/CD 体系升级:
    • 并行构建: 将 Lint(后端/前端)与测试任务拆分为并行 Job,显著提升流水线速度(~40%)。
    • 发布护航: 新增 Release 前置测试流程,确保只有通过测试的代码才能发布。
    • 测试覆盖率: 集成 Codecov,实时监控代码覆盖率,核心模块覆盖率大幅提升。

⚡ 改进与优化

  • 架构治理:
    • Bridge 模块重构: 将 akagi_ng/bridge 重构为模块化结构,并保持了向后兼容的导入路径。
    • Playwright 客户端优化: 统一了 MajsoulController 和 TenhouController 的接口与导出方式,解决了循环导入问题。
  • 代码质量:
    • 全面采用 Ruff 进行 Python 代码的 Lint 和 Format,统一代码风格。
    • MITM Addon 重命名为 bridge_addon.py 并增强了多平台支持。
  • 用户体验:
    • 优化了前端状态配置结构,确保错误日志和状态消息(如“模型已加载”)展示更准确。

🐛 问题修复

  • 游戏逻辑:
    • 修复了加杠候选(Kakan candidates)在某些情况下不显示的 Bug。
    • 修复了在线模型熔断(Circuit Breaker)日志显示异常的问题。
    • 修复了 14 张手牌开局时 Bridge 处理逻辑错误。
  • 系统兼容性:
    • 强制指定 DataServer 的 MIME Type,解决了 Windows 环境下模块加载失败的问题。

🧪 测试与质量

  • 测试覆盖率翻倍: 新增了超过 127 个测试用例,总数达到 164 个。
  • 全方位验证: 覆盖了所有新增平台(Tenhou/Riichi City/Amatsuki)的 Bridge 解析、核心 Bot 决策逻辑以及 Settings 系统。

English

v0.4.0 is a major milestone. In this release, we not only completed the multi-platform architecture refactor to support Tenhou, Riichi City, and Amatsuki, but also overhauled engineering quality with a brand-new settings system, a fully automated CI/CD pipeline, and nearly doubled test coverage.

✨ New Features

  • Multi-Platform Support:
    • Added support for Tenhou, Riichi City, and Amatsuki.
    • Refactored the Bridge module to establish a unified BaseBridge interface, facilitating future platform extensions.
  • Brand New Settings System:
    • Completely refactored configuration management using Pydantic for strict type checking and validation.
    • Added support for local_settings.py to override defaults, eliminating the need to modify source code.
    • Introduced new APIs for dynamic configuration retrieval and updates.
  • Automated Dependency Management:
    • Integrated Dependabot to automate dependency updates for GitHub Actions, Python (pip), and Frontend (npm).
  • CI/CD Pipeline Overhaul:
    • Parallel Execution: Split Lint (Backend/Frontend) and Test tasks into parallel jobs, boosting pipeline speed by ~40%.
    • Release Guard: Added pre-release testing steps to ensure only fully tested code is released.
    • Test Coverage: Integrated Codecov for real-time coverage tracking.

⚡ Improvements

  • Architecture Governance:
    • Bridge Module Refactor: Restructured akagi_ng/bridge into a modular design while maintaining backward-compatible import paths.
    • Playwright Client Optimization: Unified interfaces and exports for MajsoulController and TenhouController, resolving circular import issues.
  • Code Quality:
    • Adopted Ruff for comprehensive Python linting and formatting.
    • Renamed MITM Addon to bridge_addon.py with enhanced multi-platform support.
  • User Experience:
    • Optimized frontend status configuration to ensure error logs and status messages (e.g., "Model Loaded") are displayed correctly.

🐛 Bug Fixes

  • Game Logic:
    • Fixed a bug where Kakan (added kan) candidates were not displayed in some cases.
    • Fixed abnormal log display for the Online Model Circuit Breaker.
    • Fixed Bridge processing logic errors for 14-tile starting hands.
  • System Compatibility:
    • Enforced MIME Type specification in DataServer to resolve module loading failures on Windows.

🧪 Testing & Quality

  • Doubled Test Coverage: Added over 127 new test cases, bringing the total to 164.
  • Comprehensive Validation: Covered Bridge parsing for all new platforms (Tenhou/Riichi City/Amatsuki), core Bot decision logic, and the Settings system.

Full Changelog: v0.3.1...v0.4.0