Cleanup and consolidation for /clean in Duo Chat
## Problem to Solve When using Duo Chat there is [**unexpected behavior**](https://www.sonarsource.com/learn/software-bugs/#:\~:text=Software%20bugs%20are%20faults%2C%20flaws,or%20erroneous%20and%20insufficient%20output.) when using the slash commands. The string `/clean` unexpectedly deletes all messages although it is not mentioned in GitLab's [customer facing documentation](https://docs.gitlab.com/ee/user/gitlab_duo_chat/examples.html#supported-slash-commands). In addition, the `/clear` command already handles this action in Duo Chat making `/clean` and unnecessary addition to maintain and document. The expectation is that users have access to the slash commands that are documented. Allowing an additional undocumented command would disrupt users' workflow and lead to unmet expectations. ## Notes on Architecture It has been decided here that the best course of action is to remove the `/clean` command as it is not documented and as there is already a slash command (`/clear`) that handles the action. * DuoChat relies on a shared VueComponent distributed via the [GitLabUI](https://gitlab.com/gitlab-org/gitlab-ui) npm package, this is the core of the shared User-Interface * This component is used by various projects that integrate DuoChat: * [WebUI aka “the monolith”](https://gitlab.com/gitlab-org/gitlab) * [the Jetbrains Extension](https://gitlab.com/gitlab-org/editor-extensions/gitlab-jetbrains-plugin) * [the VS Code Extension](https://gitlab.com/gitlab-org/gitlab-vscode-extension) ```mermaid graph TD; A[GitLabUI npm package] --> B[WebUI monolith]; A --> C[Jetbrains Extension]; A --> D[VS Code Extension]; ``` ## Revised Implementation Plan Due to issues [described here](https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/4415#note_2012867970), the previous implementation plan needed to be revised. The revised implementation plan will have to be split in to two different parts: a plan for the web Ide and a plan for the editor extensions. ### Implementing in Web Ide - [ ] Create changes in GitLab UI to remove `/clean`: https://gitlab.com/gitlab-org/gitlab-ui/-/merge_requests/4415+ - [ ] Demo the change in the GDK to prove all moving parts are working together and make the review somewhat possible. - [ ] Merge the GitLab UI changes and mark this as a breaking change. - [ ] The changes from the diff “to make this work in the GDK” will become the changes in the integration MR to bump up the GitLabUI version. Once this is merged, we will be done with changes on the monolith. ### Implementation plan for Extensions The editor extension could be speaking to many different backends. It might be communicating with GitLab.com (as described above) or a self-managed instance that hasn’t been updated for years. This is a common issue when working with editor extensions. * For example, this Issue and MR serve as a blueprint for the necessary measures: https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/merge_requests/1790. Ensure there is a fallback in place so this doesn’t error out when the query runs against an older self-managed GitLab instance. * When can we get rid of that fallback? Taking a look at our Version Support Policy: https://about.gitlab.com/support/statement-of-support/#version-support we should be very patient with that. * Also, be aware that this fallback should be merged before we upgrade the GitLabUI version on the monolith. We don’t want to release a breaking change in GitLabUI without being able to update the monolith version promptly, as this would block the upgrade path for GitLabUI. In short, the fallback for the VSCode and JetBrains Extensions should be the first MR. Any other order has the potential to cause issues. **Note:** The JetBrains extension and VSCode extensions are currently blocked on this work as extensions catch up to the latest version of the `@gitlab/ui` dependency. The work to get that dependency updated in each extension can be found [here for JetBrains](https://gitlab.com/gitlab-org/editor-extensions/gitlab-jetbrains-plugin/-/issues/522 "[JetBrains] Update the `@gitlab/ui` dependency") and [here for VSCode](https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/1446 "[VS Code] Update the `@gitlab/ui` dependency"). cc @dashaadu @kisha.mavryck @jannik_lehmann
epic