@@ -106,11 +106,15 @@ impl From<&PlatformProperties> for ProtoPlatform {
106106/// TODO(palfrey) In the future this will be used by the scheduler and
107107/// worker to cause the scheduler to prefer certain workers over others,
108108/// but not restrict them based on these values.
109+ /// Ignore - Jobs can request this key, but workers do not have to have it. This allows
110+ /// for example the `InputRootAbsolutePath` case for chromium builds, where we can safely
111+ /// ignore it without having to change the worker configs.
109112#[ derive( Eq , PartialEq , Hash , Clone , Ord , PartialOrd , Debug , Serialize , Deserialize ) ]
110113pub enum PlatformPropertyValue {
111114 Exact ( String ) ,
112115 Minimum ( u64 ) ,
113116 Priority ( String ) ,
117+ Ignore ( String ) ,
114118 Unknown ( String ) ,
115119}
116120
@@ -131,17 +135,18 @@ impl PlatformPropertyValue {
131135 // Priority is used to pass info to the worker and not restrict which
132136 // workers can be selected, but might be used to prefer certain workers
133137 // over others.
134- Self :: Priority ( _) => true ,
138+ Self :: Priority ( _) | Self :: Ignore ( _ ) => true ,
135139 // Success exact case is handled above.
136140 Self :: Exact ( _) | Self :: Unknown ( _) => false ,
137141 }
138142 }
139143
140144 pub fn as_str ( & self ) -> Cow < ' _ , str > {
141145 match self {
142- Self :: Exact ( value) | Self :: Priority ( value) | Self :: Unknown ( value) => {
143- Cow :: Borrowed ( value)
144- }
146+ Self :: Exact ( value)
147+ | Self :: Priority ( value)
148+ | Self :: Unknown ( value)
149+ | Self :: Ignore ( value) => Cow :: Borrowed ( value) ,
145150 Self :: Minimum ( value) => Cow :: Owned ( value. to_string ( ) ) ,
146151 }
147152 }
@@ -159,6 +164,7 @@ impl MetricsComponent for PlatformPropertyValue {
159164 Self :: Exact ( v) => publish ! ( name, v, kind, help, "exact" ) ,
160165 Self :: Minimum ( v) => publish ! ( name, v, kind, help, "minimum" ) ,
161166 Self :: Priority ( v) => publish ! ( name, v, kind, help, "priority" ) ,
167+ Self :: Ignore ( v) => publish ! ( name, v, kind, help, "ignore" ) ,
162168 Self :: Unknown ( v) => publish ! ( name, v, kind, help, "unknown" ) ,
163169 }
164170
0 commit comments