From e462e97b4eb66eb3c8750cdb5e446ea93e4c23c9 Mon Sep 17 00:00:00 2001 From: "dellgil\\Stephen.Gillie" Date: Wed, 1 May 2024 19:33:49 -0700 Subject: [PATCH] 5-1 nightly --- Tools/ManualValidationPipeline.cs | 64 ++++++++++++++++++++++-------- Tools/ManualValidationPipeline.ps1 | 13 +++++- 2 files changed, 59 insertions(+), 18 deletions(-) diff --git a/Tools/ManualValidationPipeline.cs b/Tools/ManualValidationPipeline.cs index 00ce4baf0bc3f..92541b0de888a 100644 --- a/Tools/ManualValidationPipeline.cs +++ b/Tools/ManualValidationPipeline.cs @@ -145,7 +145,7 @@ 17. Status bar (pending) namespace WinGetApprovalNamespace { public class WinGetApprovalPipeline : Form { //vars - public int build = 879;//Get-RebuildPipeApp + public int build = 881;//Get-RebuildPipeApp public string appName = "WinGetApprovalPipeline"; public string appTitle = "WinGet Approval Pipeline - Build "; public static string owner = "microsoft"; @@ -276,7 +276,7 @@ public class WinGetApprovalPipeline : Form { public static int gridItemHeight = 45; public int lineHeight = 14; - public int WindowWidth = gridItemWidth*13+20; + public int WindowWidth = gridItemWidth*15+20; public int WindowHeight = gridItemHeight*12+20; //Fonts @@ -878,10 +878,10 @@ public void UpdateTableVM() { dataGridView_vm.Columns[6].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;//RAM dataGridView_val.DataSource=table_val; - dataGridView_val.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;//Timestamp + dataGridView_val.Columns[0].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;//Timestamp dataGridView_val.Columns[1].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;//PR dataGridView_val.Columns[2].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;//PackageIdentifier - dataGridView_val.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;//prVersion + dataGridView_val.Columns[3].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;//prVersion dataGridView_val.Columns[4].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;//A dataGridView_val.Columns[5].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;//R dataGridView_val.Columns[6].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;//G @@ -890,8 +890,8 @@ public void UpdateTableVM() { dataGridView_val.Columns[9].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;//I dataGridView_val.Columns[10].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;//D dataGridView_val.Columns[11].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;//V - dataGridView_val.Columns[12].AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill;//ManifestVer - dataGridView_val.Columns[13].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells;//OK + dataGridView_val.Columns[12].AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCellsExceptHeader;//ManifestVer + dataGridView_val.Columns[13].AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader;//OK }//end if TestPath } catch (Exception e){ @@ -1030,7 +1030,7 @@ public void PRWatch(bool noNew, string Chromatic = "Default", string LogFile = " $Body = "Spaces detected in version number."; $Body = $Body + "\n\n(Automated response - build "build")"; InvokeGitHubPRRequest(PR,"Post","comments",Body,"Silent"); - // matchColor = invalidColor;; + // matchColor = invalidColor; $prAuth = "-!"; } */ @@ -1059,7 +1059,7 @@ public void PRWatch(bool noNew, string Chromatic = "Default", string LogFile = " InvokeGitHubPRRequest(PR,"Post","comments",Body,"Silent"); AddPRToRecord(PR,"Feedback",PRTitle); */ - outBox_msg.AppendText(Environment.NewLine + "PR: " + PR + " comments: " + Body); + outBox_msg.AppendText(Environment.NewLine + "PR: " + PR + " comments"); } } table_val.Rows[LastRow].SetField("PRVersion", PRVersion); @@ -1244,9 +1244,8 @@ public void PRWatch(bool noNew, string Chromatic = "Default", string LogFile = " if ((PRvMan != "N") && ((PRTitle.Contains("Automatic deletion")) || (PRTitle.Contains("Delete")) || - (PRTitle.Contains("Remove")))) {//Removal PR - //Versions = - NumVersions = 0;//(WinGetOutput.AvailableVersions).count //Need to rework #PendingBugfix + (PRTitle.Contains("Remove")))) {//Removal PR - if highest version in repo. + NumVersions = FindWinGetTotalVersions(PackageIdentifier);//(WinGetOutput.AvailableVersions).count //Need to rework #PendingBugfix if ((PRVersion == ManifestVersion) || (NumVersions == 1)) { // matchColor = invalidColor; /* @@ -1255,9 +1254,9 @@ public void PRWatch(bool noNew, string Chromatic = "Default", string LogFile = " */ NumVersions = -1; } - } else {//Addition PR + } else {//Addition PR - has more files than repo. string GLD = "";//ListingDiff(clip .Where(n => n.SideIndicator == "<=")).installer.yaml //Ignores when a PR adds files that didn't exist before. - if (null != GLD) { + if ("" != GLD) { if (GLD == "Error") { string_ListingDiff = "E"; // matchColor = invalidColor; @@ -2388,7 +2387,6 @@ public string FindWinGetVersion(string PackageIdentifier) { string string_out = ""; string command = "winget search " + PackageIdentifier + " --exact --disable-interactivity"; - Process process = new Process(); StreamWriter StandardInput; StreamReader StandardOut; @@ -2422,6 +2420,39 @@ public string FindWinGetVersion(string PackageIdentifier) { } return string_out; } + + public int FindWinGetTotalVersions(string PackageIdentifier) { + string string_out = ""; + string command = "(((winget search " + PackageIdentifier + " --exact --disable-interactivity --versions --disable-interactivity) -join ',' -split 'Version,-------,')[1] -split ',').count"; + + Process process = new Process(); + StreamWriter StandardInput; + StreamReader StandardOut; + ProcessStartInfo processStartInfo = new ProcessStartInfo("PowerShell.exe"); + processStartInfo.UseShellExecute = false; + processStartInfo.RedirectStandardInput = true; + processStartInfo.RedirectStandardOutput = true; + processStartInfo.RedirectStandardError = true; + processStartInfo.CreateNoWindow = true; + process.StartInfo = processStartInfo; + process.Start(); + + StandardInput = process.StandardInput; + StandardOut = process.StandardOutput; + StandardInput.AutoFlush = true; + StandardInput.WriteLine(command); + StandardInput.Close(); + + string_out = StandardOut.ReadToEnd(); + // outBox_msg.AppendText(Environment.NewLine + "Testing2: " + string_out); + foreach (string string_in in string_out.Split('\n')) { + if (string_in.Length > 1 && string_in.Length < 4) { + string_out = string_in; + } + } + return Convert.ToInt32(string_out); + } + @@ -4805,8 +4836,9 @@ public void Testing2_Action(object sender, EventArgs e) { // dynamic string_out = GetValidationData("PackageIdentifier", UserInput); // dynamic string_out = FromCsv(GetContent(DataFileName)).Where(n => n[Property] != null).Where(n => (string)n[Property].Contains(Match); string UserInput = inputBox_User.Text; - dynamic line = FromCsv(GetContent(DataFileName)).Where(n => (string)n["PackageIdentifier"] == (UserInput)); - outBox_msg.AppendText(Environment.NewLine + "Testing2: " + ToJson(line)); + int versions = FindWinGetTotalVersions(UserInput); + // dynamic line = FromCsv(GetContent(DataFileName)).Where(n => (string)n["PackageIdentifier"] == (UserInput)); + outBox_msg.AppendText(Environment.NewLine + "Testing2: " + versions); }// end Testing_Action diff --git a/Tools/ManualValidationPipeline.ps1 b/Tools/ManualValidationPipeline.ps1 index 6ab4a06652092..6f4f6e2b312a4 100644 --- a/Tools/ManualValidationPipeline.ps1 +++ b/Tools/ManualValidationPipeline.ps1 @@ -10,7 +10,7 @@ #3.88.19 - A few bugfixes. #3.88.18 - Restore waiver and retry fucntionality. -$build = 878 +$build = 880 $appName = "ManualValidationPipeline" Write-Host "$appName build: $build" $MainFolder = "C:\ManVal" @@ -2677,7 +2677,7 @@ Function Get-AutoValLog { $UserInput = $UserInput -notmatch "Could not create system restore point" $UserInput = $UserInput -notmatch "Dest filename" $UserInput = $UserInput -notmatch "ERROR: Signature Update failed" - $UserInput = $UserInput -notmatch "tid(ce4) " + $UserInput = $UserInput -notmatch " 8A15005E " $UserInput = $UserInput -notmatch "Exception during executable launch operation System.InvalidOperationException: No process is associated with this object." $UserInput = $UserInput -notmatch "Exit code`: 0" $UserInput = $UserInput -notmatch "Installation failed with exit code -1978334972" @@ -4068,6 +4068,15 @@ Function Get-TrackerVMCycle { $SharedError = $SharedError -replace "Exception(4) tid(f1c) 80072EE2 ","" $SharedError = $SharedError -replace "tid(f1c)","" $SharedError = $SharedError -replace "C:\\__w\\1\\s\\external\\pkg\\src\\AppInstallerCommonCore\\Downloader.cpp(185)\\WindowsPackageManager.dll!00007FFA008A37C9:","" + +if ($SharedError -match "exit code") { + $ExitCodeTable = gc $ExitCodeFile | ConvertFrom-Csv + foreach ($ExitCode in $ExitCodeTable) { + if ($SharedError -match $ExitCode.code) { + $SharedError += "`n`nAutomated error analysis suggests $($ExitCode.code) may mean $($ExitCode.message)" + } + } +} Reply-ToPR -PR $VM.PR -UserInput $SharedError -CannedMessage ManValEnd Get-TrackerVMSetStatus "Complete" $VM.vm if (($SharedError -match "\[FAIL\] Installer failed security check.") -OR ($SharedError -match "Detected 1 Defender")) {