Skip to content

Add explain slash command

Jan Provaznik requested to merge jp-cmd-explain into master

What does this MR do and why?

Related to #431575 (closed)

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

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

Example below:

  1. Feature.enable(:slash_commands)
  2. In one browser tab open Duo Chat UI, in second tab open graphql-explorer
  3. Send the following request from graphql explorer and check the result in Duo Chat UI:
mutation {
  aiAction(input: {chat: {content: "/explain", currentFile: {
    fileName: "test.rb",
    selectedText: "
def extract(content)
  lines = content.to_s.lines
  comment_block = []
  trimmed_lines = 0
end
",
  }}}) {
    clientMutationId
    errors
  }
}

MR acceptance checklist

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

Edited by Gosia Ksionek

Merge request reports