@@ -21,7 +21,7 @@ use url::Url;
2121
2222use req_packager:: VirtualResearchEnv ;
2323
24- #[ derive( Clone ) ]
24+ #[ derive( Clone , Debug ) ]
2525struct Dataset {
2626 // XXX: I don't want to couple the grpc logic with business logic, so I need real type for both
2727 // datasetinfo and fileentry.
@@ -56,6 +56,7 @@ impl FilemetrixClient for MockFilemetrixClient {
5656 url_datarepo : & str ,
5757 id : & str ,
5858 ) -> anyhow:: Result < grpc:: DatasetInfo > {
59+ // XXX: very fragile to use url+id, should be a PID or other primary key in DB.
5960 match self
6061 . datasets
6162 . get ( & ( url_datarepo. to_string ( ) , id. to_string ( ) ) )
@@ -169,7 +170,7 @@ impl DispatcherClient for MockDispatcherClient {
169170 }
170171}
171172
172- #[ derive( Serialize , Deserialize , Clone ) ]
173+ #[ derive( Serialize , Deserialize , Clone , Debug ) ]
173174struct DatasetInfo {
174175 url : String ,
175176 id : String ,
@@ -204,7 +205,7 @@ impl From<DatasetInfo> for grpc::DatasetInfo {
204205 }
205206}
206207
207- #[ derive( Serialize , Deserialize , Clone ) ]
208+ #[ derive( Serialize , Deserialize , Clone , Debug ) ]
208209struct FileEntry {
209210 path : String ,
210211 is_dir : bool ,
@@ -308,8 +309,8 @@ fn generate_datasets() -> Vec<Dataset> {
308309 }
309310
310311 let info = DatasetInfo {
311- url : format ! ( "https://example.com/datasets/{i}" ) ,
312- id : Uuid :: new_v4 ( ) . to_string ( ) ,
312+ url : "https://example.com/datasets" . to_string ( ) ,
313+ id : format ! ( "{i}" ) ,
313314 description : format ! ( "Mock dataset number {i}" ) ,
314315 total_files : Some ( total_files) ,
315316 total_size_bytes : Some ( total_size_bytes) ,
0 commit comments