Skip to content

refactor(Orion-server): support MR -> multiple tasks, task -> multiple builds#1428

Merged
genedna merged 4 commits into
gitmono-dev:mainfrom
slow2342:refactor/orion-server-logging
Sep 10, 2025
Merged

refactor(Orion-server): support MR -> multiple tasks, task -> multiple builds#1428
genedna merged 4 commits into
gitmono-dev:mainfrom
slow2342:refactor/orion-server-logging

Conversation

@slow2342

@slow2342 slow2342 commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

概要

本 PR 对 orion-server 的任务与构建关系进行了重构。
原先每个 task 只能绑定一个 build,现在一个 MR 可以关联多个 task,每个 task 也可以同时关联多个 build,以支持更灵活的调度与执行流程。

变更内容

  • 数据库 schema 更新
    • 拆分原有 tasks 表为 tasksbuilds 两张表;
    • task 表只存任务信息,builds 表存 build_id 与输出文件等信息;
  • 重构 ORM 与 SQL 查询,支持 task 与多个 build 的关联;
  • 修改核心模块
    • scheduler.rstasks.rsapi.rs 等,适配新的MR-Task-Build关系;
  • 调整日志处理逻辑
    • 确保能够正确关联多个 build 的输出;
  • task_handler 接口调整
    • 需要传入多个build
  • tasks_handler 接口调整
    • 返回格式变更,现在返回多个build,原有status字段移入build内

变更动机

  • 支持单个 MR 下的多任务、多构建并行或增量执行;
  • 为未来更复杂的调度和工作流扩展做好准备;
  • 数据模型更贴近实际业务需求,提升灵活性。

注意事项

  • 部署时需要执行数据库迁移;
  • task_handler 接口变更,需要 mege 端适配。

关联 Issue

Related to #1379

相关人员

@benjamin-747 @Ivanbeethoven @liuyangjuncong20202570

…ingle build

BREAKING CHANGE: Previously, each task was bound to a single build.
Now, tasks can have multiple associated builds. This change modifies
the database schema, task scheduling logic, and API contracts.

Signed-off-by: MYUU <1405758738@qq.com>
Signed-off-by: MYUU <1405758738@qq.com>
@vercel

vercel Bot commented Sep 9, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
mega Ready Ready Preview Comment Sep 10, 2025 3:05am

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the orion-server to support a many-to-many relationship between MRs, tasks, and builds, replacing the previous one-to-one task-build relationship. The changes enable more flexible build scheduling and execution workflows by allowing multiple tasks per MR and multiple builds per task.

  • Database schema restructured to separate tasks and builds into distinct tables with proper foreign key relationships
  • API endpoints updated to handle multiple builds per task with new response formats
  • Task scheduling logic modified to support queuing and dispatching multiple builds

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
orion-server/src/server.rs Updated imports and database operations to use new builds table
orion-server/src/scheduler.rs Refactored task queuing and build management for new data model
orion-server/src/model/tasks.rs Restructured tasks entity with relationships to builds table
orion-server/src/model/builds.rs New builds entity with foreign key relationship to tasks
orion-server/src/api.rs Major API restructuring to handle multiple builds per task
orion-server/db/schema.sql Database schema split into separate tasks and builds tables
jupiter/src/migration/ Database migration files for the schema changes
jupiter/callisto/src/ Updated ORM entities to match new schema
libra/src/command/status.rs Minor code formatting improvements

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread orion-server/src/scheduler.rs
Comment thread orion-server/src/api.rs
Comment thread orion-server/src/api.rs
Comment thread jupiter/src/migration/m20250904_074945_modify_tasks_and_builds.rs

@Ivanbeethoven Ivanbeethoven left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread jupiter/src/migration/m20250904_074945_modify_tasks_and_builds.rs
…e builds

- Fixed Clippy warning in worker dispatch
- Changed args field type from array to json_binary for SQLite compatibility
Signed-off-by: MYUU <52773565+zhoujiaqi30@users.noreply.github.com>
Merged via the queue into gitmono-dev:main with commit b9214cb Sep 10, 2025
17 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.

5 participants