File tree Expand file tree Collapse file tree 3 files changed +18
-0
lines changed
frontend/src/pages/compare Expand file tree Collapse file tree 3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -16,10 +16,13 @@ export interface CompareSelector {
1616 stat : string ;
1717}
1818
19+ export type CommitType = "try" | "master" ;
20+
1921export interface ArtifactDescription {
2022 commit : string ;
2123 date : string | null ;
2224 pr : number | null ;
25+ type : CommitType ;
2326 bootstrap : Dict < number > ;
2427 bootstrap_total : number ;
2528 component_sizes : Dict < number > ;
Original file line number Diff line number Diff line change @@ -183,11 +183,19 @@ pub mod comparison {
183183 pub compile_benchmark_metadata : Vec < CompileBenchmarkMetadata > ,
184184 }
185185
186+ #[ derive( Debug , Clone , Serialize ) ]
187+ #[ serde( rename_all = "lowercase" ) ]
188+ pub enum CommitType {
189+ Master ,
190+ Try ,
191+ }
192+
186193 #[ derive( Debug , Clone , Serialize ) ]
187194 pub struct ArtifactDescription {
188195 pub commit : String ,
189196 pub date : Option < Date > ,
190197 pub pr : Option < u32 > ,
198+ pub r#type : CommitType ,
191199 pub bootstrap : HashMap < String , u64 > ,
192200 pub bootstrap_total : u64 ,
193201 pub component_sizes : HashMap < String , u64 > ,
Original file line number Diff line number Diff line change @@ -1038,6 +1038,13 @@ impl From<ArtifactDescription> for api::comparison::ArtifactDescription {
10381038 ArtifactId :: Commit ( c) => c. sha ,
10391039 ArtifactId :: Tag ( t) => t,
10401040 } ,
1041+ r#type : match & data. artifact {
1042+ ArtifactId :: Commit ( c) => match c. r#type {
1043+ CommitType :: Master => api:: comparison:: CommitType :: Master ,
1044+ CommitType :: Try => api:: comparison:: CommitType :: Try ,
1045+ } ,
1046+ ArtifactId :: Tag ( _) => api:: comparison:: CommitType :: Master ,
1047+ } ,
10411048 date : if let ArtifactId :: Commit ( c) = & data. artifact {
10421049 Some ( c. date )
10431050 } else {
You can’t perform that action at this time.
0 commit comments