Loading
Resolve decision when a Duo clarifying question is answered
What does this MR do and why?
Resolves the open decision the backend creates when GitLab Duo posts a clarifying question, once the question's thread is resolved. This way the Decision log records what was answered and who decided.
- Picked options are selected (matched by label), a typed answer is saved as "Why", and the answer reply becomes the source link.
- Works from the question card, the thread's Resolve button, and a reply with "Resolve thread" checked. For the reply, we wait for it to be posted before resolving the decision.
- Resolving without an answer selects nothing and saves a fixed "Why", since the API requires one. A decision resolves only once, so resolving the thread again keeps the first answer.
A decision holds at most 5 options, so picks beyond those are dropped until #631184 (closed) caps options at 5. Everything is behind the decision_log feature flag, which is off by default.
References
- Resolves #608859 (closed)
- Backend: !257370 (merged)
Screenshots or screen recordings
| Default State (No plan or decisions) | Awaiting input (open decisions created) | Questions answered (decisions resolved) |
|---|---|---|
How to set up and validate locally
- In a Rails console, run
Feature.enable(:duo_workplan_async_flow),Feature.enable(:workplan)andFeature.enable(:decision_log). - Pick a work item whose description leaves decisions open, for example a list under "The team still has to decide all of the following, and none of it can be inferred from the codebase".
- Click Plan in the work item header (then Generate in the workplan panel if shown), and wait for GitLab Duo to post its questions. It may post only two, so you might need a second run to cover every step below.
- Answer one question with an option, and another in your own words.
- On a third question, post a reply, then reply again with "Resolve thread" checked. The checkbox only shows once the thread has a reply.
- On a fourth question, post a reply that doesn't answer it, then select Resolve thread.
- Open the Decision log from the work item header. Each decision is resolved with the expected option or "Why". "View source" goes to the answer, except on the one resolved without an answer.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by Kushal Pandya