Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default value if build repository clean is not set #4356

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5473594
Added telemetry classes to produce inline publish functionality
ismayilov-ismayil Jun 23, 2023
b683b83
Clean PR and remove unnecessary changes
ismayilov-ismayil Jun 30, 2023
e717f1b
Merge branch 'master' into users/ismayilov-ismayil/apply-telemetry-on…
ismayilov-ismayil Jun 30, 2023
a98b50a
Added DI for tests
ismayilov-ismayil Jul 3, 2023
8cb87cb
Merge branch 'users/ismayilov-ismayil/apply-telemetry-on-listener' of…
ismayilov-ismayil Jul 3, 2023
291aa33
Merge branch 'master' into users/ismayilov-ismayil/apply-telemetry-on…
kirill-ivlev Jul 11, 2023
b8938bd
Add default value if build repository clean is not set
ismayilov-ismayil Jul 12, 2023
3a3cd0c
Merge branch 'master' into users/ismayilov-ismayil/build_clean_reposi…
ismayilov-ismayil Jul 13, 2023
a65a6ea
sync master
ismayilov-ismayil Jul 19, 2023
fff4c7d
Merge branch 'master' into users/ismayilov-ismayil/build_clean_reposi…
kirill-ivlev Jul 24, 2023
b54d9dc
Added DeprecatedKnob to keep backward compatibility
ismayilov-ismayil Aug 4, 2023
a329965
Sync with remote changes
ismayilov-ismayil Aug 4, 2023
eaa610c
Merge branch 'master' of https://github.com/microsoft/azure-pipelines…
ismayilov-ismayil Aug 7, 2023
41e008c
Merge branch 'master' into users/ismayilov-ismayil/build_clean_reposi…
ismayilov-ismayil Aug 16, 2023
3ab5153
Merge branch 'master' of https://github.com/microsoft/azure-pipelines…
ismayilov-ismayil Aug 16, 2023
66966ae
Merge branch 'master' into users/ismayilov-ismayil/build_clean_reposi…
ismayilov-ismayil Aug 16, 2023
22a7e04
Change context to provide SystemEnvironment data
ismayilov-ismayil Aug 16, 2023
c9af8a4
Merge branch 'users/ismayilov-ismayil/build_clean_repository_set_defa…
ismayilov-ismayil Aug 16, 2023
0bdafe5
Restore unrelated changes
ismayilov-ismayil Aug 16, 2023
33742f6
Merge branch 'master' into users/ismayilov-ismayil/build_clean_reposi…
ismayilov-ismayil Aug 16, 2023
d08296f
Merge branch 'master' into users/ismayilov-ismayil/build_clean_reposi…
ismayilov-ismayil Sep 11, 2023
693f71e
Merge branch 'master' into users/ismayilov-ismayil/build_clean_reposi…
ismayilov-ismayil Sep 18, 2023
e756f20
Merge branch 'master' of https://github.com/microsoft/azure-pipelines…
ismayilov-ismayil Sep 18, 2023
dcf27c6
Merge branch 'users/ismayilov-ismayil/build_clean_repository_set_defa…
ismayilov-ismayil Sep 18, 2023
9a2ca35
Fix merge conflicts error
ismayilov-ismayil Sep 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/Agent.Sdk/Knob/AgentKnobs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,13 @@ public class AgentKnobs
new EnvironmentKnobSource("AZP_AGENT_CLEANUP_PSMODULES_IN_POWERSHELL"),
new BuiltInDefaultKnobSource("false"));

public static readonly Knob IgnoreVSTSTaskLib = new Knob(
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"),
Expand Down
14 changes: 12 additions & 2 deletions src/Agent.Worker/Build/BuildJobExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.IO;
using System.Linq;
using Microsoft.TeamFoundation.DistributedTask.Pipelines;
using Agent.Sdk.Knob;

namespace Microsoft.VisualStudio.Services.Agent.Worker.Build
{
Expand Down Expand Up @@ -257,9 +258,18 @@ private void UpdateCheckoutTasksAndVariables(IExecutionContext executionContext,
executionContext.SetVariable(Constants.Variables.Build.RepoGitSubmoduleCheckout, submoduleCheckout.Value.ToString());
}

if (repoCleanFromSelf.HasValue)
// This condition is for maintaining backward compatibility.
// Remove the if-else condition and keep only the context inside the 'else' to set the default value in future releases.
if (AgentKnobs.DisableCleanRepoDefaultValue.GetValue(UtilKnobValueContext.Instance()).AsBoolean())
{
executionContext.SetVariable(Constants.Variables.Build.RepoClean, repoCleanFromSelf.Value.ToString());
if (repoCleanFromSelf.HasValue)
{
executionContext.SetVariable(Constants.Variables.Build.RepoClean, repoCleanFromSelf.Value.ToString());
}
}
else
{
executionContext.SetVariable(Constants.Variables.Build.RepoClean, repoCleanFromSelf.HasValue ? repoCleanFromSelf.Value.ToString() : "False");
}
}

Expand Down
Loading