Esempio n. 1
0
        static void Process(string path, SearchOptions options, SearchRange range, ActionType action, IEnumerable <ParsedCommit> commitsToIgnore)
        {
            IEnumerable <CommitInfo> commits = CommitFinder.Parse(path, range);

            Explain.Print($"Found {commits.Count ()} commits.");

            switch (action)
            {
            case ActionType.ListConsideredCommits:
                PrintCommits(commits);
                return;

            case ActionType.ListBugs:
                var parsedCommits = CommitParser.Parse(commits, options).ToList();
                var bugCollection = BugCollector.ClassifyCommits(parsedCommits, options, commitsToIgnore);
                PrintBugs(bugCollection, options);

                if (options.ValidateBugStatus)
                {
                    BugValidator.Validate(bugCollection, options);
                }

                return;

            default:
                throw new InvalidOperationException($"Internal Error - Unknown action requested {action}");
            }
        }
Esempio n. 2
0
 // Code to execute on Unhandled Exceptions
 private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
 {
     BugCollector.LogException(e.ExceptionObject, "UnhandledException");
     if (Debugger.IsAttached)
     {
         // An unhandled exception has occurred; break into the debugger
         Debugger.Break();
     }
 }
Esempio n. 3
0
 // Code to execute if a navigation fails
 private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
 {
     BugCollector.LogException(e.Exception, "Navigation failed: " + e.Uri.ToString());
     if (Debugger.IsAttached)
     {
         // A navigation has failed; break into the debugger
         Debugger.Break();
     }
 }
Esempio n. 4
0
        public void BugCollector_SmokeTest()
        {
            var options = new SearchOptions()
            {
                Bugzilla = BugzillaLevel.Private
            };
            var range = new SearchRange {
                Oldest = "98fff31".Some(), Newest = "6c280ad".Some()
            };
            var commits       = CommitFinder.Parse(TestDataLocator.GetPath(), range);
            var parsedCommits = CommitParser.Parse(commits, options).ToList();

            var bugCollection = BugCollector.ClassifyCommits(parsedCommits, options);

            Assert.AreEqual(2, bugCollection.Bugs.Count);
            Assert.AreEqual(3, bugCollection.PotentialBugs.Count);
        }
Esempio n. 5
0
        public void BugCollector_HandlesDuplicateBugEntries()
        {
            // One commit with certain, one without. Only one copy in final output
            var options = new SearchOptions()
            {
                Bugzilla = BugzillaLevel.Private
            };
            var range = new SearchRange {
                Oldest = "ad26139".Some(), Newest = "6c280ad".Some()
            };
            var commits       = CommitFinder.Parse(TestDataLocator.GetPath(), range);
            var parsedCommits = CommitParser.Parse(commits, options).ToList();

            var bugCollection = BugCollector.ClassifyCommits(parsedCommits, new SearchOptions());

            Assert.AreEqual(1, bugCollection.Bugs.Count);
            Assert.AreEqual(0, bugCollection.PotentialBugs.Count);
        }
Esempio n. 6
0
        /// <summary>
        /// Method called when the page is displayed.
        /// Check if the uri contains a sip address, if yes, it starts a call to this address.
        /// </summary>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            if (e.NavigationMode == NavigationMode.New)
            {
                if (BugCollector.HasExceptionToReport())
                {
                    // Allow to report exceptions before the creation of the core in case the problem is in there
                    CustomMessageBox reportIssueDialog = new CustomMessageBox()
                    {
                        Caption            = AppResources.ReportCrashDialogCaption,
                        Message            = AppResources.ReportCrashDialogMessage,
                        LeftButtonContent  = AppResources.ReportCrash,
                        RightButtonContent = AppResources.Close
                    };

                    reportIssueDialog.Dismissed += (s, ev) =>
                    {
                        switch (ev.Result)
                        {
                        case CustomMessageBoxResult.LeftButton:
                            BugReportUploadProgressBar.Minimum = 0;
                            BugReportUploadProgressBar.Maximum = 100;
                            BugReportUploadPopup.Visibility    = Visibility.Visible;
                            LinphoneManager.Instance.LogUploadProgressIndicationEH += LogUploadProgressIndication;
                            LinphoneManager.Instance.LinphoneCore.UploadLogCollection();
                            break;

                        case CustomMessageBoxResult.RightButton:
                            BugCollector.DeleteFile();
                            break;
                        }
                    };

                    reportIssueDialog.Show();
                }
                else
                {
                    BugReportUploadPopup.Visibility = Visibility.Collapsed;
                }
            }

            StatusBar = status;
            BasePage.StatusBar.RefreshStatus(LinphoneManager.Instance.LastKnownState);

            BuildLocalizedApplicationBar();

            // Check for the navigation direction to avoid going to incall view when coming back from incall view
            if (NavigationContext.QueryString.ContainsKey("sip") && e.NavigationMode != NavigationMode.Back)
            {
                String sipAddressToCall = NavigationContext.QueryString["sip"];
                addressBox.Text = sipAddressToCall;
            }

            // Navigate to the current call (if existing) when using the app launcher to restart the app while call is in background
            if (LinphoneManager.Instance.LinphoneCore.CallsNb > 0)
            {
                LinphoneCall call = LinphoneManager.Instance.LinphoneCore.CurrentCall;
                String       uri  = call.RemoteAddress.AsStringUriOnly();
                NavigationService.Navigate(new Uri("/Views/InCall.xaml?sip=" + Utils.ReplacePlusInUri(uri), UriKind.RelativeOrAbsolute));
            }
        }