@@ -7,8 +7,9 @@ mod platform;
77pub use platform:: Fingerprint ;
88use platform:: OperatingSystem ;
99
10- use crate :: { ContextKey , ReportContext } ;
10+ use crate :: { ContextPath , ReportContext } ;
1111
12+ const BENCHER_DEV : & str = "bencher.dev" ;
1213const ROOT : & str = "root" ;
1314
1415impl ReportContext {
@@ -17,7 +18,7 @@ impl ReportContext {
1718 }
1819
1920 fn insert ( & mut self , path : & str , value : String ) -> Option < String > {
20- let key = format ! ( "bencher.dev {path}" ) ;
21+ let key = format ! ( "{BENCHER_DEV} {path}" ) ;
2122 self . 0 . insert ( key, value)
2223 }
2324}
@@ -42,31 +43,31 @@ fn git_context(context: &mut ReportContext) {
4243 } ;
4344
4445 if let Some ( repo_name) = repo_name ( & repo) {
45- context. insert ( ContextKey :: REPO_NAME , repo_name) ;
46+ context. insert ( ContextPath :: REPO_NAME , repo_name) ;
4647 }
4748
4849 if let Some ( root_commit) = repo_hash ( & repo) {
49- context. insert ( ContextKey :: REPO_HASH , root_commit) ;
50+ context. insert ( ContextPath :: REPO_HASH , root_commit) ;
5051 }
5152
5253 if let Some ( ( branch_ref, branch_ref_name) ) = branch_ref ( & repo) {
53- context. insert ( ContextKey :: BRANCH_REF , branch_ref) ;
54- context. insert ( ContextKey :: BRANCH_REF_NAME , branch_ref_name) ;
54+ context. insert ( ContextPath :: BRANCH_REF , branch_ref) ;
55+ context. insert ( ContextPath :: BRANCH_REF_NAME , branch_ref_name) ;
5556 }
5657
5758 if let Some ( hash) = branch_hash ( & repo) {
58- context. insert ( ContextKey :: BRANCH_HASH , hash) ;
59+ context. insert ( ContextPath :: BRANCH_HASH , hash) ;
5960 }
6061}
6162
6263fn platform_context ( context : & mut ReportContext ) {
6364 context. insert (
64- ContextKey :: TESTBED_OS ,
65+ ContextPath :: TESTBED_OS ,
6566 OperatingSystem :: current ( ) . to_string ( ) ,
6667 ) ;
6768
6869 if let Some ( fingerprint) = Fingerprint :: current ( ) {
69- context. insert ( ContextKey :: TESTBED_FINGERPRINT , fingerprint. to_string ( ) ) ;
70+ context. insert ( ContextPath :: TESTBED_FINGERPRINT , fingerprint. to_string ( ) ) ;
7071 }
7172}
7273
0 commit comments