/// <summary> /// Adds a new build history for a stream /// </summary> /// <param name="Issue">The issue to add a build to</param> /// <param name="InputJob">The job containing the error</param> /// <param name="InputJobStep">The job step containing the error</param> /// <param name="InputErrorUrl">Url of the error</param> /// <param name="State">Current persistent state. Used to find previous build history.</param> void AddFailureToIssue(BuildHealthIssue Issue, InputJob InputJob, InputJobStep InputJobStep, string InputErrorUrl, BuildHealthState State) { // Find or add a step name to history mapping Dictionary <string, BuildHealthJobHistory> StepNameToHistory; if (!Issue.Streams.TryGetValue(InputJob.Stream, out StepNameToHistory)) { StepNameToHistory = new Dictionary <string, BuildHealthJobHistory>(); Issue.Streams.Add(InputJob.Stream, StepNameToHistory); } // Find or add a history for this step BuildHealthJobHistory History; if (!StepNameToHistory.TryGetValue(InputJobStep.Name, out History)) { History = new BuildHealthJobHistory(State.FindBuildBefore(InputJob.Stream, InputJob.Change, InputJobStep.Name)); StepNameToHistory.Add(InputJobStep.Name, History); } // Add the new build History.AddFailedBuild(CreateBuildForJobStep(InputJob, InputJobStep, InputErrorUrl)); }