-
Suggestion
-
Resolution: Unresolved
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"))))); }