Skip to content

Parse markdown review summary content

Gary Holtz requested to merge 418882-parse-markdown-review-summary-content into master

What does this MR do and why?

This MR adds a new field content_html to the MergeRequestReviewLlmSummary model. This field will store the HTML content of the review summary, converted from Markdown. This is the backend portion of Parse markdown review summary content (#418882 - closed), so there isn't a significant user-facing change at the moment.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Enable automatically_summarize_mr_review.
  2. Follow https://docs.gitlab.com/ee/development/ai_features.html#test-ai-features-locally.
  3. Open an MR in a project that has AI features enabled.
  4. Add multiple comments (with some markdown) to a review and then submit the review.
  5. Using rails console, confirm that the MergeRequest::ReviewLlmSummary records are created: MergeRequest::ReviewLlmSummary.find_by(review: Review.last)
  6. Using your local GraphQL explorer (probably something like https://gdk.test:3443/-/graphql-explorer), write a query like:
query summaryNotes {
  project(fullPath: "yourproject/goeshere") {
    id
    mergeRequest(iid: "iid of the MR goes here") {
      id
      mergeRequestDiffs {
        nodes {
          reviewLlmSummaries {
            nodes {
              content
              contentHtml
            }
          }
        }
      }
    }
  }
}

and confirm any markdown content has been converted to HTML.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #418882 (closed)

Edited by Gary Holtz

Merge request reports