public override IEnumerable <TicketStateValidationMessage> ValidateTicket(Ticket ticket) { List <TicketStateValidationMessage> list = new List <TicketStateValidationMessage>(); list.AddRange(CommonValidations.Validate( ticket, CommonValidations.FeatureBranchShouldBePresent, CommonValidations.TechnicalNotesShouldBePresent, CommonValidations.ConfigurationSettingsShouldBePresent, CommonValidations.InstallationNotesShouldBePresent, CommonValidations.HowToQAShouldBePresent, CommonValidations.TesterShouldBeAssigned, CommonValidations.MilestoneShouldBeAssigned)); list.Add(new TicketStateValidationMessage( "Waiting for internal code review", "Still waiting", TicketStateValidationMessageSeverity.Waiting, new TicketStateValidationMessageAction("Passed", innerTicket => innerTicket.InternalCodeReviewPassed()), new TicketStateValidationMessageAction("Failed", innerTicket => innerTicket.ReopenToProgramming()))); if (ticket.TracTicket.Status != TicketStatus.CodeReview) { list.Add(new TicketStateValidationMessage($"Should be code_review (not {ticket.TracTicket.Status.ToString()})", "Incorrect status", TicketStateValidationMessageSeverity.ActionNeeded)); } return(list); }
public override IEnumerable <TicketStateValidationMessage> ValidateTicket(Ticket ticket) { List <TicketStateValidationMessage> list = new List <TicketStateValidationMessage>(); list.AddRange(CommonValidations.Validate( ticket, CommonValidations.ShouldBeInSprint, CommonValidations.FeatureBranchShouldBePresent, CommonValidations.TechnicalNotesShouldBePresent, CommonValidations.InstallationNotesShouldBePresent, CommonValidations.ConfigurationSettingsShouldBePresent, CommonValidations.HowToQAShouldBePresent, CommonValidations.TesterShouldBeAssigned)); list.Add(new TicketStateValidationMessage( "Check the build", "Check whether the build has finished", TicketStateValidationMessageSeverity.ActionNeeded, new TicketStateValidationMessageAction("Successful", innerTicket => innerTicket.BuildFinishedSuccessfully()), new TicketStateValidationMessageAction("Failed", innerTicket => innerTicket.BuildFailed()))); if (ticket.TracTicket.Status != TicketStatus.CodeReviewPassed && !ticket.TicketProperties.SkipCodeReview) { list.Add(new TicketStateValidationMessage($"Should be code_review_passed (not {ticket.TracTicket.Status.ToString()})", "Incorrect status", TicketStateValidationMessageSeverity.ActionNeeded)); } return(list); }
public override IEnumerable <TicketStateValidationMessage> ValidateTicket(Ticket ticket) { List <TicketStateValidationMessage> list = new List <TicketStateValidationMessage>(); list.AddRange(CommonValidations.Validate( ticket, CommonValidations.FeatureBranchShouldBePresent, CommonValidations.TechnicalNotesShouldBePresent, CommonValidations.ConfigurationSettingsShouldBePresent, CommonValidations.InstallationNotesShouldBePresent, CommonValidations.HowToQAShouldBePresent, CommonValidations.TesterShouldBeAssigned, CommonValidations.MilestoneShouldBeAssigned)); if (ticket.TracTicket.Status == TicketStatus.CodeReviewPassed || ticket.TicketProperties.SkipCodeReview) { list.Add(new TicketStateValidationMessage( "CR passed, merge the ticket", "Your ticket passed code review. Merge it.", TicketStateValidationMessageSeverity.ImmediateActionRequired, new TicketStateValidationMessageAction("Merged", innerTicket => innerTicket.Merge()))); } else if (ticket.TracTicket.Status == TicketStatus.CodeReviewFailed) { list.Add(new TicketStateValidationMessage( "CR failed", "Your ticket failed code review. Time to go back to development.", TicketStateValidationMessageSeverity.ImmediateActionRequired, new TicketStateValidationMessageAction("OK", innerTicket => innerTicket.ReopenToProgramming()))); } else if (ticket.TracTicket.Status != TicketStatus.CodeReview) { list.Add(new TicketStateValidationMessage( $"Should be code_review (not {ticket.TracTicket.Status.ToString()})", "Incorrect status", TicketStateValidationMessageSeverity.ActionNeeded, new TicketStateValidationMessageAction("Skip", innerTicket => innerTicket.SkipCodeReview()))); } else { list.Add(new TicketStateValidationMessage( "Waiting for code review", "Still waiting", TicketStateValidationMessageSeverity.Waiting, new TicketStateValidationMessageAction("Skip", innerTicket => innerTicket.SkipCodeReview()), new TicketStateValidationMessageAction("Reopen", innerTicket => innerTicket.ReopenToProgramming()))); } return(list); }
public override IEnumerable <TicketStateValidationMessage> ValidateTicket(Ticket ticket) { List <TicketStateValidationMessage> list = new List <TicketStateValidationMessage>(); list.AddRange(CommonValidations.Validate( ticket, CommonValidations.RemainingShouldBeGreaterThanZero, CommonValidations.ShouldBeInSprint)); list.Add(new TicketStateValidationMessage( "Programming", "Come on, do it.", TicketStateValidationMessageSeverity.ActionNeeded, new TicketStateValidationMessageAction("Done", innerTicket => innerTicket.ProgrammingDone()), new TicketStateValidationMessageAction("Incomplete specification", innerTicket => innerTicket.IncompleteSpecificationForProgramming()))); if (ticket.TracTicket.Status != TicketStatus.Accepted) { list.Add(new TicketStateValidationMessage($"Should be accepted (not {ticket.TracTicket.Status.ToString()})", "Incorrect status", TicketStateValidationMessageSeverity.ActionNeeded)); } return(list); }
public override IEnumerable <TicketStateValidationMessage> ValidateTicket(Ticket ticket) { List <TicketStateValidationMessage> list = new List <TicketStateValidationMessage>(); list.AddRange(CommonValidations.Validate( ticket, CommonValidations.ShouldBeInSprint, CommonValidations.FeatureBranchShouldBePresent, CommonValidations.TechnicalNotesShouldBePresent, CommonValidations.InstallationNotesShouldBePresent, CommonValidations.ConfigurationSettingsShouldBePresent, CommonValidations.HowToQAShouldBePresent, CommonValidations.TesterShouldBeAssigned, CommonValidations.MilestoneShouldBeAssigned)); if (ticket.TracTicket.Status != TicketStatus.Documenting && ticket.TracTicket.Status != TicketStatus.Closed) { if (ticket.TracTicket.Status == TicketStatus.Reopened) { list.Add(new TicketStateValidationMessage( "Ticket reopened", "Ticket reopened. Get back to work!", TicketStateValidationMessageSeverity.ImmediateActionRequired)); } else if (ticket.TracTicket.Status != TicketStatus.Testing) { list.Add(new TicketStateValidationMessage($"Should be in testing (not {ticket.TracTicket.Status.ToString()})", "Ticket should be testing", TicketStateValidationMessageSeverity.ActionNeeded)); } } if (!ticket.TicketProperties.POTDone) { if (ticket.TicketProperties.POTQueuedUp) { list.Add(new TicketStateValidationMessage( "POT in progress", "You've sent a request for POT of this ticket. Mark this as done when response comes back.", TicketStateValidationMessageSeverity.Waiting, new TicketStateValidationMessageAction("Done", innerTicket => innerTicket.POTSuccessful()), new TicketStateValidationMessageAction("Failed", innerTicket => innerTicket.POTFailed()))); } else { list.Add(new TicketStateValidationMessage( "Ask for POT", "You should ask for POT", TicketStateValidationMessageSeverity.ActionNeeded, new TicketStateValidationMessageAction("Done", innerTicket => innerTicket.AskedForPOT()))); } } if (!ticket.TracTicket.TestPlans.Any()) { list.Add(new TicketStateValidationMessage("Waiting for test plan", "No test plans attached. Send a mesage to a tester to create one.", TicketStateValidationMessageSeverity.Waiting)); } else { if (!ticket.TracTicket.TestPlanReviewed) { list.Add(new TicketStateValidationMessage($"Test plan (${ticket.TracTicket.TestPlans.First().FileName}) not reviewed", "There is a test plan attached but you haven't verified it yet.", TicketStateValidationMessageSeverity.ImmediateActionRequired)); } else if (ticket.TracTicket.Status == TicketStatus.Documenting) { list.Add(new TicketStateValidationMessage( "Done from your part! (documenting)", "Waiting for the tester to create documentation", TicketStateValidationMessageSeverity.Waiting, new TicketStateValidationMessageAction("Hide", innerTicket => innerTicket.MarkAsDone()), new TicketStateValidationMessageAction("Reopen", innerTicket => innerTicket.ReopenToProgramming()))); } else if (ticket.TracTicket.Status == TicketStatus.Testing) { list.Add(new TicketStateValidationMessage( "Waiting for testing", "Waiting for the tester to go through the test cases", TicketStateValidationMessageSeverity.Waiting, new TicketStateValidationMessageAction("Reopen", innerTicket => innerTicket.ReopenToProgramming()))); } else if (ticket.TracTicket.Status == TicketStatus.Closed && ticket.TicketProperties.POTDone) { list.Add(new TicketStateValidationMessage( "You are done!", "You can now hide this ticket from your dashboard", TicketStateValidationMessageSeverity.ActionNeeded, new TicketStateValidationMessageAction("Hide", innerTicket => innerTicket.MarkAsDone()), new TicketStateValidationMessageAction("Reopen", innerTicket => innerTicket.ReopenToProgramming()))); } } return(list); }