Skip to content

Commit 9118d53

Browse files
committed
Resolve conflicts
2 parents 8fead96 + feaa563 commit 9118d53

File tree

940 files changed

+24728
-24604
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

940 files changed

+24728
-24604
lines changed

.npmrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
registry=https://pkgs.dev.azure.com/mseng/PipelineTools/_packaging/PipelineTools_PublicPackages/npm/registry/
2+
3+
always-auth=true

BuildConfigGen/EnsureUpdateModeVerifier.cs

Lines changed: 50 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,25 @@ public IEnumerable<string> GetVerifyErrors(bool skipContentCheck)
3333

3434
if (!skipContentCheck)
3535
{
36+
foreach(var r in RedirectedToTempl)
37+
{
38+
string? sourceFile;
39+
string procesed = "";
40+
41+
string? tempToKeep = null;
42+
sourceFile = r.Value;
43+
procesed = $"(processed temp={sourceFile}) ";
44+
tempToKeep = sourceFile;
45+
46+
string? contentError = null;
47+
contentError = CompareFile(r, sourceFile, procesed, tempToKeep, contentError);
48+
49+
if (contentError is not null)
50+
{
51+
yield return contentError;
52+
}
53+
}
54+
3655
foreach (var r in CopiedFilesToCheck)
3756
{
3857
string? sourceFile;
@@ -49,30 +68,44 @@ public IEnumerable<string> GetVerifyErrors(bool skipContentCheck)
4968
sourceFile = r.Value;
5069
}
5170

52-
FileInfo fi = new FileInfo(r.Key);
71+
string? contentError = null;
72+
contentError = CompareFile(r, sourceFile, procesed, tempToKeep, contentError);
5373

54-
if (fi.Name.Equals("resources.resjson", StringComparison.OrdinalIgnoreCase))
74+
if (contentError is not null)
5575
{
56-
// resources.resjson is generated by make.js and does not need to be verified
57-
// it can differ between configs if configs have different inputs (causes verifier to fail);
76+
yield return contentError;
5877
}
59-
else
78+
}
79+
}
80+
}
81+
82+
private string? CompareFile(KeyValuePair<string, string> r, string sourceFile, string procesed, string? tempToKeep, string? contentError)
83+
{
84+
FileInfo fi = new FileInfo(r.Key);
85+
86+
if (fi.Name.Equals("resources.resjson", StringComparison.OrdinalIgnoreCase))
87+
{
88+
// resources.resjson is generated by make.js and does not need to be verified
89+
// it can differ between configs if configs have different inputs (causes verifier to fail);
90+
}
91+
else
92+
{
93+
if (Helpers.FilesEqual(sourceFile, r.Key))
94+
{
95+
// if overwrite and content match, everything is good! Verification passed.
96+
}
97+
else
98+
{
99+
if (tempToKeep != null)
60100
{
61-
if (Helpers.FilesEqual(sourceFile, r.Key))
62-
{
63-
// if overwrite and content match, everything is good! Verification passed.
64-
}
65-
else
66-
{
67-
if (tempToKeep != null)
68-
{
69-
this.tempsToKeep.Add(tempToKeep!);
70-
}
71-
yield return $"Content doesn't match {r.Value} {procesed}to {r.Key} (overwrite=true). Dest file doesn't match source.";
72-
}
101+
this.tempsToKeep.Add(tempToKeep!);
73102
}
103+
104+
contentError = $"Content doesn't match {r.Value} {procesed}to {r.Key} (overwrite=true). Dest file doesn't match source.";
74105
}
75106
}
107+
108+
return contentError;
76109
}
77110

78111
public void CleanupTempFiles()

BuildConfigGen/Program.cs

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
192192
}
193193

194194
UpdateMaxPatchForSprint(taskVersionInfo[t.Value.Name], currentSprint, ref maxPatchForCurrentSprint);
195-
CheckForDuplicates(t.Value.Name, taskVersionInfo[t.Value.Name].configTaskVersionMapping);
195+
CheckForDuplicates(t.Value.Name, taskVersionInfo[t.Value.Name].configTaskVersionMapping, checkGlobalVersion: false);
196196
}
197197

198198
if (tasksNeedingUpdates.Count > 0)
@@ -201,11 +201,14 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
201201
}
202202

203203
// bump patch number for global if any tasks invalidated or if there is no existing global version
204-
if (taskVersionInfo.Values.Any(x => x.versionsUpdated.Any()) || globalVersion is null)
204+
bool anyTaskVersionUpdated = taskVersionInfo.Values.Any(x => x.versionsUpdated.Any());
205+
bool noCurrentGlobalVersion = globalVersion is null;
206+
bool maxPatchForCurrentSprintGreaterOrEqualToGlobalPatch = globalVersion is not null && maxPatchForCurrentSprint >= globalVersion.Patch;
207+
if (anyTaskVersionUpdated || noCurrentGlobalVersion || maxPatchForCurrentSprintGreaterOrEqualToGlobalPatch)
205208
{
206209
maxPatchForCurrentSprint = maxPatchForCurrentSprint + 1;
207210

208-
Console.WriteLine($"Global version: maxPatchForCurrentSprint = maxPatchForCurrentSprint + 1");
211+
Console.WriteLine($"Global version: maxPatchForCurrentSprint = maxPatchForCurrentSprint + 1 anyTaskVersionUpdated={anyTaskVersionUpdated} noCurrentGlobalVersion={noCurrentGlobalVersion} maxPatchForCurrentSprintGreaterOrEqualToGlobalPatch={maxPatchForCurrentSprintGreaterOrEqualToGlobalPatch}");
209212
}
210213

211214
Console.WriteLine($"Global version update: globalVersion = {globalVersion} maxPatchForCurrentSprint={maxPatchForCurrentSprint}");
@@ -218,7 +221,7 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
218221
IEnumerable<string> configsList = FilterConfigsForTask(configs, t);
219222
HashSet<Config.ConfigRecord> targetConfigs = GetConfigRecords(configsList, writeUpdates);
220223
UpdateVersionsForTask(t.Value.Name, taskVersionInfo[t.Value.Name], targetConfigs, currentSprint, globalVersionPath, globalVersion, generatedFolder);
221-
CheckForDuplicates(t.Value.Name, taskVersionInfo[t.Value.Name].configTaskVersionMapping);
224+
CheckForDuplicates(t.Value.Name, taskVersionInfo[t.Value.Name].configTaskVersionMapping, checkGlobalVersion: true);
222225
}
223226
}
224227

@@ -264,7 +267,7 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
264267
HashSet<Config.ConfigRecord> targetConfigs = GetConfigRecords(configsList, writeUpdates);
265268

266269
UpdateVersionsGlobal(t.Value.Name, taskVersionInfo[t.Value.Name], targetConfigs, globalVersion);
267-
CheckForDuplicates(t.Value.Name, taskVersionInfo[t.Value.Name].configTaskVersionMapping);
270+
CheckForDuplicates(t.Value.Name, taskVersionInfo[t.Value.Name].configTaskVersionMapping, checkGlobalVersion: true);
268271
}
269272
}
270273

@@ -335,15 +338,25 @@ private static IEnumerable<string> FilterConfigsForTask(string? configs, KeyValu
335338
return configsList;
336339
}
337340

338-
private static void CheckForDuplicates(string task, Dictionary<Config.ConfigRecord, TaskVersion> configTaskVersionMapping)
341+
private static void CheckForDuplicates(string task, Dictionary<Config.ConfigRecord, TaskVersion> configTaskVersionMapping, bool checkGlobalVersion)
339342
{
340-
var duplicateVersions = configTaskVersionMapping.GroupBy(x => x.Value).Select(x => new { version = x.Key, configName = String.Join(",", x.Select(x => x.Key.name)), count = x.Count() }).Where(x => x.count > 1);
343+
var duplicateVersions = configTaskVersionMapping
344+
.Where(x => checkGlobalVersion || !x.Key.useGlobalVersion)
345+
.GroupBy(x => x.Value)
346+
.Select(x => new { version = x.Key, hasGlobal = x.Where(x => x.Key.useGlobalVersion).Any(), configName = String.Join(",", x.Select(x => x.Key.name)), count = x.Count() }).Where(x => x.count > 1);
341347
if (duplicateVersions.Any())
342348
{
343349
StringBuilder dupConfigsStr = new StringBuilder();
344350
foreach (var x in duplicateVersions)
345351
{
346-
dupConfigsStr.AppendLine($"task={task} version={x.version} specified in multiple configName={x.configName} config count={x.count}");
352+
if (x.hasGlobal)
353+
{
354+
dupConfigsStr.AppendLine($"task={task} version={x.version} specified in multiple configName={x.configName} config count={x.count}. To fix, check-in globalversion.txt change generated by running 'node make.js build --task {task} --includeLocalPackagesBuildConfig'");
355+
}
356+
else
357+
{
358+
dupConfigsStr.AppendLine($"task={task} version={x.version} specified in multiple configName={x.configName} config count={x.count}");
359+
}
347360
}
348361

349362
throw new Exception(dupConfigsStr.ToString());
@@ -549,7 +562,7 @@ private static void MainUpdateTask(
549562

550563
if (config.enableBuildConfigOverrides)
551564
{
552-
EnsureBuildConfigFileOverrides(config, taskTargetPath);
565+
EnsureBuildConfigFileOverrides(config, taskTargetPath, generatedFolder, task);
553566
}
554567

555568
try
@@ -600,7 +613,7 @@ private static void MainUpdateTask(
600613

601614
if (config.enableBuildConfigOverrides)
602615
{
603-
CopyConfigOverrides(gitRootPath, taskTargetPath, taskOutput, config);
616+
CopyConfigOverrides(gitRootPath, taskTargetPath, taskOutput, config, generatedFolder, task);
604617
}
605618

606619
// if some files aren't present in destination, stop as following code assumes they're present and we'll just get a FileNotFoundException
@@ -620,7 +633,7 @@ private static void MainUpdateTask(
620633

621634
if (config.isNode)
622635
{
623-
GetBuildConfigFileOverridePaths(config, taskTargetPath, out string configTaskPath, out string readmePath);
636+
GetBuildConfigFileOverridePaths(config, taskTargetPath, out string configTaskPath, out string readmePath, generatedFolder, task);
624637

625638
string buildConfigPackageJsonPath = Path.Combine(taskTargetPath, buildConfigs, configTaskPath, "package.json");
626639

@@ -781,15 +794,15 @@ private static bool HasTaskInputContainsPreprocessorInstructions(string gitRootP
781794
return hasPreprocessorDirectives;
782795
}
783796

784-
private static void EnsureBuildConfigFileOverrides(Config.ConfigRecord config, string taskTargetPath)
797+
private static void EnsureBuildConfigFileOverrides(Config.ConfigRecord config, string taskTargetPath, string generatedFolder, string taskName)
785798
{
786799
if (!config.enableBuildConfigOverrides)
787800
{
788801
throw new Exception("BUG: should not get here: !config.enableBuildConfigOverrides");
789802
}
790803

791804
string path, readmeFile;
792-
GetBuildConfigFileOverridePaths(config, taskTargetPath, out path, out readmeFile);
805+
GetBuildConfigFileOverridePaths(config, taskTargetPath, out path, out readmeFile, generatedFolder, taskName);
793806

794807
if (!Directory.Exists(path))
795808
{
@@ -799,7 +812,7 @@ private static void EnsureBuildConfigFileOverrides(Config.ConfigRecord config, s
799812
ensureUpdateModeVerifier!.WriteAllText(readmeFile, "Place files overridden for this config in this directory", suppressValidationErrorIfTargetPathDoesntExist: !Knob.Default.SourceDirectoriesMustContainPlaceHolders);
800813
}
801814

802-
private static void GetBuildConfigFileOverridePaths(Config.ConfigRecord config, string taskTargetPath, out string path, out string readmeFile)
815+
private static void GetBuildConfigFileOverridePaths(Config.ConfigRecord config, string taskTargetPath, out string path, out string readmeFile, string generatedFolder, string taskName)
803816
{
804817
string directoryName = config.name;
805818

@@ -813,19 +826,28 @@ private static void GetBuildConfigFileOverridePaths(Config.ConfigRecord config,
813826
directoryName = config.overriddenDirectoryName;
814827
}
815828

816-
path = Path.Combine(taskTargetPath, buildConfigs, directoryName);
817-
readmeFile = Path.Combine(taskTargetPath, buildConfigs, directoryName, filesOverriddenForConfigGoHereReadmeTxt);
829+
if (config.useGlobalVersion)
830+
{
831+
// for global version, place artifacts in _generated (such as package-lock)
832+
path = Path.Combine(generatedFolder, buildConfigs, taskName, directoryName);
833+
readmeFile = Path.Combine(generatedFolder, buildConfigs, taskName, directoryName, filesOverriddenForConfigGoHereReadmeTxt);
834+
}
835+
else
836+
{
837+
path = Path.Combine(taskTargetPath, buildConfigs, directoryName);
838+
readmeFile = Path.Combine(taskTargetPath, buildConfigs, directoryName, filesOverriddenForConfigGoHereReadmeTxt);
839+
}
818840
}
819841

820-
private static void CopyConfigOverrides(string gitRootPath, string taskTargetPath, string taskOutput, Config.ConfigRecord config)
842+
private static void CopyConfigOverrides(string gitRootPath, string taskTargetPath, string taskOutput, Config.ConfigRecord config, string generatedFolder, string taskName)
821843
{
822844
if (!config.enableBuildConfigOverrides)
823845
{
824846
throw new Exception("BUG: should not get here: !config.enableBuildConfigOverrides");
825847
}
826848

827849
string overridePathForBuildConfig;
828-
GetBuildConfigFileOverridePaths(config, taskTargetPath, out overridePathForBuildConfig, out _);
850+
GetBuildConfigFileOverridePaths(config, taskTargetPath, out overridePathForBuildConfig, out _, generatedFolder, taskName);
829851

830852
bool doCopy;
831853
if (Knob.Default.SourceDirectoriesMustContainPlaceHolders)

BuildConfigGen/dev.sh

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,11 @@ function detect_platform_and_runtime_id ()
3636
fi
3737
}
3838

39-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
39+
SCRIPT_DIR=$1
4040
pushd "$SCRIPT_DIR"
4141
source "$SCRIPT_DIR/Misc/helpers.sh"
42-
43-
DOTNETSDK_ROOT="$SCRIPT_DIR/_dotnetsdk"
44-
DOTNETSDK_VERSION="8.0.100"
45-
DOTNETSDK_INSTALLDIR="$DOTNETSDK_ROOT/$DOTNETSDK_VERSION"
42+
DOTNETSDK_INSTALLDIR=$2
43+
DOTNETSDK_VERSION=$3
4644

4745
detect_platform_and_runtime_id
4846
echo "Current platform: $CURRENT_PLATFORM"
@@ -63,10 +61,8 @@ if [[ (! -d "${DOTNETSDK_INSTALLDIR}") || (! -e "${DOTNETSDK_INSTALLDIR}/.${DOTN
6361
# run dotnet-install.ps1 on windows, dotnet-install.sh on linux
6462
if [[ ("$CURRENT_PLATFORM" == "windows") ]]; then
6563
echo "Convert ${DOTNETSDK_INSTALLDIR} to Windows style path"
66-
sdkinstallwindow_path=${DOTNETSDK_INSTALLDIR:1}
67-
sdkinstallwindow_path=${sdkinstallwindow_path:0:1}:${sdkinstallwindow_path:1}
6864
architecture=$( echo $DETECTED_RUNTIME_ID | cut -d "-" -f2)
69-
powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"./Misc/dotnet-install.ps1\" -Version ${DOTNETSDK_VERSION} -InstallDir \"${sdkinstallwindow_path}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC dotnet-install.ps1
65+
powershell -NoLogo -Sta -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "& \"./Misc/dotnet-install.ps1\" -Version ${DOTNETSDK_VERSION} -InstallDir \"${DOTNETSDK_INSTALLDIR}\" -Architecture ${architecture} -NoPath; exit \$LastExitCode;" || checkRC dotnet-install.ps1
7066
else
7167
bash ./Misc/dotnet-install.sh --version ${DOTNETSDK_VERSION} --install-dir "${DOTNETSDK_INSTALLDIR}" --no-path || checkRC dotnet-install.sh
7268
fi

Tasks/AzureCLIV2/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"loc.messages.JS_InvalidFilePath": "Script file could not be found at specified script location: '%s'. Please verify the script exists at the specified path. If you want to use inline script, specify input `Script Location` as `inlineScript`.",
5050
"loc.messages.JS_InvalidErrorActionPreference": "Invalid ErrorActionPreference '%s'. The value must be one of: 'Stop', 'Continue', or 'SilentlyContinue'",
5151
"loc.messages.GlobalCliConfigAgentVersionWarning": "For agent version < 2.115.0, only global Azure CLI configuration can be used",
52-
"loc.messages.UnacceptedScriptLocationValue": "%s is not a valid value for task input 'Script Location' (scriptLocation in YAML). Value can either be'inlineScript' or 'scriptPath'",
52+
"loc.messages.UnacceptedScriptLocationValue": "%s is not a valid value for task input 'Script Location' (scriptLocation in YAML). Value can either be 'inlineScript' or 'scriptPath'",
5353
"loc.messages.ExpiredServicePrincipalMessageWithLink": "Secret expired, update service connection at %s See https://aka.ms/azdo-rm-workload-identity-conversion to learn more about conversion to secret-less service connections.",
5454
"loc.messages.ProxyConfig": "az tool is configured to use %s as proxy server",
5555
"loc.messages.FailedToRefreshAzSession": "The following error occurred while trying to refresh az-cli session: %s",

Tasks/AzureCLIV2/task.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"demands": [],
2020
"version": {
2121
"Major": 2,
22-
"Minor": 247,
23-
"Patch": 2
22+
"Minor": 248,
23+
"Patch": 0
2424
},
2525
"minimumAgentVersion": "2.0.0",
2626
"instanceNameFormat": "Azure CLI $(scriptPath)",

Tasks/AzureCLIV2/task.loc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"demands": [],
2020
"version": {
2121
"Major": 2,
22-
"Minor": 247,
23-
"Patch": 2
22+
"Minor": 248,
23+
"Patch": 0
2424
},
2525
"minimumAgentVersion": "2.0.0",
2626
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",

Tasks/AzureCloudPowerShellDeploymentV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 1,
19-
"Minor": 247,
19+
"Minor": 248,
2020
"Patch": 0
2121
},
2222
"demands": [

Tasks/AzureCloudPowerShellDeploymentV1/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 1,
19-
"Minor": 247,
19+
"Minor": 248,
2020
"Patch": 0
2121
},
2222
"demands": [

Tasks/AzureCloudPowerShellDeploymentV2/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"author": "Microsoft Corporation",
1717
"version": {
1818
"Major": 2,
19-
"Minor": 247,
19+
"Minor": 248,
2020
"Patch": 0
2121
},
2222
"demands": [

0 commit comments

Comments
 (0)