Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

Commit d075978

Browse files
authored
fix: Temporarily do not block the merge process when check fails. (#2009)
Signed-off-by: Ruizhi Huang <231220075@smail.nju.edu.cn>
1 parent 4d99fcc commit d075978

1 file changed

Lines changed: 42 additions & 50 deletions

File tree

‎ceres/src/api_service/mono_api_service.rs‎

Lines changed: 42 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1401,45 +1401,48 @@ impl MonoApiService {
14011401

14021402
Ok(())
14031403
}
1404-
1405-
async fn ensure_cl_mergeable(&self, cl: &mega_cl::Model) -> Result<(), MegaError> {
1406-
let check_reg = CheckerRegistry::new(self.storage.clone().into(), cl.username.clone());
1407-
check_reg.run_checks(cl.clone().into()).await?;
1408-
1409-
let required_check_types = self
1410-
.storage
1411-
.cl_storage()
1412-
.get_checks_config_by_path(&cl.path)
1413-
.await?
1414-
.into_iter()
1415-
.filter(|cfg| cfg.required)
1416-
.map(|cfg| cfg.check_type_code)
1417-
.collect::<Vec<_>>();
1418-
1419-
let failed_checks = self
1420-
.storage
1421-
.cl_storage()
1422-
.get_check_result(&cl.link)
1423-
.await?
1424-
.into_iter()
1425-
.filter(|result| {
1426-
result.status == "FAILED"
1427-
&& required_check_types
1428-
.iter()
1429-
.any(|required_type| required_type == &result.check_type_code)
1430-
})
1431-
.map(|result| format!("{:?}", result.check_type_code))
1432-
.collect::<Vec<_>>();
1433-
1434-
if failed_checks.is_empty() {
1435-
Ok(())
1436-
} else {
1437-
Err(MegaError::Other(format!(
1438-
"CL is unmergeable, failed checks: {}",
1439-
failed_checks.join(", ")
1440-
)))
1441-
}
1442-
}
1404+
// This function is intended to be called before merging a CL to ensure it meets all required checks.
1405+
// It gathers the required checks for the CL's path, retrieves the CL's check results, and returns an error if any required checks have failed.
1406+
// Temporarily do not block the merge process when check fails.
1407+
1408+
// async fn ensure_cl_mergeable(&self, cl: &mega_cl::Model) -> Result<(), MegaError> {
1409+
// let check_reg = CheckerRegistry::new(self.storage.clone().into(), cl.username.clone());
1410+
// check_reg.run_checks(cl.clone().into()).await?;
1411+
1412+
// let required_check_types = self
1413+
// .storage
1414+
// .cl_storage()
1415+
// .get_checks_config_by_path(&cl.path)
1416+
// .await?
1417+
// .into_iter()
1418+
// .filter(|cfg| cfg.required)
1419+
// .map(|cfg| cfg.check_type_code)
1420+
// .collect::<Vec<_>>();
1421+
1422+
// let failed_checks = self
1423+
// .storage
1424+
// .cl_storage()
1425+
// .get_check_result(&cl.link)
1426+
// .await?
1427+
// .into_iter()
1428+
// .filter(|result| {
1429+
// result.status == "FAILED"
1430+
// && required_check_types
1431+
// .iter()
1432+
// .any(|required_type| required_type == &result.check_type_code)
1433+
// })
1434+
// .map(|result| format!("{:?}", result.check_type_code))
1435+
// .collect::<Vec<_>>();
1436+
1437+
// if failed_checks.is_empty() {
1438+
// Ok(())
1439+
// } else {
1440+
// Err(MegaError::Other(format!(
1441+
// "CL is unmergeable, failed checks: {}",
1442+
// failed_checks.join(", ")
1443+
// )))
1444+
// }
1445+
// }
14431446

14441447
async fn trigger_build_for_cl(
14451448
&self,
@@ -1709,10 +1712,6 @@ impl MonoApiService {
17091712
return Err(GitError::CustomError("ref hash conflict".to_owned()));
17101713
}
17111714

1712-
self.ensure_cl_mergeable(&cl)
1713-
.await
1714-
.map_err(|e| GitError::CustomError(e.to_string()))?;
1715-
17161715
self.merge_cl_unchecked(username, cl).await
17171716
}
17181717

@@ -3555,13 +3554,6 @@ impl MonoApiService {
35553554
}
35563555
};
35573556

3558-
self.ensure_cl_mergeable(&cl_model).await.map_err(|e| {
3559-
(
3560-
QueueFailureTypeEnum::SystemError,
3561-
format!("CL is unmergeable: {}", e),
3562-
)
3563-
})?;
3564-
35653557
// Step 2: Run tests (TODO: Buck2 integration)
35663558
// self.run_tests(&cl_model).await?;
35673559

0 commit comments

Comments
 (0)