Example #1
0
        private static int RunGitCodeChurnProcessor(GitExtractCommandLineArgs a)
        {
            var processWrapper       = new ProcessWrapper();
            var commandLineParser    = new CommandLineParser();
            var gitLogParser         = new GitLogParser();
            var logger               = new ConsoleLoggerWithTimestamp();
            var outputProcessor      = new JsonOutputProcessor(new DataConverter(), new FileStreamFactory(), logger);
            var bugDatabaseFactory   = new BugDatabaseFactory();
            var bugDatabaseDllLoader = new BugDatabaseDllLoader(logger, bugDatabaseFactory);
            var webRequest           = new WebRequest(new HttpClientWrapperFactory(bugDatabaseFactory));
            var fileSystem           = new FileSystem();
            var jsonParser           = new JsonListParser <WorkItem>(new FileStreamFactory());
            var bugDatabaseProcessor = new BugDatabaseProcessor(bugDatabaseDllLoader, webRequest, fileSystem, jsonParser, logger, a.BugDatabaseOutputFile);
            var processor            = new GitCodeChurnProcessor(commandLineParser, processWrapper, gitLogParser, outputProcessor, bugDatabaseProcessor, logger, a);

            processor.QueryBugDatabase();
            return(processor.Extract());
        }
Example #2
0
        private static int RunGitToCosmosDbCodeChurnProcessor(GitExtractToCosmosDbCommandLineArgs a)
        {
            var processWrapper         = new ProcessWrapper();
            var commandLineParser      = new CommandLineParser();
            var gitLogParser           = new GitLogParser();
            var logger                 = new ConsoleLoggerWithTimestamp();
            var cosmosConnection       = new CosmosConnection(new DatabaseFactory(a, JsonSerializerSettingsFactory.CreateDefaultSerializerSettingsForCosmosDB()), a.DatabaseId, Properties.Settings.Default.CosmosBulkBatchSize);
            var dataDocumentRepository = new DataDocumentRepository(cosmosConnection, a.CodeChurnCosmosContainer);
            var cosmosOutputProcessor  = new CosmosDbOutputProcessor(logger, dataDocumentRepository, new DataConverter(), a.CosmosProjectName, Properties.Settings.Default.CosmosBulkBatchSize);
            var bugDatabaseFactory     = new BugDatabaseFactory();
            var bugDatabaseDllLoader   = new BugDatabaseDllLoader(logger, bugDatabaseFactory);
            var webRequest             = new WebRequest(new HttpClientWrapperFactory(bugDatabaseFactory));
            var fileSystem             = new FileSystem();
            var jsonParser             = new JsonListParser <WorkItem>(new FileStreamFactory());
            var bugDatabaseProcessor   = new BugDatabaseProcessor(bugDatabaseDllLoader, webRequest, fileSystem, jsonParser, logger, string.Empty);
            //, a.BugDatabaseOutputFile

            var processor = new GitCodeChurnProcessor(commandLineParser, processWrapper, gitLogParser, cosmosOutputProcessor, bugDatabaseProcessor, logger, a);

            processor.QueryBugDatabase();

            return(processor.Extract());
        }
Example #3
0
 public GivenAGitLogParser()
 {
     parser = new GitLogParser();
 }