@@ -3,13 +3,14 @@ use std::{
33 sync:: Arc ,
44} ;
55
6+ pub use api_model:: buck2:: { status:: Status , types:: ProjectRelativePath } ;
67use common:: errors:: MegaError ;
78use git_internal:: hash:: ObjectHash ;
89use jupiter:: storage:: Storage ;
910
1011use crate :: {
1112 api_service:: { cache:: GitObjectCache , mono_api_service:: MonoApiService } ,
12- build_trigger:: { SerializableBuildInfo , SerializableStatus , TriggerContext } ,
13+ build_trigger:: TriggerContext ,
1314 model:: change_list:: { ClDiffFile , ClFilesRes } ,
1415} ;
1516
@@ -29,21 +30,21 @@ impl ChangesCalculator {
2930 pub async fn get_builds_for_commit (
3031 & self ,
3132 context : & TriggerContext ,
32- ) -> Result < Vec < SerializableBuildInfo > , MegaError > {
33+ ) -> Result < Vec < Status < ProjectRelativePath > > , MegaError > {
3334 let old_files = self . get_commit_blobs ( & context. from_hash ) . await ?;
3435 let new_files = self . get_commit_blobs ( & context. commit_hash ) . await ?;
3536 let diff_files = self . cl_files_list ( old_files, new_files) . await ?;
3637
3738 let changes = self . build_changes ( & context. repo_path , diff_files) ?;
3839
39- Ok ( vec ! [ SerializableBuildInfo { changes } ] )
40+ Ok ( changes)
4041 }
4142
4243 fn build_changes (
4344 & self ,
4445 cl_path : & str ,
4546 cl_diff_files : Vec < ClDiffFile > ,
46- ) -> Result < Vec < SerializableStatus > , MegaError > {
47+ ) -> Result < Vec < Status < ProjectRelativePath > > , MegaError > {
4748 let cl_base = PathBuf :: from ( cl_path) ;
4849 let path_str = cl_base. to_str ( ) . ok_or_else ( || {
4950 MegaError :: Other ( format ! ( "CL base path is not valid UTF-8: {:?}" , cl_base) )
@@ -73,11 +74,11 @@ impl ChangesCalculator {
7374 . to_string ( ) ;
7475
7576 let status = if s. action == "new" {
76- SerializableStatus :: Added ( rel)
77+ Status :: Added ( ProjectRelativePath :: new ( & rel) )
7778 } else if s. action == "deleted" {
78- SerializableStatus :: Removed ( rel)
79+ Status :: Removed ( ProjectRelativePath :: new ( & rel) )
7980 } else if s. action == "modified" {
80- SerializableStatus :: Modified ( rel)
81+ Status :: Modified ( ProjectRelativePath :: new ( & rel) )
8182 } else {
8283 return Err ( MegaError :: Other ( format ! (
8384 "Unsupported change action: {}" ,
0 commit comments