Skip to content

Add support for MRs in Duo Chat REST API

What does this MR do and why?

This MR allows the Chat REST API to support merge requests.

This will let us use the CEF to evaluate MR-related questions, in anticipation of releasing this MR.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. Create a personal access token (PAT) locally
  2. Run this command to call to Duo Chat with a MR resource
curl --request POST \
  --header "Authorization: Bearer <**INSERT PAT HERE**>" \
  --header "Content-Type: application/json" \
  --data '{
    "content": "what is this mr about",
    "resource_id": 1,
    "resource_type": "merge_request"
  }' \
  --url "http://localhost:3000/api/v4/chat/completions"
  1. You should not get the error {"error":"resource_type does not have a valid value"}%

It IS normal that you could get another error, because MRs are not supported in Duo Chat yet.

Related to #464587

Edited by Lesley Razzaghian

Merge request reports