@@ -32,15 +32,15 @@ pub type SchedulerRefName = String;
32
32
/// Used when the config references `instance_name` in the protocol.
33
33
pub type InstanceName = String ;
34
34
35
- #[ allow( non_camel_case_types) ]
36
35
#[ derive( Deserialize , Debug , Default , Clone , Copy ) ]
36
+ #[ serde( rename_all = "snake_case" ) ]
37
37
pub enum HttpCompressionAlgorithm {
38
38
/// No compression.
39
39
#[ default]
40
- none ,
40
+ None ,
41
41
42
42
/// Zlib compression.
43
- gzip ,
43
+ Gzip ,
44
44
}
45
45
46
46
/// Note: Compressing data in the cloud rarely has a benefit, since most
@@ -61,7 +61,7 @@ pub struct HttpCompressionConfig {
61
61
/// latency.
62
62
/// see: <https://github.com/tracemachina/nativelink/issues/109>
63
63
///
64
- /// Default: `HttpCompressionAlgorithm::none `
64
+ /// Default: `HttpCompressionAlgorithm::None `
65
65
pub send_compression_algorithm : Option < HttpCompressionAlgorithm > ,
66
66
67
67
/// The compression algorithm that the server will accept from clients.
@@ -394,11 +394,11 @@ pub struct HttpServerConfig {
394
394
pub experimental_http2_max_header_list_size : Option < u32 > ,
395
395
}
396
396
397
- #[ allow( non_camel_case_types) ]
398
397
#[ derive( Deserialize , Debug ) ]
398
+ #[ serde( rename_all = "snake_case" ) ]
399
399
pub enum ListenerConfig {
400
400
/// Listener for HTTP/HTTPS/HTTP2 sockets.
401
- http ( HttpListener ) ,
401
+ Http ( HttpListener ) ,
402
402
}
403
403
404
404
#[ derive( Deserialize , Debug ) ]
@@ -447,18 +447,18 @@ pub struct ServerConfig {
447
447
pub experimental_identity_header : IdentityHeaderSpec ,
448
448
}
449
449
450
- #[ allow( non_camel_case_types) ]
451
450
#[ derive( Deserialize , Debug ) ]
451
+ #[ serde( rename_all = "snake_case" ) ]
452
452
pub enum WorkerProperty {
453
453
/// List of static values.
454
454
/// Note: Generally there should only ever be 1 value, but if the platform
455
455
/// property key is `PropertyType::Priority` it may have more than one value.
456
456
#[ serde( deserialize_with = "convert_vec_string_with_shellexpand" ) ]
457
- values ( Vec < String > ) ,
457
+ Values ( Vec < String > ) ,
458
458
459
459
/// A dynamic configuration. The string will be executed as a command
460
460
/// (not sell) and will be split by "\n" (new line character).
461
- query_cmd ( String ) ,
461
+ QueryCmd ( String ) ,
462
462
}
463
463
464
464
/// Generic config for an endpoint and associated configs.
@@ -477,35 +477,35 @@ pub struct EndpointConfig {
477
477
pub tls_config : Option < ClientTlsConfig > ,
478
478
}
479
479
480
- #[ allow( non_camel_case_types) ]
481
480
#[ derive( Copy , Clone , Deserialize , Debug , Default ) ]
481
+ #[ serde( rename_all = "snake_case" ) ]
482
482
pub enum UploadCacheResultsStrategy {
483
483
/// Only upload action results with an exit code of 0.
484
484
#[ default]
485
- success_only ,
485
+ SuccessOnly ,
486
486
487
487
/// Don't upload any action results.
488
- never ,
488
+ Never ,
489
489
490
490
/// Upload all action results that complete.
491
- everything ,
491
+ Everything ,
492
492
493
493
/// Only upload action results that fail.
494
- failures_only ,
494
+ FailuresOnly ,
495
495
}
496
496
497
- #[ allow( non_camel_case_types) ]
498
497
#[ derive( Clone , Deserialize , Debug ) ]
498
+ #[ serde( rename_all = "snake_case" ) ]
499
499
pub enum EnvironmentSource {
500
500
/// The name of the platform property in the action to get the value from.
501
- property ( String ) ,
501
+ Property ( String ) ,
502
502
503
503
/// 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 ) ,
505
505
506
506
/// The max amount of time in milliseconds the command is allowed to run
507
507
/// (requested by the client).
508
- timeout_millis ,
508
+ TimeoutMillis ,
509
509
510
510
/// A special file path will be provided that can be used to communicate
511
511
/// with the parent process about out-of-band information. This file
@@ -523,7 +523,7 @@ pub enum EnvironmentSource {
523
523
///
524
524
/// All fields are optional, file does not need to be created and may be
525
525
/// empty.
526
- side_channel_file ,
526
+ SideChannelFile ,
527
527
528
528
/// A "root" directory for the action. This directory can be used to
529
529
/// store temporary files that are not needed after the action has
@@ -538,7 +538,7 @@ pub enum EnvironmentSource {
538
538
/// variable, `mkdir $ENV_VAR_NAME/tmp` and `export TMPDIR=$ENV_VAR_NAME/tmp`.
539
539
/// Another example might be to bind-mount the `/tmp` path in a container to
540
540
/// this path in `entrypoint`.
541
- action_directory ,
541
+ ActionDirectory ,
542
542
}
543
543
544
544
#[ derive( Deserialize , Debug , Default ) ]
@@ -693,11 +693,11 @@ pub struct LocalWorkerConfig {
693
693
pub additional_environment : Option < HashMap < String , EnvironmentSource > > ,
694
694
}
695
695
696
- #[ allow( non_camel_case_types) ]
697
696
#[ derive( Deserialize , Debug ) ]
697
+ #[ serde( rename_all = "snake_case" ) ]
698
698
pub enum WorkerConfig {
699
699
/// A worker type that executes jobs locally on this machine.
700
- local ( LocalWorkerConfig ) ,
700
+ Local ( LocalWorkerConfig ) ,
701
701
}
702
702
703
703
#[ derive( Deserialize , Debug , Clone , Copy ) ]
0 commit comments