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 690a8cb
Show file tree
Hide file tree
Showing 2 changed files with 14 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"));
}
}
7 changes: 6 additions & 1 deletion src/Agent.Worker/TaskManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,13 @@ into taskGrouping
Trace.Info("Skip download checkout task.");
continue;
}

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

if (!AgentKnobs.DisableTaskDeprecationCheck.GetValue(UtilKnobValueContext.Instance()).AsBoolean())
{
CheckTaskDeprecation(executionContext, task);
}
}
}

Expand Down

0 comments on commit 690a8cb

Please sign in to comment.