Skip to content

Commit

Permalink
Add Knob
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisRumyantsev committed Oct 11, 2023
1 parent d8eff9e commit 9d4fe8b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -512,11 +512,18 @@ public class AgentKnobs
new EnvironmentKnobSource("AGENT_DISABLE_CLEAN_REPO_DEFAULT_VALUE"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob IgnoreVSTSTaskLib = new Knob(
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 DisableTaskDeprecationCheck = new Knob(
nameof(DisableTaskDeprecationCheck),
"Disables the task deprecation check.",
new RuntimeKnobSource("AZP_AGENT_DISABLE_TASK_DEPRECATION_CHECK"),
new EnvironmentKnobSource("AZP_AGENT_DISABLE_TASK_DEPRECATION_CHECK"),
new BuiltInDefaultKnobSource("false"));
}
}
8 changes: 7 additions & 1 deletion src/Agent.Worker/TaskManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,14 @@ into taskGrouping
Trace.Info("Skip download checkout task.");
continue;
}

await DownloadAsync(executionContext, task);
CheckTaskDeprecation(executionContext, task);

bool disableTaskDeprecationCheck = AgentKnobs.DisableTaskDeprecationCheck.GetValue(executionContext).AsBoolean();
if (!disableTaskDeprecationCheck)
{
CheckTaskDeprecation(executionContext, task);
}
}
}

Expand Down

0 comments on commit 9d4fe8b

Please sign in to comment.