Skip to content

[buck2]REFECTOR: Refactorising and Integrating a Generic API model and WebSocket #1909

Open
AidCheng wants to merge 28 commits intoweb3infra-foundation:mainfrom
AidCheng:ref/buck2
Open

[buck2]REFECTOR: Refactorising and Integrating a Generic API model and WebSocket #1909
AidCheng wants to merge 28 commits intoweb3infra-foundation:mainfrom
AidCheng:ref/buck2

Conversation

@AidCheng
Copy link
Contributor

@AidCheng AidCheng commented Feb 6, 2026

Contributes to #1853

  • Created a generic API model
  • Integrated a new pipeline for handling buck2 build request
  • Moved buck2 related database to jupiter for better compactness
  • Unified the definition between task and build request, cleaned the ambiguity

topshihun and others added 21 commits February 2, 2026 10:59
* feat: add refactor orion module for migration

Signed-off-by: Wangyan <topshihun@foxmail.com>

* fix: add CL for build

Signed-off-by: Wangyan <topshihun@foxmail.com>

* refactor: some modules

Signed-off-by: Wangyan <topshihun@foxmail.com>

---------

Signed-off-by: Wangyan <topshihun@foxmail.com>
Signed-off-by: Aid_C <57825561+AidCheng@users.noreply.github.com>
Co-authored-by: Aid_C <57825561+AidCheng@users.noreply.github.com>
…n structure

Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
…ndation#1836)

* fix: enforce mount_path semantics and stabilize builds

Consolidate mount_path handling with buck2 prechecks and fix BuildDTO repo handling to avoid moves.

Signed-off-by: jerry609 <1772030600@qq.com>

style: format code with cargo fmt

Signed-off-by: jerry609 <1772030600@qq.com>

chore(orion): remove unused mount helpers

Signed-off-by: jerry609 <1772030600@qq.com>

fix(orion): retry buck2 targets once on failure

Signed-off-by: jerry609 <1772030600@qq.com>

fix(orion): remount and retry target discovery on failure

Signed-off-by: jerry609 <1772030600@qq.com>

style(orion): format buck_controller after retry changes

Signed-off-by: jerry609 <1772030600@qq.com>

fix(orion): annotate changes type for retry path

Signed-off-by: jerry609 <1772030600@qq.com>

fix(orion): appease clippy for mount guards

Signed-off-by: jerry609 <1772030600@qq.com>

test(common): avoid clippy field reassignment lint

Signed-off-by: jerry609 <1772030600@qq.com>

* test(ceres): fix clippy lints in tests

Signed-off-by: jerry609 <1772030600@qq.com>

---------

Signed-off-by: jerry609 <1772030600@qq.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
* refactor(code_review): add anchor and position to locat code thread

* feat: add reanchor thread function

* fix: seaORM repeated

* fix: rebase error

* fix: lcs_len error

* fix: fix CR problems

* fix: error

Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
…3infra-foundation#1875)

* feat(theme): Complete theme color system migration for CL, Issue, Queue, OrionClient, and Settings modules

* feat(theme): Complete theme color system migration for CL, Issue, Queue, OrionClient, and Settings modules

* feat(theme): Complete theme color system migration for CL, Issue, Queue, OrionClient, and Settings modules

* feat(theme): Complete theme color system migration for CL, Issue, Queue, OrionClient, and Settings modules

Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
…web3infra-foundation#1876)

Signed-off-by: MYUU <1405758738@qq.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: lvy010 <17338770572@163.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
…dation#1881)

* test(mono): Add CL merge and update-branch integration test

Signed-off-by: miliu2cc <miliu2cc@gmail.com>

* test(mono): Add CL merge and update-branch integration test

Signed-off-by: miliu2cc <miliu2cc@gmail.com>

* test(mono): add multi-user support and files-list API

Signed-off-by: miliu2cc <miliu2cc@gmail.com>

* test(mono): add multi-user support and files-list API

Signed-off-by: miliu2cc <miliu2cc@gmail.com>

---------

Signed-off-by: miliu2cc <miliu2cc@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
…ion#1884)

Signed-off-by: MYUU <1405758738@qq.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
* feat: implement build trigger system

Signed-off-by: allure <1550220889@qq.com>

* feat: refactor build trigger system and fix error

Signed-off-by: allure <1550220889@qq.com>

---------

Signed-off-by: allure <1550220889@qq.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
…ndation#1885)

Signed-off-by: jerry609 <1772030600@qq.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
* feat: add refactor orion module for migration

