@@ -32,15 +32,15 @@ pub type SchedulerRefName = String;
3232/// Used when the config references `instance_name` in the protocol.
3333pub type InstanceName = String ;
3434
35- #[ allow( non_camel_case_types) ]
3635#[ derive( Deserialize , Debug , Default , Clone , Copy ) ]
36+ #[ serde( rename_all = "snake_case" ) ]
3737pub enum HttpCompressionAlgorithm {
3838 /// No compression.
3939 #[ default]
40- none ,
40+ None ,
4141
4242 /// Zlib compression.
43- gzip ,
43+ Gzip ,
4444}
4545
4646/// Note: Compressing data in the cloud rarely has a benefit, since most
@@ -61,7 +61,7 @@ pub struct HttpCompressionConfig {
6161 /// latency.
6262 /// see: <https://github.com/tracemachina/nativelink/issues/109>
6363 ///
64- /// Default: `HttpCompressionAlgorithm::none `
64+ /// Default: `HttpCompressionAlgorithm::None `
6565 pub send_compression_algorithm : Option < HttpCompressionAlgorithm > ,
6666
6767 /// The compression algorithm that the server will accept from clients.
@@ -394,11 +394,11 @@ pub struct HttpServerConfig {
394394 pub experimental_http2_max_header_list_size : Option < u32 > ,
395395}
396396
397- #[ allow( non_camel_case_types) ]
398397#[ derive( Deserialize , Debug ) ]
398+ #[ serde( rename_all = "snake_case" ) ]
399399pub enum ListenerConfig {
400400 /// Listener for HTTP/HTTPS/HTTP2 sockets.
401- http ( HttpListener ) ,
401+ Http ( HttpListener ) ,
402402}
403403
404404#[ derive( Deserialize , Debug ) ]
@@ -447,18 +447,18 @@ pub struct ServerConfig {
447447 pub experimental_identity_header : IdentityHeaderSpec ,
448448}
449449
450- #[ allow( non_camel_case_types) ]
451450#[ derive( Deserialize , Debug ) ]
451+ #[ serde( rename_all = "snake_case" ) ]
452452pub enum WorkerProperty {
453453 /// List of static values.
454454 /// Note: Generally there should only ever be 1 value, but if the platform
455455 /// property key is `PropertyType::Priority` it may have more than one value.
456456 #[ serde( deserialize_with = "convert_vec_string_with_shellexpand" ) ]
457- values ( Vec < String > ) ,
457+ Values ( Vec < String > ) ,
458458
459459 /// A dynamic configuration. The string will be executed as a command
460460 /// (not sell) and will be split by "\n" (new line character).
461- query_cmd ( String ) ,
461+ QueryCmd ( String ) ,
462462}
463463
464464/// Generic config for an endpoint and associated configs.
@@ -477,35 +477,35 @@ pub struct EndpointConfig {
477477 pub tls_config : Option < ClientTlsConfig > ,
478478}
479479
480- #[ allow( non_camel_case_types) ]
481480#[ derive( Copy , Clone , Deserialize , Debug , Default ) ]
481+ #[ serde( rename_all = "snake_case" ) ]
482482pub enum UploadCacheResultsStrategy {
483483 /// Only upload action results with an exit code of 0.
484484 #[ default]
485- success_only ,
485+ SuccessOnly ,
486486
487487 /// Don't upload any action results.
488- never ,
488+ Never ,
489489
490490 /// Upload all action results that complete.
491- everything ,
491+ Everything ,
492492
493493 /// Only upload action results that fail.
494- failures_only ,
494+ FailuresOnly ,
495495}
496496
497- #[ allow( non_camel_case_types) ]
498497#[ derive( Clone , Deserialize , Debug ) ]
498+ #[ serde( rename_all = "snake_case" ) ]
499499pub enum EnvironmentSource {
500500 /// The name of the platform property in the action to get the value from.
501- property ( String ) ,
501+ Property ( String ) ,
502502
503503 /// The raw value to set.
504- value ( #[ serde( deserialize_with = "convert_string_with_shellexpand" ) ] String ) ,
504+ Value ( #[ serde( deserialize_with = "convert_string_with_shellexpand" ) ] String ) ,
505505
506506 /// The max amount of time in milliseconds the command is allowed to run
507507 /// (requested by the client).
508- timeout_millis ,
508+ TimeoutMillis ,
509509
510510 /// A special file path will be provided that can be used to communicate
511511 /// with the parent process about out-of-band information. This file
@@ -523,7 +523,7 @@ pub enum EnvironmentSource {
523523 ///
524524 /// All fields are optional, file does not need to be created and may be
525525 /// empty.
526- side_channel_file ,
526+ SideChannelFile ,
527527
528528 /// A "root" directory for the action. This directory can be used to
529529 /// store temporary files that are not needed after the action has
@@ -538,7 +538,7 @@ pub enum EnvironmentSource {
538538 /// variable, `mkdir $ENV_VAR_NAME/tmp` and `export TMPDIR=$ENV_VAR_NAME/tmp`.
539539 /// Another example might be to bind-mount the `/tmp` path in a container to
540540 /// this path in `entrypoint`.
541- action_directory ,
541+ ActionDirectory ,
542542}
543543
544544#[ derive( Deserialize , Debug , Default ) ]
@@ -693,11 +693,11 @@ pub struct LocalWorkerConfig {
693693 pub additional_environment : Option < HashMap < String , EnvironmentSource > > ,
694694}
695695
696- #[ allow( non_camel_case_types) ]
697696#[ derive( Deserialize , Debug ) ]
697+ #[ serde( rename_all = "snake_case" ) ]
698698pub enum WorkerConfig {
699699 /// A worker type that executes jobs locally on this machine.
700- local ( LocalWorkerConfig ) ,
700+ Local ( LocalWorkerConfig ) ,
701701}
702702
703703#[ derive( Deserialize , Debug , Clone , Copy ) ]
0 commit comments