Uploaded image for project: 'Crucible'
  1. Crucible
  2. CRUC-8481

Block review from being closed if there are unresolved comments

    XMLWordPrintable

Details

    • Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

    Description

      Problem Definition  

      Nowadays when a review has comments marked as unresolved and the review author / moderator clicks the Close button this warning is shown:

      As can be seen above though, that is just a warning and the author / moderator can proceed with closing the review anyway.

      Suggested Solution

      Block the review author / moderator from closing the review if there are unresolved comments.

      Workaround

      There are no known workarounds.

      Notes

      You can implement a workflow condition plugin with a condition similar to the following:

          @Override
          public ValidationResult doValidateTransition(final WorkflowTransitionContext transitionContext) {
              final Review review = reviewManager.getReviewByPermaId(transitionContext.getReviewId().getId());
              int unresolvedCommentCount = commentManager.getCommentCount(new CommentManagerSearchCriteria()
                      .review(review)
                      .resolutionStatus(CommentResolutionStatus.UNRESOLVED));
      
              if (unresolvedCommentCount == 0) {
                  return ValidationResult.ok();
              }
      
              return ValidationResult.error("unresolved-comments",
                      new ResultMessage("Unresolved comments", "This review has still unresolved comments",  
                              ImmutableList.of(
                                  ResultAction.buildJavaScriptAction(
                                              "Show comments",
                                              Namespaces.buildWebResourceKey("show-unresolved-comments"),
                                              Namespaces.buildComponentsKey("show-unresolved-comments")))));
          }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            fkraemer Felipe Kraemer
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: