@@ -15,12 +15,14 @@ use crate::buck2::{status::Status, types::ProjectRelativePath};
1515
1616/// Parameters required to build a task.
1717#[ allow( dead_code) ]
18- #[ derive( Debug , Deserialize , Serialize ) ]
18+ #[ derive( Debug , Deserialize , Serialize , ToSchema ) ]
1919pub struct TaskBuildRequest {
2020 /// The repository base path
2121 pub repo : String ,
2222 /// The change list link (URL)
2323 pub cl_link : String ,
24+ //TODO: for old database only, delete after updated
25+ pub cl_id : i64 ,
2426 /// The list of file diff changes
2527 pub changes : Vec < Status < ProjectRelativePath > > ,
2628 /// Buck2 target path (e.g. //app:server). Optional for backward compatibility.
@@ -39,21 +41,26 @@ impl TaskBuildRequest {
3941pub struct RetryBuildRequest {
4042 pub build_id : String ,
4143 pub cl_link : String ,
42- pub cl : i64 ,
44+ pub cl_id : i64 ,
4345 pub changes : Vec < Status < ProjectRelativePath > > ,
46+ pub targets : Option < Vec < String > > ,
4447}
4548
4649/// Result of a task build operation containing status and metadata. Used by Orion-Server
4750#[ allow( dead_code) ]
48- #[ derive( Debug , Deserialize , Serialize ) ]
49- pub struct TaskBuildResult {
50- /// Whether the build operation was successful
51- pub success : bool ,
51+ #[ derive( Debug , Deserialize , Serialize , ToSchema ) ]
52+ pub struct OrionBuildResult {
5253 /// Unique identifier for the build task
53- pub id : String ,
54- /// Process exit code (None if not yet completed)
55- #[ serde( skip_serializing_if = "Option::is_none" ) ]
56- pub exit_code : Option < i32 > ,
54+ pub build_id : String ,
55+ /// Current status of the build (e.g., "queued", "running", "success", "failure")
56+ pub status : String ,
5757 /// Human-readable status or error message
5858 pub message : String ,
5959}
60+
61+ /// Response structure for build-related API endpoints in Orion-Server
62+ #[ derive( Debug , Deserialize , Serialize , ToSchema ) ]
63+ pub struct OrionServerResponse {
64+ pub task_id : String ,
65+ pub results : Vec < OrionBuildResult > ,
66+ }
0 commit comments