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 {
16
16
stat : string ;
17
17
}
18
18
19
+ export type CommitType = "try" | "master" ;
20
+
19
21
export interface ArtifactDescription {
20
22
commit : string ;
21
23
date : string | null ;
22
24
pr : number | null ;
25
+ type : CommitType ;
23
26
bootstrap : Dict < number > ;
24
27
bootstrap_total : number ;
25
28
component_sizes : Dict < number > ;
Original file line number Diff line number Diff line change @@ -183,11 +183,19 @@ pub mod comparison {
183
183
pub compile_benchmark_metadata : Vec < CompileBenchmarkMetadata > ,
184
184
}
185
185
186
+ #[ derive( Debug , Clone , Serialize ) ]
187
+ #[ serde( rename_all = "lowercase" ) ]
188
+ pub enum CommitType {
189
+ Master ,
190
+ Try ,
191
+ }
192
+
186
193
#[ derive( Debug , Clone , Serialize ) ]
187
194
pub struct ArtifactDescription {
188
195
pub commit : String ,
189
196
pub date : Option < Date > ,
190
197
pub pr : Option < u32 > ,
198
+ pub r#type : CommitType ,
191
199
pub bootstrap : HashMap < String , u64 > ,
192
200
pub bootstrap_total : u64 ,
193
201
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 {
1038
1038
ArtifactId :: Commit ( c) => c. sha ,
1039
1039
ArtifactId :: Tag ( t) => t,
1040
1040
} ,
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
+ } ,
1041
1048
date : if let ArtifactId :: Commit ( c) = & data. artifact {
1042
1049
Some ( c. date )
1043
1050
} else {
You can’t perform that action at this time.
0 commit comments