-
Notifications
You must be signed in to change notification settings - Fork 122
fix: buck2 build use a fix target #1328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
benjamin-747
merged 2 commits into
gitmono-dev:main
from
yyjeqhc:fix_extract_buck_target
Aug 11, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,8 +1,7 @@ | ||||||
| use crate::buck2::download_and_get_buck2_targets; | ||||||
| use crate::model::builds; | ||||||
| use crate::scheduler::{ | ||||||
| BuildInfo, BuildRequest, TaskScheduler, WorkerInfo, WorkerStatus, | ||||||
| create_log_file, get_build_log_dir, TaskQueueStats | ||||||
| BuildInfo, BuildRequest, TaskQueueStats, TaskScheduler, WorkerInfo, WorkerStatus, | ||||||
| create_log_file, get_build_log_dir, | ||||||
| }; | ||||||
| use axum::{ | ||||||
| Json, Router, | ||||||
|
|
@@ -19,10 +18,8 @@ use futures_util::{SinkExt, Stream, StreamExt, stream}; | |||||
| use orion::ws::WSMessage; | ||||||
| use rand::Rng; | ||||||
| use sea_orm::{ | ||||||
| { | ||||||
| ActiveModelTrait, ActiveValue::Set, ColumnTrait, DatabaseConnection, EntityTrait, | ||||||
| QueryFilter as _, | ||||||
| }, | ||||||
| ActiveModelTrait, ActiveValue::Set, ColumnTrait, DatabaseConnection, EntityTrait, | ||||||
| QueryFilter as _, | ||||||
| }; | ||||||
| use serde::Serialize; | ||||||
| use std::convert::Infallible; | ||||||
|
|
@@ -38,7 +35,6 @@ use tokio::sync::mpsc::UnboundedSender; | |||||
| use utoipa::ToSchema; | ||||||
| use uuid::Uuid; | ||||||
|
|
||||||
|
|
||||||
| /// Enumeration of possible task statuses | ||||||
| #[derive(Debug, Serialize, Default, ToSchema)] | ||||||
| pub enum TaskStatusEnum { | ||||||
|
|
@@ -69,20 +65,15 @@ pub struct AppState { | |||||
|
|
||||||
| impl AppState { | ||||||
| /// Create new AppState instance | ||||||
| pub fn new(conn: DatabaseConnection, queue_config: Option<crate::scheduler::TaskQueueConfig>) -> Self { | ||||||
| pub fn new( | ||||||
| conn: DatabaseConnection, | ||||||
| queue_config: Option<crate::scheduler::TaskQueueConfig>, | ||||||
| ) -> Self { | ||||||
| let workers = Arc::new(DashMap::new()); | ||||||
| let active_builds = Arc::new(DashMap::new()); | ||||||
| let scheduler = TaskScheduler::new( | ||||||
| conn.clone(), | ||||||
| workers, | ||||||
| active_builds, | ||||||
| queue_config, | ||||||
| ); | ||||||
|
|
||||||
| Self { | ||||||
| scheduler, | ||||||
| conn, | ||||||
| } | ||||||
| let scheduler = TaskScheduler::new(conn.clone(), workers, active_builds, queue_config); | ||||||
|
|
||||||
| Self { scheduler, conn } | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
|
|
@@ -111,9 +102,7 @@ pub async fn start_queue_manager(state: AppState) { | |||||
| (status = 200, description = "Queue statistics", body = TaskQueueStats) | ||||||
| ) | ||||||
| )] | ||||||
| pub async fn queue_stats_handler( | ||||||
| State(state): State<AppState>, | ||||||
| ) -> impl IntoResponse { | ||||||
| pub async fn queue_stats_handler(State(state): State<AppState>) -> impl IntoResponse { | ||||||
| let stats = state.scheduler.get_queue_stats().await; | ||||||
| (StatusCode::OK, Json(stats)) | ||||||
| } | ||||||
|
|
@@ -270,28 +259,33 @@ pub async fn task_handler( | |||||
| Json(req): Json<BuildRequest>, | ||||||
| ) -> impl IntoResponse { | ||||||
| // Download and get buck2 targets first | ||||||
| let target = match download_and_get_buck2_targets(&req.buck_hash, &req.buckconfig_hash).await { | ||||||
| Ok(target) => target, | ||||||
| Err(e) => { | ||||||
| tracing::error!("Failed to download buck2 targets: {}", e); | ||||||
| return ( | ||||||
| StatusCode::INTERNAL_SERVER_ERROR, | ||||||
| Json(serde_json::json!({ "message": format!("Failed to download buck2 targets: {}", e) })), | ||||||
| ).into_response(); | ||||||
| } | ||||||
| }; | ||||||
|
|
||||||
| // let target = match download_and_get_buck2_targets(&req.buck_hash, &req.buckconfig_hash).await { | ||||||
| // Ok(target) => target, | ||||||
| // Err(e) => { | ||||||
| // tracing::error!("Failed to download buck2 targets: {}", e); | ||||||
| // return ( | ||||||
| // StatusCode::INTERNAL_SERVER_ERROR, | ||||||
| // Json(serde_json::json!({ "message": format!("Failed to download buck2 targets: {}", e) })), | ||||||
| // ).into_response(); | ||||||
| // } | ||||||
| // }; | ||||||
| // for now we do not extract from file, just use the fixed build target. | ||||||
| let target = "//...".to_string(); | ||||||
|
||||||
| let target = "//...".to_string(); | |
| let target = FIXED_BUILD_TARGET.to_string(); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment should include a TODO or FIXME marker to indicate this is temporary code that needs to be reverted, making it easier to track technical debt.