Skip to content

Commit

Permalink
Rename Knob
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisRumyantsev committed Oct 11, 2023
1 parent 845f7df commit e1250d4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions .azure-pipelines/build-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ jobs:
- script: ${{ variables.devCommand }} testl0 Debug ${{ parameters.os }}-${{ parameters.arch }}
workingDirectory: src
displayName: Unit tests
timeoutInMinutes: 5

# Install nuget
- ${{ if eq(parameters.os, 'win') }}:
Expand Down
8 changes: 4 additions & 4 deletions src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -519,10 +519,10 @@ public class AgentKnobs
new EnvironmentKnobSource("AZP_AGENT_IGNORE_VSTSTASKLIB"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob DisableTaskDeprecationCheck = new Knob(
nameof(DisableTaskDeprecationCheck),
"Disables the task deprecation check.",
new EnvironmentKnobSource("AZP_AGENT_DISABLE_TASK_DEPRECATION_CHECK"),
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 EnvironmentKnobSource("AZP_AGENT_CHECK_FOR_TASK_DEPRECATION"),
new BuiltInDefaultKnobSource("false"));
}
}
6 changes: 3 additions & 3 deletions src/Agent.Worker/TaskManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ into taskGrouping

await DownloadAsync(executionContext, task);

if (!AgentKnobs.DisableTaskDeprecationCheck.GetValue(UtilKnobValueContext.Instance()).AsBoolean())
if (AgentKnobs.CheckForTaskDeprecation.GetValue(UtilKnobValueContext.Instance()).AsBoolean())
{
CheckTaskDeprecation(executionContext, task);
CheckForTaskDeprecation(executionContext, task);
}
}
}
Expand Down Expand Up @@ -315,7 +315,7 @@ private async Task DownloadAsync(IExecutionContext executionContext, Pipelines.T
}
}

private void CheckTaskDeprecation(IExecutionContext executionContext, Pipelines.TaskStepDefinitionReference task)
private void CheckForTaskDeprecation(IExecutionContext executionContext, Pipelines.TaskStepDefinitionReference task)
{
string taskJsonPath = Path.Combine(GetDirectory(task), "task.json");
string taskJsonText = File.ReadAllText(taskJsonPath);
Expand Down

0 comments on commit e1250d4

Please sign in to comment.