Skip to content

Feat/sync to origin - #14

Merged
JinnanDuan merged 3 commits into
openBitFun:masterfrom
azi44eo:feat/sync-to-origin
Jun 17, 2026
Merged

Feat/sync to origin#14
JinnanDuan merged 3 commits into
openBitFun:masterfrom
azi44eo:feat/sync-to-origin

Conversation

@azi44eo

@azi44eo azi44eo commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Added test code repository and package fetch address links in the execution history drawer.
    • Enhanced trend chart navigation: clicking failed cases now filters results to show only failed/error cases; clicking total cases displays the full batch.
    • New configuration options for test environment setup including repository URL and package initialization settings.
  • Documentation

    • Updated deployment guide and project structure documentation with new configuration parameters.
    • Enhanced specification documents for execution history fields and dashboard interactions.

azi44eo and others added 3 commits June 17, 2026 11:09
一键生成通报文案中展示 code_branch,便于群通告直接说明本轮执行分支。

Co-authored-by: Cursor <cursoragent@cursor.com>
首页趋势图仅「失败用例数」折线点跳转详细执行历史时附带 case_result 参数,便于直接查看待跟进用例。

Co-authored-by: Cursor <cursoragent@cursor.com>
通过 GET /app/frontend-config 从 .env 下发仓库与取包模板配置,取包链接按行字段拼接且 platform 忽略大小写。

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 90f8bfe2-d9f3-4633-9ac1-bdbcda54220d

📥 Commits

Reviewing files that changed from the base of the PR and between a770258 and b2ea3eb.

📒 Files selected for processing (19)
  • .env.example
  • backend/api/router.py
  • backend/api/v1/app.py
  • backend/core/config.py
  • backend/schemas/app_config.py
  • backend/schemas/batch_report.py
  • backend/services/batch_report_service.py
  • backend/tests/test_package_url.py
  • backend/utils/package_url.py
  • docs/02_prd.md
  • docs/03_deployment_guide.md
  • docs/04_project_structure.md
  • frontend/src/pages/dashboard/DashboardPage.tsx
  • frontend/src/pages/history/HistoryPage.tsx
  • frontend/src/services/index.ts
  • frontend/src/utils/index.ts
  • frontend/src/utils/packageUrl.ts
  • spec/02_history_fields_spec.md
  • spec/09_homepage_batch_status_trend_spec.md

📝 Walkthrough

Walkthrough

Adds four new env vars (TEST_CODE_REPO_URL, PACKAGE_INIT_URL, PACKAGE_NAME_MAC, PACKAGE_NAME_OH) surfaced via a new protected GET /api/v1/app/frontend-config endpoint. Introduces a package URL resolver utility (backend and frontend), aggregates code_branch into batch reports, makes dashboard chart click navigation series-aware, and adds "测试代码仓" and "取包地址" external links to the execution history drawer.

Changes

Frontend Config, Package URL & Drawer External Links

Layer / File(s) Summary
Env vars, Settings fields, and response schemas
.env.example, backend/core/config.py, backend/schemas/app_config.py, backend/schemas/batch_report.py
Four new env vars added to .env.example; Settings gains the four fields; FrontendConfigResponse Pydantic schema created; BatchReportResponse extended with optional code_branch.
GET /app/frontend-config endpoint and router wiring
backend/api/v1/app.py, backend/api/router.py
New protected GET /frontend-config handler with _opt_str normalization returns FrontendConfigResponse from settings; app router imported and registered under /api/v1.
code_branch aggregation in batch report service
backend/services/batch_report_service.py
get_batch_report queries distinct non-empty Ph.code_branch values, trims and joins with , and passes the result into BatchReportResponse.
Package URL resolver — backend and frontend
backend/utils/package_url.py, backend/tests/test_package_url.py, frontend/src/utils/packageUrl.ts, frontend/src/utils/index.ts
resolve_package_url validates template, normalizes branch/batch, dispatches on platform, and substitutes placeholders; backend tests cover all return variants; frontend mirrors logic with a PackageUrlResolve discriminated union; re-exported from utils/index.ts.
Frontend service contracts
frontend/src/services/index.ts
Adds FrontendConfig interface, appApi.frontendConfig() GET call, and code_branch field to BatchReportResponse.
Dashboard series-aware chart click navigation
frontend/src/pages/dashboard/DashboardPage.tsx
Adds FAILED_CASE_RESULTS constant and buildHistoryHref helper; chart click handler reads seriesName to conditionally append case_result=failed&error; guards added for missing dataIndex and batch values.
History page: config fetch, PackageUrlLink, drawer links
frontend/src/pages/history/HistoryPage.tsx
Fetches frontendConfig on mount; adds PackageUrlLink component using resolvePackageUrl; rolling report markdown gains code_branch line; drawer renders "测试代码仓" from frontendConfig and "取包地址" via PackageUrlLink.
Specs and deployment docs
spec/02_history_fields_spec.md, spec/09_homepage_batch_status_trend_spec.md, docs/02_prd.md, docs/03_deployment_guide.md, docs/04_project_structure.md
Spec and PRD updated for chart click behavior and drawer external link rules; deployment guide adds env var examples; project structure doc updated with new config fields, v1/app.py entry, and DashboardPage description.

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant HistoryPage
  participant appApi
  participant FastAPI as FastAPI /app/frontend-config
  participant Settings

  Browser->>HistoryPage: mount
  HistoryPage->>appApi: frontendConfig()
  appApi->>FastAPI: GET /api/v1/app/frontend-config
  FastAPI->>Settings: read TEST_CODE_REPO_URL, PACKAGE_INIT_URL, PACKAGE_NAME_MAC, PACKAGE_NAME_OH
  Settings-->>FastAPI: raw env strings
  FastAPI-->>appApi: FrontendConfigResponse (nulled empty strings)
  appApi-->>HistoryPage: FrontendConfig
  HistoryPage->>HistoryPage: setState(frontendConfig)
  Browser->>HistoryPage: open execution detail drawer
  HistoryPage->>resolvePackageUrl: resolve(frontendConfig, code_branch, start_time, platform)
  resolvePackageUrl-->>HistoryPage: {kind: url|unknown_platform|unavailable}
  HistoryPage-->>Browser: render 测试代码仓 link + 取包地址 link/text
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 A rabbit hops through env and code,
Four new config keys lighten the load.
Click a chart point — branches diverge!
Drawer links emerge from template and merge.
Package URLs bloom, mac or oh
The bunny grins wide and lets the config flow! 🌿

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@JinnanDuan
JinnanDuan merged commit 488d1ac into openBitFun:master Jun 17, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants