Skip to content

Commit 8ab3da0

Browse files
committed
Merge remote-tracking branch 'origin/master' into Localization
2 parents 30df03d + 78c4531 commit 8ab3da0

File tree

318 files changed

+8805
-8515
lines changed

Some content is hidden

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

318 files changed

+8805
-8515
lines changed

BuildConfigGen/GitUtil.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -95,30 +95,6 @@ public static void GetUntrackedFiles(string taskTarget, out IEnumerable<string>
9595
toAdd = untrackedOuput2;
9696
toRemove = untrackedOuputRemove;
9797
}
98-
internal static string GetGitRootPath(string currentDir)
99-
{
100-
const string args = "rev-parse --git-dir";
101-
string path = RunGitCommandScalar(currentDir, args);
102-
103-
path = FixupPath(path);
104-
105-
const string gitDir = ".git";
106-
if (path.EndsWith(gitDir))
107-
{
108-
path = path.Substring(0, path.Length - gitDir.Length);
109-
110-
if (path == "")
111-
{
112-
return currentDir;
113-
}
114-
115-
return path;
116-
}
117-
else
118-
{
119-
throw new Exception($"expected git {args} to return ");
120-
}
121-
}
12298

12399
internal static IEnumerable<string> GetNonIgnoredFileListFromPath(string gitRoot, string taskTarget)
124100
{

BuildConfigGen/Program.cs

Lines changed: 62 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
109109
}
110110

111111
string currentDir = Environment.CurrentDirectory;
112-
string gitRootPath = GitUtil.GetGitRootPath(currentDir);
112+
string gitRootPath = GetTasksRootPath(currentDir);
113113

114114
string globalVersionPath = Path.Combine(gitRootPath, @"globalversion.txt");
115115
TaskVersion? globalVersion = GetGlobalVersion(gitRootPath, globalVersionPath);
@@ -208,7 +208,7 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
208208
Console.WriteLine($"Global version: maxPatchForCurrentSprint = maxPatchForCurrentSprint + 1");
209209
}
210210

211-
Console.WriteLine($"Global version update: globalVersion = {globalVersion} maxPatchForCurrentSprint={maxPatchForCurrentSprint}" );
211+
Console.WriteLine($"Global version update: globalVersion = {globalVersion} maxPatchForCurrentSprint={maxPatchForCurrentSprint}");
212212
}
213213
else
214214
{
@@ -249,6 +249,14 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
249249
}
250250
}
251251
}
252+
else
253+
{
254+
// if we're not updating local packages, we need to ensure the global version is updated to the task major version. existing patch number is preserved
255+
if (globalVersion is not null)
256+
{
257+
globalVersion = globalVersion.CloneWithMajor(taskMajorVersion);
258+
}
259+
}
252260

253261
if (globalVersion is not null)
254262
{
@@ -265,7 +273,7 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
265273
ensureUpdateModeVerifier!.WriteAllText(globalVersionPath, globalVersion!.MinorPatchToString(), false);
266274
}
267275

268-
ThrowWithUserFriendlyErrorToRerunWithWriteUpdatesIfVeriferError("(global)", skipContentCheck: false);
276+
ThrowWithUserFriendlyErrorToRerunWithWriteUpdatesIfVeriferError(null, skipContentCheck: false);
269277

270278
foreach (var t in tasks)
271279
{
@@ -284,6 +292,37 @@ private static void MainInner(string? task, string? configs, int? currentSprintN
284292
}
285293
}
286294

295+
private static string GetTasksRootPath(string inputCurrentDir)
296+
{
297+
string? currentDir = inputCurrentDir;
298+
string? tasksRootPath = null;
299+
300+
do
301+
{
302+
string currentDirGit = Path.Combine(currentDir, ".git");
303+
304+
if (Directory.Exists(currentDirGit))
305+
{
306+
tasksRootPath = currentDir;
307+
}
308+
309+
currentDir = (new DirectoryInfo(currentDir)).Parent?.FullName;
310+
311+
} while (currentDir != null);
312+
313+
if (tasksRootPath == null)
314+
{
315+
throw new Exception($"could not find .git in {currentDir}");
316+
}
317+
318+
if (!File.Exists(Path.Combine(tasksRootPath, "make-options.json")))
319+
{
320+
throw new Exception($"make-options.json not found in tasksRootPath={tasksRootPath}");
321+
}
322+
323+
return tasksRootPath;
324+
}
325+
287326
private static IEnumerable<string> FilterConfigsForTask(string? configs, KeyValuePair<string, MakeOptionsReader.AgentTask> t)
288327
{
289328
var configsList = t.Value.Configs.AsEnumerable();
@@ -343,7 +382,7 @@ private static void GetVersions(string task, string configsString, out List<(str
343382

344383
string currentDir = Environment.CurrentDirectory;
345384

346-
string gitRootPath = GitUtil.GetGitRootPath(currentDir);
385+
string gitRootPath = GetTasksRootPath(currentDir);
347386

348387
string taskTargetPath = Path.Combine(gitRootPath, "Tasks", task);
349388
if (!Directory.Exists(taskTargetPath))
@@ -419,7 +458,7 @@ private static int GetCurrentSprint()
419458
return currentSprint;
420459
}
421460

422-
private static void ThrowWithUserFriendlyErrorToRerunWithWriteUpdatesIfVeriferError(string task, bool skipContentCheck)
461+
private static void ThrowWithUserFriendlyErrorToRerunWithWriteUpdatesIfVeriferError(string? task, bool skipContentCheck)
423462
{
424463
// if !writeUpdates, error if we have written any updates
425464
var verifyErrors = ensureUpdateModeVerifier!.GetVerifyErrors(skipContentCheck).ToList();
@@ -433,7 +472,14 @@ private static void ThrowWithUserFriendlyErrorToRerunWithWriteUpdatesIfVeriferEr
433472
Console.WriteLine(s);
434473
}
435474

436-
throw new Exception($"Updates needed, please run npm make.js --task {task} ");
475+
if (task is null)
476+
{
477+
throw new Exception($"Updates needed, please run node make.js");
478+
}
479+
else
480+
{
481+
throw new Exception($"Updates needed, please run node make.js --task {task} ");
482+
}
437483
}
438484
}
439485

@@ -459,8 +505,8 @@ private static void MainUpdateTask(
459505
try
460506
{
461507
string currentDir = Environment.CurrentDirectory;
462-
string gitRootPath = GitUtil.GetGitRootPath(currentDir);
463-
string versionMapFile = GetVersionMapFile(task, gitRootPath, generatedFolder);
508+
string gitRootPath = GetTasksRootPath(currentDir);
509+
string versionMapFile = GetVersionMapFile(task, generatedFolder);
464510

465511
string taskTargetPath = Path.Combine(gitRootPath, "Tasks", task);
466512
if (!Directory.Exists(taskTargetPath))
@@ -489,7 +535,11 @@ private static void MainUpdateTask(
489535

490536
foreach (var config in targetConfigs)
491537
{
492-
if (config.useGlobalVersion && !hasGlobalVersion)
538+
if (config.useGlobalVersion && !includeLocalPackagesBuildConfig)
539+
{
540+
Console.WriteLine($"Info: MainUpdateTask: Skipping useGlobalVersion config for task b/c --include-local-packages-build-config. not specified. hasGlobalVersion={hasGlobalVersion} config.useGlobalVersion={config.useGlobalVersion} includeLocalPackagesBuildConfig={includeLocalPackagesBuildConfig}");
541+
}
542+
else if (config.useGlobalVersion && !hasGlobalVersion)
493543
{
494544
Console.WriteLine($"Info: MainUpdateTask: Skipping useGlobalVersion config for task b/c GlobalVersion not initialized. (to opt-in and start producing LocalBuildConfig, run with --include-local-packages-build-config. hasGlobalVersion={hasGlobalVersion} config.useGlobalVersion={config.useGlobalVersion}). Note: this is not an error!");
495545
}
@@ -608,7 +658,7 @@ private static void MainUpdateTask(
608658
}
609659
}
610660

611-
private static string GetVersionMapFile(string task, string gitRootPath, string generatedFolder)
661+
private static string GetVersionMapFile(string task, string generatedFolder)
612662
{
613663
return Path.Combine(generatedFolder, @$"{task}.versionmap.txt");
614664
}
@@ -1078,7 +1128,7 @@ private static void CopyConfig(string gitRootPath, string taskTargetPathOrUnders
10781128
private static void UpdateVersionsForTask(string task, TaskStateStruct taskState, HashSet<Config.ConfigRecord> targetConfigs, int currentSprint, string globalVersionPath, TaskVersion? globalVersion, string generatedFolder)
10791129
{
10801130
string currentDir = Environment.CurrentDirectory;
1081-
string gitRootPath = GitUtil.GetGitRootPath(currentDir);
1131+
string gitRootPath = GetTasksRootPath(currentDir);
10821132
string taskTargetPath = Path.Combine(gitRootPath, "Tasks", task);
10831133

10841134
if (!Directory.Exists(taskTargetPath))
@@ -1093,7 +1143,7 @@ private static void UpdateVersionsForTask(string task, TaskStateStruct taskState
10931143

10941144
bool defaultVersionMatchesSourceVersion;
10951145

1096-
string versionMapFile = GetVersionMapFile(task, gitRootPath, generatedFolder);
1146+
string versionMapFile = GetVersionMapFile(task, generatedFolder);
10971147

10981148
{
10991149
TaskVersion? defaultVersion = null;

BuildConfigGen/dev.sh

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ function detect_platform_and_runtime_id ()
3636
fi
3737
}
3838

39-
function cmd_build ()
40-
{
41-
heading "Building"
42-
dotnet build -o bin $SOLUTION_PATH || failed build
43-
#change execution flag to allow running with sudo
44-
if [[ ("$CURRENT_PLATFORM" == "linux") || ("$CURRENT_PLATFORM" == "darwin") ]]; then
45-
chmod +x "bin/BuildConfigGen"
46-
fi
47-
48-
}
49-
5039
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
5140
pushd "$SCRIPT_DIR"
5241
source "$SCRIPT_DIR/Misc/helpers.sh"
@@ -91,6 +80,3 @@ echo "Adding .NET to PATH ${DOTNETSDK_INSTALLDIR}"
9180
export PATH=${DOTNETSDK_INSTALLDIR}:$PATH
9281
echo "Path = $PATH"
9382
echo ".NET Version = $(dotnet --version)"
94-
95-
SOLUTION_PATH="$SCRIPT_DIR/BuildConfigGen.sln"
96-
cmd_build

Tasks/AzureVmssDeploymentV1/operations/VirtualMachineScaleSet.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ export default class VirtualMachineScaleSet {
8484
autoUpgradeMinorVersion: true,
8585
settings: {
8686
"commandToExecute": customScriptInfo.command,
87-
"fileUris": customScriptInfo.blobUris
87+
"fileUris": customScriptInfo.blobUris,
88+
"managedIdentity":{}
8889
},
8990
protectedSettings: {
9091
"storageAccountName": customScriptInfo.storageAccount.name

Tasks/AzureVmssDeploymentV1/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"version": {
1616
"Major": 1,
1717
"Minor": 247,
18-
"Patch": 2
18+
"Patch": 4
1919
},
2020
"demands": [],
2121
"minimumAgentVersion": "2.209.0",

Tasks/AzureVmssDeploymentV1/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"version": {
1616
"Major": 1,
1717
"Minor": 247,
18-
"Patch": 2
18+
"Patch": 4
1919
},
2020
"demands": [],
2121
"minimumAgentVersion": "2.209.0",

Tasks/NodeToolV0/.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
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

0 commit comments

Comments
 (0)