Create page-specific questions for Duo Chat in UI

Problem

  • The generic welcome questions don't highlight Duo's contextual capabilities
  • Current questions focus on how to use Gitlab rather than practical use cases customized to the page the user is on.
  • Users do not discover page-specific features.
  • If they do they assume that all page types are supported as context.

The core tension is that users both:

  • Overestimate what Duo can do in some areas (leading to disappointment)
  • Underestimate what Duo can do in others (missing out on valuable assistance)

Proposal

Create a set of targeted questions or user queries for each GitLab page type where Duo Chat has contextual awareness.

Duo Chat uses context/data from the following pages:

  • Code blob page
  • Issues
  • Epics
  • Commits
  • MRs
  • Pipeline Jobs

Each set of questions should:

  • Be concise and clear
  • Use data from the page
  • Generate answers that add immediate value to users
  • Extract insights that are hard to gather at a glance (not duplicate UI elements)
  • Synthesize information (e.g. from discussions, pipeline logs or changes)
  • Generate actionable insights based on available page data
  • Must be available to the user given their add-on tier (e.g. don't offer issue questions to a user on Duo Pro)

Behavior

  • When the user starts a new conversation, show 4 questions on the splash screen that fit to the current page as outlined just below.
  • When the user opens the chat and the conversation is empty, show 4 questions that fit to the current page as outlined just below.
  • When the user switches to a different page type and the chat is still empty, show 4 questions that fit to the page the user switched to as outlined just below.
  • Always only show questions that can potentially be answered by Duo Chat given the add-on tier the user is on. (Don't show questions that only work on GitLab Duo Enterprise to users that are on GitLab Duo Pro.)
  • Show 4 questions at a time. If there are more available for the page type show a random selection of 4.

Revised questions by page type

The suggested questions with the goal of the question in parentheses.

Code page (for users on GitLab Duo Enterprise and GitLab Duo Pro)

Show 4 random questions from this list:

  • What does this code do?
  • How can I make this code more efficient?
  • Identify any security vulnerabilities in my code
  • Are there any bugs in this code
  • Create documentation for this code

Issues (for users on GitLab Duo Enterprise)

  • What is the current state of this issue? (Understand status, assignees, and timeline)
  • What key decisions were made in this issue? (Extract important choices from comments)
  • Are there any concerns or blockers on this issue? (Identify problems from discussions and tasks)
  • What are the agreed next steps in this issue? (Find action items from both description and comments)

Epics (for users on GitLab Duo Enterprise)

  • What is the objective and scope of this epic? (Quickly grasp purpose and boundaries from description)
  • What key features are planned? (Understand main deliverables)
  • What are the main concerns from discussions? (Extract important issues raised in comments)
  • What is the current progress and implementation status? (See state and key discussion points)

Commits (for users on GitLab Duo Enterprise)

  • What changes does this commit introduce? (Quickly understand the purpose and impact of the changes)
  • What files were modified in this commit? (See affected areas without diving into code)
  • What is the impact of this commit? (Understand how these changes affect the project)
  • How can I test these changes? (Learn how to verify the commit works as intended)

MRs (for users on GitLab Duo Enterprise)

  • What are the main points from this MR discussion? (Synthesize long comment threads)
  • What changes were requested by reviewers? (Extract specific asks from discussions)
  • What concerns remain unresolved in this MR? (Find open issues across comments)
  • What changed in this diff?

Pipeline Jobs (for users on GitLab Duo Enterprise)

  • What errors or warnings appeared in this job? (Find problems in the logs)
  • What caused any slow or failing steps in this job? (Identify performance and failure points)
  • Were all dependencies available in this job? (Check environment and setup issues)
  • What was each stage's final status? (See completion state of all steps)

All other pages and cases not already covered above

Show 4 random questions from this list:

  • How can I improve my code security?
  • What are code review best practices?
  • Help me set up continuous deployment
  • Show me automated testing strategies
  • How can I organize projects effectively in GitLab?
  • How do I manage environment variables?
  • What causes pipeline failures?
  • How do I securely store secrets in GitLab CI/CD?
  • How do I scan dependencies for vulnerabilities?
  • How do I make my CI pipelines run faster?
  • How do I debug issues with GitLab runners?
  • How do I set up quality gates in my pipeline?
  • How should i structure complex epics?
  • What makes good acceptance criteria?
  • How do I estimate story points?

These revised questions will help users discover and broaden user's understanding of Duo Chat's capabilities across different GitLab pages in the UI.

Implementation plan

Backend

  1. Create a list of questions it might be a yml file or simply Ruby data class.
  2. Create a new GraphQL type that that accepts parameter: currentPage that is an enum of strings (this will allow us to add support for pages in a controlled way). Endpoint should return a list of 4 random questions for this page. 3.Resolver for this type should return a list of 4 random questions for chosen page.
  3. We should also validate that user has access to this type of questions. We might need to add new permission policies.

Implement end user permissions for some Unit primitives that controls page context tools

In order to implement End User UI permission for existing unit primitive, we need to promote existing Unit primitives (like ask_issue) as a service.

  • In gitlab-cloud-connector gem, remove ask_command from ignore list here. Note that this is needed only for existing unit primitives - new ones are already synchronised
  • Release the new Ruby Gem version by following this guide
  • In Rails monolith in global_policy check user.allowed_to_use?(:ask_issue)

Frontend

Query example:

{
  aiChatContextPresets(
    resourceId: "gid://gitlab/Issue/692"
    projectId: "gid://gitlab/Project/22"
    url: "https://gitlab.com/gitlab-org/gitlab/-/issues/509992"
    questionCount: 4
  ) {
    questions
  }
}
  1. Replace hardcoded question values with a GraphQL request.
Edited by Tetiana Chupryna