/// <summary> /// Populate the build table by processing the given message. This function doesn't handle /// any build state semantics. Instead it just processes the build and updates the build /// result tables. /// </summary> public static async Task PopulateBuildData( [QueueTrigger(QueueNames.ProcessBuild)] string message, [Table(TableNames.BuildState)] CloudTable buildStateTable, [Table(TableNames.BuildStateKey)] CloudTable buildStateKeyTable, [Table(TableNames.BuildResultDate)] CloudTable buildResultDateTable, [Table(TableNames.BuildResultExact)] CloudTable buildResultExactTable, [Table(TableNames.BuildFailureDate)] CloudTable buildFailureDateTable, [Table(TableNames.BuildFailureExact)] CloudTable buildFailureExactTable, [Table(TableNames.CounterBuilds)] CloudTable counterBuildsTable, [Table(TableNames.ViewNameDate)] CloudTable viewNameDateTable, [Queue(QueueNames.ProcessBuild)] CloudQueue processBuildQueue, [Queue(QueueNames.EmailBuild)] CloudQueue emailBuildQueue, TextWriter logger, CancellationToken cancellationToken) { var buildIdJson = (BuildStateMessage)JsonConvert.DeserializeObject(message, typeof(BuildStateMessage)); var client = StateUtil.CreateJenkinsClient(buildIdJson.BoundBuildId); var populator = new BuildTablePopulator( buildResultDateTable: buildResultDateTable, buildResultExactTable: buildResultExactTable, buildFailureDateTable: buildFailureDateTable, buildFailureExactTable: buildFailureExactTable, viewNameDateTable: viewNameDateTable, buildCounterUtil: CounterUtilFactory.Create <BuildCounterEntity>(counterBuildsTable), client: client, textWriter: logger); var stateUtil = new StateUtil( buildStateKeyTable: buildStateKeyTable, buildStateTable: buildStateTable, processBuildQueue: processBuildQueue, emailBuildQueue: emailBuildQueue, logger: logger); await stateUtil.Populate(buildIdJson, populator, cancellationToken); }
/// <summary> /// Populate the build table by processing the given message. This function doesn't handle /// any build state semantics. Instead it just processes the build and updates the build /// result tables. /// </summary> public static async Task PopulateBuildData( [QueueTrigger(QueueNames.ProcessBuild)] string message, [Table(TableNames.BuildState)] CloudTable buildStateTable, [Table(TableNames.BuildStateKey)] CloudTable buildStateKeyTable, [Table(TableNames.BuildResultDate)] CloudTable buildResultDateTable, [Table(TableNames.BuildResultExact)] CloudTable buildResultExactTable, [Table(TableNames.BuildFailureDate)] CloudTable buildFailureDateTable, [Table(TableNames.BuildFailureExact)] CloudTable buildFailureExactTable, [Table(TableNames.CounterBuilds)] CloudTable counterBuildsTable, [Table(TableNames.ViewNameDate)] CloudTable viewNameDateTable, [Queue(QueueNames.ProcessBuild)] CloudQueue processBuildQueue, [Queue(QueueNames.EmailBuild)] CloudQueue emailBuildQueue, TextWriter logger, CancellationToken cancellationToken) { var buildIdJson = (BuildStateMessage)JsonConvert.DeserializeObject(message, typeof(BuildStateMessage)); var client = StateUtil.CreateJenkinsClient(buildIdJson.BoundBuildId); var populator = new BuildTablePopulator( buildResultDateTable: buildResultDateTable, buildResultExactTable: buildResultExactTable, buildFailureDateTable: buildFailureDateTable, buildFailureExactTable: buildFailureExactTable, viewNameDateTable: viewNameDateTable, buildCounterUtil: CounterUtilFactory.Create<BuildCounterEntity>(counterBuildsTable), client: client, textWriter: logger); var stateUtil = new StateUtil( buildStateKeyTable: buildStateKeyTable, buildStateTable: buildStateTable, processBuildQueue: processBuildQueue, emailBuildQueue: emailBuildQueue, logger: logger); await stateUtil.Populate(buildIdJson, populator, cancellationToken); }
/// <summary> /// Populate the build table by processing the given message. This function doesn't handle /// any build state semantics. Instead it just processes the build and updates the build /// result tables. /// </summary> public static async Task PopulateBuildData( [QueueTrigger(AzureConstants.QueueNames.ProcessBuild)] string message, [Table(AzureConstants.TableNames.UnprocessedBuild)] CloudTable unprocessedBuildTable, [Table(AzureConstants.TableNames.BuildResultDate)] CloudTable buildResultDateTable, [Table(AzureConstants.TableNames.BuildResultExact)] CloudTable buildResultExactTable, [Table(AzureConstants.TableNames.BuildFailureDate)] CloudTable buildFailureDateTable, [Table(AzureConstants.TableNames.BuildFailureExact)] CloudTable buildFailureExactTable, [Table(AzureConstants.TableNames.ViewNameDate)] CloudTable viewNameDateTable, TextWriter logger, CancellationToken cancellationToken) { var buildIdJson = (BuildIdJson)JsonConvert.DeserializeObject(message, typeof(BuildIdJson)); var client = StateUtil.CreateJenkinsClient(buildIdJson.JenkinsUrl, buildIdJson.JobId); var populator = new BuildTablePopulator( buildResultDateTable: buildResultDateTable, buildResultExactTable: buildResultExactTable, buildFailureDateTable: buildFailureDateTable, buildFailureExactTable: buildFailureExactTable, viewNameDateTable: viewNameDateTable, client: client, textWriter: logger); var stateUtil = new StateUtil( unprocessedBuildTable: unprocessedBuildTable, buildResultExact: buildResultExactTable, logger: logger); await stateUtil.Populate(buildIdJson.BuildId, populator, force : false, cancellationToken : cancellationToken); }