-
Notifications
You must be signed in to change notification settings - Fork 868
/
AgentKnobs.cs
783 lines (668 loc) Β· 43.8 KB
/
AgentKnobs.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
namespace Agent.Sdk.Knob
{
public class AgentKnobs
{
// Containers
public static readonly Knob PreferPowershellHandlerOnContainers = new Knob(
nameof(PreferPowershellHandlerOnContainers),
"If true, prefer using the PowerShell handler on Windows containers for tasks that provide both a Node and PowerShell handler version.",
new RuntimeKnobSource("agent.preferPowerShellOnContainers"),
new EnvironmentKnobSource("AGENT_PREFER_POWERSHELL_ON_CONTAINERS"),
new BuiltInDefaultKnobSource("true"));
public static readonly Knob SetupDockerGroup = new Knob(
nameof(SetupDockerGroup),
"If true, allows the user to run docker commands without sudo",
new RuntimeKnobSource("VSTS_SETUP_DOCKERGROUP"),
new EnvironmentKnobSource("VSTS_SETUP_DOCKERGROUP"),
new BuiltInDefaultKnobSource("true"));
public static readonly Knob AllowMountTasksReadonlyOnWindows = new Knob(
nameof(AllowMountTasksReadonlyOnWindows),
"If true, allows the user to mount 'tasks' volume read-only on Windows OS",
new RuntimeKnobSource("VSTS_SETUP_ALLOW_MOUNT_TASKS_READONLY"),
new EnvironmentKnobSource("VSTS_SETUP_ALLOW_MOUNT_TASKS_READONLY"),
new BuiltInDefaultKnobSource("true"));
public static readonly Knob SkipPostExeceutionIfTargetContainerStopped = new Knob(
nameof(SkipPostExeceutionIfTargetContainerStopped),
"If true, skips post-execution step for tasks in case the target container has been stopped",
new RuntimeKnobSource("AGENT_SKIP_POST_EXECUTION_IF_CONTAINER_STOPPED"),
new EnvironmentKnobSource("AGENT_SKIP_POST_EXECUTION_IF_CONTAINER_STOPPED"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob MTUValueForContainerJobs = new Knob(
nameof(MTUValueForContainerJobs),
"Allow to specify MTU value for networks used by container jobs (useful for docker-in-docker scenarios in k8s cluster).",
new EnvironmentKnobSource("AGENT_DOCKER_MTU_VALUE"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob DockerNetworkCreateDriver = new Knob(
nameof(DockerNetworkCreateDriver),
"Allow to specify which driver will be used when creating docker network",
new RuntimeKnobSource("agent.DockerNetworkCreateDriver"),
new EnvironmentKnobSource("AZP_AGENT_DOCKER_NETWORK_CREATE_DRIVER"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob DockerAdditionalNetworkOptions = new Knob(
nameof(DockerAdditionalNetworkOptions),
"Allow to specify additional command line options to 'docker network' command when creating network for new containers",
new RuntimeKnobSource("agent.DockerAdditionalNetworkOptions"),
new EnvironmentKnobSource("AZP_AGENT_DOCKER_ADDITIONAL_NETWORK_OPTIONS"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob UseHostGroupId = new Knob(
nameof(UseHostGroupId),
"If true, use the same group ID (GID) as the user on the host on which the agent is running",
new RuntimeKnobSource("agent.UseHostGroupId"),
new EnvironmentKnobSource("AZP_AGENT_USE_HOST_GROUP_ID"),
new BuiltInDefaultKnobSource("true"));
public const string DockerActionRetriesVariableName = "VSTSAGENT_DOCKER_ACTION_RETRIES";
public static readonly Knob DockerActionRetries = new Knob(
nameof(DockerActionRetries),
"When enabled, the agent retries docker steps if failed",
new RuntimeKnobSource(DockerActionRetriesVariableName),
new EnvironmentKnobSource(DockerActionRetriesVariableName),
new BuiltInDefaultKnobSource("false"));
// Directory structure
public static readonly Knob AgentToolsDirectory = new Knob(
nameof(AgentToolsDirectory),
"The location to look for/create the agents tool cache",
new EnvironmentKnobSource("AGENT_TOOLSDIRECTORY"),
new EnvironmentKnobSource("agent.ToolsDirectory"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob OverwriteTemp = new Knob(
nameof(OverwriteTemp),
"If true, the system temp variable will be overriden to point to the agent's temp directory.",
new RuntimeKnobSource("VSTS_OVERWRITE_TEMP"),
new EnvironmentKnobSource("VSTS_OVERWRITE_TEMP"),
new BuiltInDefaultKnobSource("false"));
// Tool configuration
public static readonly Knob DisableFetchByCommit = new Knob(
nameof(DisableFetchByCommit),
"If true and server supports it, fetch the target branch by commit. Otherwise, fetch all branches and pull request ref to get the target branch.",
new RuntimeKnobSource("VSTS.DisableFetchByCommit"),
new EnvironmentKnobSource("VSTS_DISABLEFETCHBYCOMMIT"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DisableFetchPruneTags = new Knob(
nameof(DisableFetchPruneTags),
"If true, disable --prune-tags in the fetches.",
new RuntimeKnobSource("VSTS.DisableFetchPruneTags"),
new EnvironmentKnobSource("VSTS_DISABLEFETCHPRUNETAGS"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob PreferGitFromPath = new Knob(
nameof(PreferGitFromPath),
"Determines which Git we will use on Windows. By default, we prefer the built-in portable git in the agent's externals folder, setting this to true makes the agent find git.exe from %PATH% if possible.",
new RuntimeKnobSource("system.prefergitfrompath"),
new EnvironmentKnobSource("system.prefergitfrompath"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseGit2_39_4 = new Knob(
nameof(UseGit2_39_4),
"If true, Git v2.39.4 will be used instead of the default version.",
new RuntimeKnobSource("USE_GIT_2_39_4"),
new EnvironmentKnobSource("USE_GIT_2_39_4"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseGit2_42_0_2 = new Knob(
nameof(UseGit2_42_0_2),
"If true, Git v2.42.0.2 will be used instead of the default version.",
new RuntimeKnobSource("USE_GIT_2_42_0_2"),
new EnvironmentKnobSource("USE_GIT_2_42_0_2"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DisableGitPrompt = new Knob(
nameof(DisableGitPrompt),
"If true, git will not prompt on the terminal (e.g., when asking for HTTP authentication).",
new RuntimeKnobSource("VSTS_DISABLE_GIT_PROMPT"),
new EnvironmentKnobSource("VSTS_DISABLE_GIT_PROMPT"),
new BuiltInDefaultKnobSource("true"));
public static readonly Knob GitUseSecureParameterPassing = new Knob(
nameof(GitUseSecureParameterPassing),
"If true, don't pass auth token in git parameters",
new RuntimeKnobSource("agent.GitUseSecureParameterPassing"),
new EnvironmentKnobSource("AGENT_GIT_USE_SECURE_PARAMETER_PASSING"),
new BuiltInDefaultKnobSource("true"));
public static readonly Knob FixPossibleGitOutOfMemoryProblem = new Knob(
nameof(FixPossibleGitOutOfMemoryProblem),
"When true, set config git properties to fix possible out of memory problem",
new RuntimeKnobSource("FIX_POSSIBLE_GIT_OUT_OF_MEMORY_PROBLEM"),
new EnvironmentKnobSource("FIX_POSSIBLE_GIT_OUT_OF_MEMORY_PROBLEM"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseGitLongPaths = new Knob(
nameof(UseGitLongPaths),
"When true, set core.longpaths to true",
new RuntimeKnobSource("USE_GIT_LONG_PATHS"),
new EnvironmentKnobSource("USE_GIT_LONG_PATHS"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseGitSingleThread = new Knob(
nameof(UseGitSingleThread),
"When true, spawn only one thread searching for best delta matches",
new RuntimeKnobSource("USE_GIT_SINGLE_THREAD"),
new EnvironmentKnobSource("USE_GIT_SINGLE_THREAD"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob AgentTerminalEncoding = new Knob(
nameof(AgentTerminalEncoding),
"If the correct encoding name is specified, the encoding from the environment will be used instead of default UTF-8",
new EnvironmentKnobSource("AGENT_TERMINAL_ENCODING"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob TfVCUseSecureParameterPassing = new Knob(
nameof(TfVCUseSecureParameterPassing),
"If true, don't pass auth token in TFVC parameters",
new RuntimeKnobSource("agent.TfVCUseSecureParameterPassing"),
new EnvironmentKnobSource("AGENT_TFVC_USE_SECURE_PARAMETER_PASSING"),
new BuiltInDefaultKnobSource("true"));
public const string QuietCheckoutRuntimeVarName = "agent.source.checkout.quiet";
public const string QuietCheckoutEnvVarName = "AGENT_SOURCE_CHECKOUT_QUIET";
public static readonly Knob QuietCheckout = new Knob(
nameof(QuietCheckout),
"Aggressively reduce what gets logged to the console when checking out source.",
new RuntimeKnobSource(QuietCheckoutRuntimeVarName),
new EnvironmentKnobSource(QuietCheckoutEnvVarName),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseNode10 = new Knob(
nameof(UseNode10),
"Forces the agent to use Node 10 handler for all Node-based tasks",
new RuntimeKnobSource("AGENT_USE_NODE10"),
new EnvironmentKnobSource("AGENT_USE_NODE10"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseNode20_1 = new Knob(
nameof(UseNode20_1),
"Forces the agent to use Node 20 handler for all Node-based tasks",
new RuntimeKnobSource("AGENT_USE_NODE20_1"),
new EnvironmentKnobSource("AGENT_USE_NODE20_1"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseNode20InUnsupportedSystem = new Knob(
nameof(UseNode20InUnsupportedSystem),
"Forces the agent to use Node 20 handler for all Node-based tasks, even if it's in an unsupported system",
new RuntimeKnobSource("AGENT_USE_NODE20_IN_UNSUPPORTED_SYSTEM"),
new EnvironmentKnobSource("AGENT_USE_NODE20_IN_UNSUPPORTED_SYSTEM"),
new BuiltInDefaultKnobSource("false"));
// Agent logging
public static readonly Knob AgentPerflog = new Knob(
nameof(AgentPerflog),
"If set, writes a perf counter trace for the agent. Writes to the location set in this variable.",
new EnvironmentKnobSource("VSTS_AGENT_PERFLOG"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob TraceVerbose = new Knob(
nameof(TraceVerbose),
"If set to anything, trace level will be verbose",
new EnvironmentKnobSource("VSTSAGENT_TRACE"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob DebugTask = new Knob(
nameof(DebugTask),
"If the agent executes a task which ID or name matches the value provided, it will run the task so that it will wait for debugger to attach",
new EnvironmentKnobSource("VSTSAGENT_DEBUG_TASK"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob DumpJobEventLogs = new Knob(
nameof(DumpJobEventLogs),
"If true, dump event viewer logs",
new RuntimeKnobSource("VSTSAGENT_DUMP_JOB_EVENT_LOGS"),
new EnvironmentKnobSource("VSTSAGENT_DUMP_JOB_EVENT_LOGS"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DisableTestsMetadata = new Knob(
nameof(DisableTestsMetadata),
"If true, publishing tests metadata to evidence store will be disabled.",
new RuntimeKnobSource("AZP_AGENT_DISABLE_TESTS_METADATA"),
new EnvironmentKnobSource("AZP_AGENT_DISABLE_TESTS_METADATA"),
new BuiltInDefaultKnobSource("false"));
// Diag logging
public static readonly Knob AgentDiagLogPath = new Knob(
nameof(AgentDiagLogPath),
"If set to anything, the folder containing the agent diag log will be created here.",
new EnvironmentKnobSource("AGENT_DIAGLOGPATH"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob WorkerDiagLogPath = new Knob(
nameof(WorkerDiagLogPath),
"If set to anything, the folder containing the agent worker diag log will be created here.",
new EnvironmentKnobSource("WORKER_DIAGLOGPATH"),
new BuiltInDefaultKnobSource(string.Empty));
// Timeouts
public static readonly Knob AgentChannelTimeout = new Knob(
nameof(AgentChannelTimeout),
"Timeout for channel communication between agent listener and worker processes.",
new EnvironmentKnobSource("VSTS_AGENT_CHANNEL_TIMEOUT"),
new BuiltInDefaultKnobSource("30"));
public static readonly Knob AgentDownloadTimeout = new Knob(
nameof(AgentDownloadTimeout),
"Amount of time in seconds to wait for the agent to download a new version when updating",
new EnvironmentKnobSource("AZP_AGENT_DOWNLOAD_TIMEOUT"),
new BuiltInDefaultKnobSource("1500")); // 25*60
public static readonly Knob TaskDownloadTimeout = new Knob(
nameof(TaskDownloadTimeout),
"Amount of time in seconds to wait for the agent to download a task when starting a job",
new EnvironmentKnobSource("VSTS_TASK_DOWNLOAD_TIMEOUT"),
new BuiltInDefaultKnobSource("1200")); // 20*60
public static readonly Knob TaskDownloadRetryLimit = new Knob(
nameof(TaskDownloadRetryLimit),
"Attempts to download a task when starting a job",
new EnvironmentKnobSource("VSTS_TASK_DOWNLOAD_RETRY_LIMIT"),
new BuiltInDefaultKnobSource("3"));
public static readonly Knob ProccessSigintTimeout = new Knob(
nameof(ProccessSigintTimeout),
"Timeout for SIGINT signal during a process cancelation",
new RuntimeKnobSource("PROCESS_SIGINT_TIMEOUT"),
new EnvironmentKnobSource("PROCESS_SIGINT_TIMEOUT"),
new BuiltInDefaultKnobSource("7500"));
public static readonly Knob ProccessSigtermTimeout = new Knob(
nameof(ProccessSigtermTimeout),
"Timeout for SIGTERM signal during a process cancelation",
new RuntimeKnobSource("PROCESS_SIGTERM_TIMEOUT"),
new EnvironmentKnobSource("PROCESS_SIGTERM_TIMEOUT"),
new BuiltInDefaultKnobSource("2500"));
public static readonly Knob UseGracefulProcessShutdown = new Knob(
nameof(UseGracefulProcessShutdown),
"Attemts to use only graceful process shutdown unless hard required",
new RuntimeKnobSource("USE_GRACEFUL_PROCESS_SHUTDOWN"),
new EnvironmentKnobSource("USE_GRACEFUL_PROCESS_SHUTDOWN"),
new BuiltInDefaultKnobSource("false"));
// HTTP
public const string LegacyHttpVariableName = "AZP_AGENT_USE_LEGACY_HTTP";
public static readonly Knob UseLegacyHttpHandler = new DeprecatedKnob(
nameof(UseLegacyHttpHandler),
"Use the libcurl-based HTTP handler rather than .NET's native HTTP handler, as we did on .NET Core 2.1",
"Legacy http handler will be removed in one of the next agent releases with migration to .Net Core 6. We are highly recommend to not use it.",
new EnvironmentKnobSource(LegacyHttpVariableName),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob HttpRetryCount = new Knob(
nameof(HttpRetryCount),
"Number of times to retry Http requests",
new EnvironmentKnobSource("VSTS_HTTP_RETRY"),
new BuiltInDefaultKnobSource("3"));
public static readonly Knob HttpTimeout = new Knob(
nameof(HttpTimeout),
"Timeout for Http requests",
new EnvironmentKnobSource("VSTS_HTTP_TIMEOUT"),
new BuiltInDefaultKnobSource("100"));
public static readonly Knob HttpTrace = new Knob(
nameof(HttpTrace),
"Enable http trace if true",
new EnvironmentKnobSource("VSTS_AGENT_HTTPTRACE"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob NoProxy = new Knob(
nameof(NoProxy),
"Proxy bypass list if one exists. Should be comma seperated",
new EnvironmentKnobSource("no_proxy"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob ProxyAddress = new Knob(
nameof(ProxyAddress),
"Proxy server address if one exists",
new EnvironmentKnobSource("VSTS_HTTP_PROXY"),
new EnvironmentKnobSource("http_proxy"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob ProxyPassword = new SecretKnob(
nameof(ProxyPassword),
"Proxy password if one exists",
new EnvironmentKnobSource("VSTS_HTTP_PROXY_PASSWORD"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob ProxyUsername = new SecretKnob(
nameof(ProxyUsername),
"Proxy username if one exists",
new EnvironmentKnobSource("VSTS_HTTP_PROXY_USERNAME"),
new BuiltInDefaultKnobSource(string.Empty));
// Secrets masking
public static readonly Knob AllowUnsafeMultilineSecret = new Knob(
nameof(AllowUnsafeMultilineSecret),
"WARNING: enabling this may allow secrets to leak. Allows multi-line secrets to be set. Unsafe because it is possible for log lines to get dropped in agent failure cases, causing the secret to not get correctly masked. We recommend leaving this option off.",
new RuntimeKnobSource("SYSTEM_UNSAFEALLOWMULTILINESECRET"),
new EnvironmentKnobSource("SYSTEM_UNSAFEALLOWMULTILINESECRET"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob MaskedSecretMinLength = new Knob(
nameof(MaskedSecretMinLength),
"Specify the length of the secrets, which, if shorter, will be ignored in the logs.",
new RuntimeKnobSource("AZP_IGNORE_SECRETS_SHORTER_THAN"),
new EnvironmentKnobSource("AZP_IGNORE_SECRETS_SHORTER_THAN"),
new BuiltInDefaultKnobSource("0"));
// Misc
public static readonly Knob EnableIssueSourceValidation = new Knob(
nameof(EnableIssueSourceValidation),
"When true, enable issue source validation for the task.issue command.",
new RuntimeKnobSource("ENABLE_ISSUE_SOURCE_VALIDATION"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DisableAgentDowngrade = new Knob(
nameof(DisableAgentDowngrade),
"Disable agent downgrades. Upgrades will still be allowed.",
new EnvironmentKnobSource("AZP_AGENT_DOWNGRADE_DISABLED"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob AcknowledgeNoUpdates = new Knob(
nameof(AcknowledgeNoUpdates),
"Opt-in to continue using agent without updates on unsopperted OS",
new EnvironmentKnobSource("AGENT_ACKNOWLEDGE_NO_UPDATES"),
new RuntimeKnobSource("AGENT_ACKNOWLEDGE_NO_UPDATES"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob AgentFailOnIncompatibleOS = new Knob(
nameof(AgentFailOnIncompatibleOS),
"Allow agent to fail pipelines on incompatible OS",
new EnvironmentKnobSource("AGENT_FAIL_ON_INCOMPATIBLE_OS"),
new RuntimeKnobSource("AGENT_FAIL_ON_INCOMPATIBLE_OS"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob AgentEnablePipelineArtifactLargeChunkSize = new Knob(
nameof(AgentEnablePipelineArtifactLargeChunkSize),
"Enables large chunk size for pipeline artifacts.",
new EnvironmentKnobSource("AGENT_ENABLE_PIPELINEARTIFACT_LARGE_CHUNK_SIZE"),
new RuntimeKnobSource("AGENT_ENABLE_PIPELINEARTIFACT_LARGE_CHUNK_SIZE"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob PermissionsCheckFailsafe = new Knob(
nameof(PermissionsCheckFailsafe),
"Maximum depth of file permitted in directory hierarchy when checking permissions. Check to avoid accidentally entering infinite loops.",
new EnvironmentKnobSource("AGENT_TEST_VALIDATE_EXECUTE_PERMISSIONS_FAILSAFE"),
new BuiltInDefaultKnobSource("100"));
public static readonly Knob DisableInputTrimming = new Knob(
nameof(DisableInputTrimming),
"By default, the agent trims whitespace and new line characters from all task inputs. Setting this to true disables this behavior.",
new EnvironmentKnobSource("DISABLE_INPUT_TRIMMING"),
new RuntimeKnobSource("DISABLE_INPUT_TRIMMING"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob EnableVariableInputTrimming = new Knob(
nameof(EnableVariableInputTrimming),
"By default, the agent does not trim whitespace and new line characters if an input comes from a variable. Setting this to true enables this behavior.",
new EnvironmentKnobSource("AGENT_ENABLE_VARIABLE_INPUT_TRIMMING"),
new RuntimeKnobSource("AGENT_ENABLE_VARIABLE_INPUT_TRIMMING"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DecodePercents = new Knob(
nameof(DecodePercents),
"By default, the agent does not decodes %AZP25 as % which may be needed to allow users to work around reserved values. Setting this to true enables this behavior.",
new RuntimeKnobSource("DECODE_PERCENTS"),
new EnvironmentKnobSource("DECODE_PERCENTS"),
new BuiltInDefaultKnobSource("true"));
public static readonly Knob AllowTfvcUnshelveErrors = new Knob(
nameof(AllowTfvcUnshelveErrors),
"By default, the TFVC unshelve command does not throw errors e.g. when there's no mapping for one or more files shelved. Setting this to true enables this behavior.",
new RuntimeKnobSource("ALLOW_TFVC_UNSHELVE_ERRORS"),
new EnvironmentKnobSource("ALLOW_TFVC_UNSHELVE_ERRORS"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob EnableFCSItemPathFix = new Knob(
nameof(EnableFCSItemPathFix),
"If true, enable the fix for the path of the item when associating or uploading to the file container server.",
new RuntimeKnobSource("ENABLE_FCS_ITEM_PATH_FIX"),
new EnvironmentKnobSource("ENABLE_FCS_ITEM_PATH_FIX"),
new BuiltInDefaultKnobSource("false"));
// Set DISABLE_JAVA_CAPABILITY_HIGHER_THAN_9 variable with any value
// to disable recognition of Java higher than 9
public static readonly Knob DisableRecognitionOfJDKHigherThen9 = new Knob(
nameof(DisableRecognitionOfJDKHigherThen9),
"Recognize JDK and JRE >= 9 installed on the machine as agent capability. Setting any value to DISABLE_JAVA_CAPABILITY_HIGHER_THAN_9 is disabling this behavior",
new EnvironmentKnobSource("DISABLE_JAVA_CAPABILITY_HIGHER_THAN_9"),
new BuiltInDefaultKnobSource(string.Empty));
// TODO: Added 5/27/21. Please remove within a month or two
public static readonly Knob DisableBuildArtifactsToBlob = new Knob(
nameof(DisableBuildArtifactsToBlob),
"By default, the agent will upload build artifacts to Blobstore. Setting this to true will disable that integration. This variable is temporary and will be removed.",
new RuntimeKnobSource("DISABLE_BUILD_ARTIFACTS_TO_BLOB"),
new EnvironmentKnobSource("DISABLE_BUILD_ARTIFACTS_TO_BLOB"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob SendBuildArtifactsToBlobstoreDomain = new Knob(
nameof(SendBuildArtifactsToBlobstoreDomain),
"When set, defines the domain to use to send Build artifacts to.",
new RuntimeKnobSource("SEND_BUILD_ARTIFACTS_TO_BLOBSTORE_DOMAIN"),
new EnvironmentKnobSource("SEND_BUILD_ARTIFACT_ARTIFACTS_TO_BLOBSTORE_DOMAIN"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob SendPipelineArtifactsToBlobstoreDomain = new Knob(
nameof(SendPipelineArtifactsToBlobstoreDomain),
"When set, defines the domain to use to send Pipeline artifacts to.",
new RuntimeKnobSource("SEND_PIPELINE_ARTIFACTS_TO_BLOBSTORE_DOMAIN"),
new EnvironmentKnobSource("SEND_PIPELINE_ARTIFACT_ARTIFACTS_TO_BLOBSTORE_DOMAIN"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob EnableIncompatibleBuildArtifactsPathResolution = new Knob(
nameof(EnableIncompatibleBuildArtifactsPathResolution),
"Return DownloadBuildArtifactsV1 target path resolution behavior back to how it was originally implemented. This breaks back compatibility with DownloadBuildArtifactsV0.",
new RuntimeKnobSource("EnableIncompatibleBuildArtifactsPathResolution"),
new EnvironmentKnobSource("EnableIncompatibleBuildArtifactsPathResolution"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DisableAuthenticodeValidation = new Knob(
nameof(DisableAuthenticodeValidation),
"Disables authenticode validation for agent package during self update. Set this to any non-empty value to disable.",
new EnvironmentKnobSource("DISABLE_AUTHENTICODE_VALIDATION"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob DisableHashValidation = new Knob(
nameof(DisableHashValidation),
"If true, the agent will skip package hash validation during self-updating.",
new EnvironmentKnobSource("DISABLE_HASH_VALIDATION"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob EnableVSPreReleaseVersions = new Knob(
nameof(EnableVSPreReleaseVersions),
"If true, the agent will include to seach VisualStudio prerelease versions to capabilities.",
new EnvironmentKnobSource("ENABLE_VS_PRERELEASE_VERSIONS"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DisableOverrideTfvcBuildDirectory = new Knob(
nameof(DisableOverrideTfvcBuildDirectory),
"Disables override of Tfvc build directory name by agentId on hosted agents (one tfvc repo used).",
new RuntimeKnobSource("DISABLE_OVERRIDE_TFVC_BUILD_DIRECTORY"),
new EnvironmentKnobSource("DISABLE_OVERRIDE_TFVC_BUILD_DIRECTORY"),
new BuiltInDefaultKnobSource("false"));
/// <remarks>We need to remove this knob - once Node 6 handler is dropped</remarks>
public static readonly Knob DisableNode6DeprecationWarning = new Knob(
nameof(DisableNode6DeprecationWarning),
"Disables Node 6 deprecation warnings.",
new RuntimeKnobSource("DISABLE_NODE6_DEPRECATION_WARNING"),
new EnvironmentKnobSource("DISABLE_NODE6_DEPRECATION_WARNING"),
new BuiltInDefaultKnobSource("true"));
public static readonly Knob DisableNode6Tasks = new Knob(
nameof(DisableNode6Tasks),
"Disables Node 6 tasks and Node 6 runner.",
new RuntimeKnobSource("AGENT_DISABLE_NODE6_TASKS"),
new EnvironmentKnobSource("AGENT_DISABLE_NODE6_TASKS"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DisableTeePluginRemoval = new Knob(
nameof(DisableTeePluginRemoval),
"Disables removing TEE plugin after using it during checkout.",
new RuntimeKnobSource("DISABLE_TEE_PLUGIN_REMOVAL"),
new EnvironmentKnobSource("DISABLE_TEE_PLUGIN_REMOVAL"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob TeePluginDownloadRetryCount = new Knob(
nameof(TeePluginDownloadRetryCount),
"Number of times to retry downloading TEE plugin",
new RuntimeKnobSource("TEE_PLUGIN_DOWNLOAD_RETRY_COUNT"),
new EnvironmentKnobSource("TEE_PLUGIN_DOWNLOAD_RETRY_COUNT"),
new BuiltInDefaultKnobSource("3"));
public static readonly Knob DumpPackagesVerificationResult = new Knob(
nameof(DumpPackagesVerificationResult),
"If true, dumps info about invalid MD5 sums of installed packages",
new RuntimeKnobSource("VSTSAGENT_DUMP_PACKAGES_VERIFICATION_RESULTS"),
new EnvironmentKnobSource("VSTSAGENT_DUMP_PACKAGES_VERIFICATION_RESULTS"),
new BuiltInDefaultKnobSource("false"));
public const string ContinueAfterCancelProcessTreeKillAttemptVariableName = "VSTSAGENT_CONTINUE_AFTER_CANCEL_PROCESSTREEKILL_ATTEMPT";
public static readonly Knob ContinueAfterCancelProcessTreeKillAttempt = new Knob(
nameof(ContinueAfterCancelProcessTreeKillAttempt),
"If true, continue cancellation after attempt to KillProcessTree",
new RuntimeKnobSource(ContinueAfterCancelProcessTreeKillAttemptVariableName),
new EnvironmentKnobSource(ContinueAfterCancelProcessTreeKillAttemptVariableName),
new BuiltInDefaultKnobSource("false"));
public const string VstsAgentNodeWarningsVariableName = "VSTSAGENT_ENABLE_NODE_WARNINGS";
public static readonly Knob AgentDeprecatedNodeWarnings = new Knob(
nameof(AgentDeprecatedNodeWarnings),
"If true shows warning on depricated node (6) tasks",
new RuntimeKnobSource(VstsAgentNodeWarningsVariableName),
new EnvironmentKnobSource(VstsAgentNodeWarningsVariableName),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseNode = new Knob(
nameof(UseNode),
"Forces the agent to use different version of Node if when configured runner is not available. Possible values: LTS - make agent use latest LTS version of Node; UPGRADE - make agent use next available version of Node",
new RuntimeKnobSource("AGENT_USE_NODE"),
new EnvironmentKnobSource("AGENT_USE_NODE"),
new BuiltInDefaultKnobSource(string.Empty));
public static readonly Knob ProcessHandlerSecureArguments = new Knob(
nameof(ProcessHandlerSecureArguments),
"Enables passing arguments for process handler secure way",
new RuntimeKnobSource("AZP_75787_ENABLE_NEW_LOGIC"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob ProcessHandlerSecureArgumentsAudit = new Knob(
nameof(ProcessHandlerSecureArguments),
"Enables logging of passing arguments for process handler secure way",
new RuntimeKnobSource("AZP_75787_ENABLE_NEW_LOGIC_LOG"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob ProcessHandlerTelemetry = new Knob(
nameof(ProcessHandlerTelemetry),
"Enables publishing telemetry about processing of arguments for Process Handler",
new RuntimeKnobSource("AZP_75787_ENABLE_COLLECT"),
new EnvironmentKnobSource("AZP_75787_ENABLE_COLLECT"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseNewNodeHandlerTelemetry = new Knob(
nameof(UseNewNodeHandlerTelemetry),
"Enables new approach to publish node handler information to the telemetry",
new PipelineFeatureSource("USENEWNODEHANDLERTELEMETRY"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob ProcessHandlerEnableNewLogic = new Knob(
nameof(ProcessHandlerEnableNewLogic),
"Enables new args protect logic for process handler",
new RuntimeKnobSource("AZP_75787_ENABLE_NEW_PH_LOGIC"),
new EnvironmentKnobSource("AZP_75787_ENABLE_NEW_PH_LOGIC"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseProcessHandlerV2 = new Knob(
nameof(UseProcessHandlerV2),
"Enables new Process handler (v2)",
new PipelineFeatureSource("UseProcessHandlerV2"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DisableDrainQueuesAfterTask = new Knob(
nameof(DisableDrainQueuesAfterTask),
"Forces the agent to disable draining queues after each task",
new RuntimeKnobSource("AGENT_DISABLE_DRAIN_QUEUES_AFTER_TASK"),
new EnvironmentKnobSource("AGENT_DISABLE_DRAIN_QUEUES_AFTER_TASK"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob EnableResourceMonitorDebugOutput = new Knob(
nameof(EnableResourceMonitorDebugOutput),
"If true, the agent will show the resource monitor output for debug runs",
new RuntimeKnobSource("AZP_ENABLE_RESOURCE_MONITOR_DEBUG_OUTPUT"),
new EnvironmentKnobSource("AZP_ENABLE_RESOURCE_MONITOR_DEBUG_OUTPUT"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob EnableResourceUtilizationWarnings = new Knob(
nameof(EnableResourceUtilizationWarnings),
"If true, the agent will throw the resource utilization warnings",
new RuntimeKnobSource("AZP_ENABLE_RESOURCE_UTILIZATION_WARNINGS"),
new EnvironmentKnobSource("AZP_ENABLE_RESOURCE_UTILIZATION_WARNINGS"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob ForceCreateTasksDirectory = new Knob(
nameof(ForceCreateTasksDirectory),
"Forces the agent to create _tasks folder for tasks.",
new RuntimeKnobSource("AGENT_FORCE_CREATE_TASKS_DIRECTORY"),
new EnvironmentKnobSource("AGENT_FORCE_CREATE_TASKS_DIRECTORY"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob CleanupPSModules = new Knob(
nameof(CleanupPSModules),
"Removes the PSModulePath environment variable if the agent is running in PowerShell.",
new RuntimeKnobSource("AZP_AGENT_CLEANUP_PSMODULES_IN_POWERSHELL"),
new EnvironmentKnobSource("AZP_AGENT_CLEANUP_PSMODULES_IN_POWERSHELL"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DisableCleanRepoDefaultValue = new DeprecatedKnob(
nameof(DisableCleanRepoDefaultValue),
"Avoid to set default value if build.repository.clean variable is not set on Trigger Yaml UI or in checkout steps yaml config",
new EnvironmentKnobSource("AGENT_DISABLE_CLEAN_REPO_DEFAULT_VALUE"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob IgnoreVSTSTaskLib = new Knob(
nameof(IgnoreVSTSTaskLib),
"Ignores the VSTSTaskLib folder when copying tasks.",
new RuntimeKnobSource("AZP_AGENT_IGNORE_VSTSTASKLIB"),
new EnvironmentKnobSource("AZP_AGENT_IGNORE_VSTSTASKLIB"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob FailJobWhenAgentDies = new Knob(
nameof(FailJobWhenAgentDies),
"Mark the Job as Failed instead of Canceled when the Agent dies due to User Cancellation or Shutdown",
new RuntimeKnobSource("FAIL_JOB_WHEN_AGENT_DIES"),
new EnvironmentKnobSource("FAIL_JOB_WHEN_AGENT_DIES"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob AllowWorkDirectoryRepositories = new Knob(
nameof(AllowWorkDirectoryRepositories),
"Allows repositories to be checked out below work directory level on self hosted agents.",
new RuntimeKnobSource("AZP_AGENT_ALLOW_WORK_DIRECTORY_REPOSITORIES"),
new EnvironmentKnobSource("AZP_AGENT_ALLOW_WORK_DIRECTORY_REPOSITORIES"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob CheckForTaskDeprecation = new Knob(
nameof(CheckForTaskDeprecation),
"If true, the agent will check in the 'Initialize job' step each task used in the job for task deprecation.",
new RuntimeKnobSource("AZP_AGENT_CHECK_FOR_TASK_DEPRECATION"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob CheckIfTaskNodeRunnerIsDeprecated246 = new Knob(
nameof(CheckIfTaskNodeRunnerIsDeprecated246),
"If true, the agent will check in the 'Initialize job' step each task used in the job if this task has node handlers, and all of them are deprecated.",
new RuntimeKnobSource("AZP_AGENT_CHECK_IF_TASK_NODE_RUNNER_IS_DEPRECATED_246"),
new PipelineFeatureSource("CheckIfTaskNodeRunnerIsDeprecated246"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseNode20ToStartContainer = new Knob(
nameof(UseNode20ToStartContainer),
"If true, the agent will use Node 20 to start docker container when executing container job and the container platform is the same as the host platform.",
new RuntimeKnobSource("AZP_AGENT_USE_NODE20_TO_START_CONTAINER"),
new PipelineFeatureSource("UseNode20ToStartContainer"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob EnableNewSecretMasker = new Knob(
nameof(EnableNewSecretMasker),
"If true, the agent will use new SecretMasker with additional filters & performance enhancements",
new EnvironmentKnobSource("AZP_ENABLE_NEW_SECRET_MASKER"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob AddDockerInitOption = new Knob(
nameof(AddDockerInitOption),
"If true, the agent will create docker container with the --init option.",
new RuntimeKnobSource("AZP_AGENT_DOCKER_INIT_OPTION"),
new EnvironmentKnobSource("AZP_AGENT_DOCKER_INIT_OPTION"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob LogTaskNameInUserAgent = new Knob(
nameof(LogTaskNameInUserAgent),
"If true, agent will log the task name in user agent.",
new RuntimeKnobSource("AZP_AGENT_LOG_TASKNAME_IN_USERAGENT"),
new EnvironmentKnobSource("AZP_AGENT_LOG_TASKNAME_IN_USERAGENT"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseFetchFilterInCheckoutTask = new Knob(
nameof(UseFetchFilterInCheckoutTask),
"If true, agent will use fetch filter in checkout task.",
new RuntimeKnobSource("AGENT_USE_FETCH_FILTER_IN_CHECKOUT_TASK"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob StoreAgentKeyInCSPContainer = new Knob(
nameof(StoreAgentKeyInCSPContainer),
"Store agent key in named container (Windows).",
new EnvironmentKnobSource("STORE_AGENT_KEY_IN_CSP_CONTAINER"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob AgentKeyUseCng = new Knob(
nameof(AgentKeyUseCng),
"Use CNG API to store agent key. Note: Uses Private User Storage",
new EnvironmentKnobSource("AGENT_KEY_USE_CNG"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob RsaKeyGetConfigFromFF = new Knob(
nameof(RsaKeyGetConfigFromFF),
"Get config from FF.",
new EnvironmentKnobSource("RSAKEYGETCONFIGFROMFF"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob DisableResourceUtilizationWarnings = new Knob(
nameof(DisableResourceUtilizationWarnings),
"If true, agent will not throw warnings related to high resource utilization",
new RuntimeKnobSource("DISABLE_RESOURCE_UTILIZATION_WARNINGS"),
new EnvironmentKnobSource("DISABLE_RESOURCE_UTILIZATION_WARNINGS"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob Rosetta2Warning = new Knob(
nameof(Rosetta2Warning),
"Log warning when X64 Agent is used on a Apple Silicon device.",
new RuntimeKnobSource("ROSETTA2_WARNING"),
new EnvironmentKnobSource("ROSETTA2_WARNING"),
new PipelineFeatureSource("Rosetta2Warning"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob CheckPsModulesLocations = new Knob(
nameof(CheckPsModulesLocations),
"Checks if the PSModulePath environment variable contains locations specific to PowerShell Core.",
new EnvironmentKnobSource("AZP_AGENT_CHECK_PSMODULES_LOCATIONS"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseDockerStdinPasswordOnWindows = new Knob(
nameof(UseDockerStdinPasswordOnWindows),
"If true, use --password-stdin for docker login on Windows.",
new RuntimeKnobSource("AZP_AGENT_USE_DOCKER_STDIN_PASSWORD_WINDOWS"),
new PipelineFeatureSource("UseDockerStdinPasswordOnWindows"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob Net8UnsupportedOsWarning = new Knob(
nameof(Net8UnsupportedOsWarning),
"Show warning message on the OS which is not supported by .NET 8",
new PipelineFeatureSource("Net8UnsupportedOsWarning"),
new BuiltInDefaultKnobSource("true"));
public static readonly Knob UsePSScriptWrapper = new Knob(
nameof(UsePSScriptWrapper),
"Use PowerShell script wrapper to handle PowerShell ConstrainedLanguage mode.",
new PipelineFeatureSource("UsePSScriptWrapper"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob AddForceCredentialsToGitCheckout = new Knob(
nameof(AddForceCredentialsToGitCheckout),
"If true, the credentials will be forcibly added to the Git checkout command.",
new RuntimeKnobSource("ADD_FORCE_CREDENTIALS_TO_GIT_CHECKOUT"),
new PipelineFeatureSource(nameof(AddForceCredentialsToGitCheckout)),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob InstallLegacyTfExe = new Knob(
nameof(InstallLegacyTfExe),
"If true, the agent will install the legacy versions of TF, vstsom and vstshost",
new RuntimeKnobSource("AGENT_INSTALL_LEGACY_TF_EXE"),
new EnvironmentKnobSource("AGENT_INSTALL_LEGACY_TF_EXE"),
new PipelineFeatureSource("InstallLegacyTfExe"),
new BuiltInDefaultKnobSource("false"));
public static readonly Knob UseSparseCheckoutInCheckoutTask = new Knob(
nameof(UseSparseCheckoutInCheckoutTask),
"If true, agent will use sparse checkout in checkout task.",
new RuntimeKnobSource("AGENT_USE_SPARSE_CHECKOUT_IN_CHECKOUT_TASK"),
new BuiltInDefaultKnobSource("false"));
}
}