Signed-off-by: Wangyan <topshihun@foxmail.com>

* fix: add CL for build

Signed-off-by: Wangyan <topshihun@foxmail.com>

* refactor: some modules

Signed-off-by: Wangyan <topshihun@foxmail.com>

---------

Signed-off-by: Wangyan <topshihun@foxmail.com>
Signed-off-by: Aid_C <57825561+AidCheng@users.noreply.github.com>
Co-authored-by: Aid_C <57825561+AidCheng@users.noreply.github.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
…d model interface

Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
@genedna
Copy link
Member

genedna commented Feb 6, 2026

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e577bbb02b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors Orion’s Buck2 build/request and logging plumbing by centralizing shared protocol/types into api-model, updating both the Orion worker and Orion server to use the shared model, and adjusting scheduler/DB integration to match the new “build event” shape.

Changes:

  • Introduces api_model::buck2 shared types (WS protocol, Status, ProjectRelativePath, API request/response structs) and migrates Orion/Orion-server to use them.
  • Refactors Orion-server scheduling/dispatch structures to use a BuildEventPayload + PendingBuildEvent model and updates WS message variants (TaskBuild*).
  • Updates DB/migration + SeaORM entities to align “tasks/builds/build_events” relationships with the refactor.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
orion/src/ws.rs Switches worker WS message type to api_model and updates task handling to new WS variants.
orion/src/repo/sapling/status.rs Legacy Status implementation is commented out (superseded by api_model::buck2::status).
orion/src/repo/sapling/mod.rs Disables sapling::status module export (now moved to api-model).
orion/src/repo/diff.rs Updates tests to use api_model Status / ProjectRelativePath.
orion/src/repo/changes.rs Moves Status / ProjectRelativePath imports to api_model.
orion/src/buck_controller.rs Updates WS message fields/variants and moves shared Buck2 types to api_model.
orion/src/api.rs Refactors build API entrypoint to accept raw params and emit new WS completion message variant.
orion/buck/types.rs Removes ProjectRelativePath from td_util_buck types (now in api-model).
orion/buck/run.rs Updates imports to use api_model::buck2::types::ProjectRelativePath.
orion/buck/owners.rs Updates imports to use api_model::buck2::types::ProjectRelativePath.
orion/buck/glob.rs Updates imports to use api_model::buck2::types::ProjectRelativePath.
orion/buck/cells.rs Updates imports to use api_model::buck2::types::ProjectRelativePath.
orion/buck/Cargo.toml Adds api-model dependency to td_util_buck.
orion/Cargo.toml Adds api-model dependency to Orion worker.
orion-server/src/server.rs Replaces Orion-local TaskPhase import with api_model type.
orion-server/src/scheduler.rs Refactors queue items/build tracking to “build event” payload model and updates WS dispatch variants.
orion-server/src/log/log_service.rs Renames build id parameter to build_event_id for log keying consistency.
orion-server/src/api.rs Migrates HTTP request/response structs to api_model and updates WS processing to new variants.
orion-server/Cargo.toml Adds jupiter dependency.
jupiter/src/migration/mod.rs Registers the refactor migration in the migrator list.
jupiter/callisto/src/tasks.rs Removes old tasks SeaORM entity (replaced by Orion-specific task entity elsewhere).
jupiter/callisto/src/mod.rs Stops exporting the removed tasks module.
jupiter/callisto/src/builds.rs Updates builds relation to point to orion_tasks instead of tasks.
jupiter/callisto/src/build_events.rs Adjusts build_events model fields and adds placeholder trait for future DB helpers.
api-model/src/buck2/ws.rs Renames WS variants/fields (TaskBuild*, build_id) and centralizes the protocol definition.
api-model/src/buck2/types.rs Adds ProjectRelativePath implementation and Buck2-related shared types.
api-model/src/buck2/status.rs Adds shared Status type and parsing utilities.
api-model/src/buck2/mod.rs Exposes new status module.
api-model/src/buck2/api.rs Adds shared HTTP API request/response structs for Orion server endpoints.
api-model/Cargo.toml Adds dependencies needed for shared model functionality (anyhow, thiserror, parse-display).
Cargo.toml Adds workspace dependency version for parse-display.

AidCheng and others added 3 commits February 9, 2026 13:47
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: Aid_C <57825561+AidCheng@users.noreply.github.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
Signed-off-by: AidCheng <cn.aiden.cheng@gmail.com>
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.