Using patches as multi-file suggestions
<!--IssueSummary start--> <details> <summary> Everyone can contribute. [Help move this issue forward](https://handbook.gitlab.com/handbook/marketing/developer-relations/contributor-success/community-contributors-workflows/#contributor-links) while earning points, leveling up and collecting rewards. </summary> - [Close this issue](https://contributors.gitlab.com/manage-issue?action=close&projectId=278964&issueIid=220044) </details> <!--IssueSummary end--> ### Problem to solve We want to make patch files a first-class citizen within our merge requests / code reviews. Specifically, we want to allow authors to be able to view and apply patch files in the same way they can currently apply suggestions. These patches can be created: - using the `git diff > suggestions.patch` command - using GitLab Workflow extension in VS Code https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/393 - in the future using WebIDE https://gitlab.com/gitlab-org/gitlab/-/issues/31978 ### Intended users * [Sasha (Software Developer)](https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas/#sasha-software-developer) ### What does success look like, and how can we measure that? We would somehow recognize that a comment contains patch (it could be a snippet patch or text attachment), in the comment we would show a component similar to `<details>` HTML tag that would allow users to inspect the whole patch before applying. e.g. <details> <summary>`increase tests to 2000ms.patch`</summary> ```diff diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2c4c11e..26a9d6c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,7 @@ image: node:12-slim test: script: - - sleep 20 + - sleep 2000 - echo hello deploy: diff --git a/README.md b/README.md index ae85919..a0519ba 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -# Initial readme \ No newline at end of file +# Initial readme + +- The tests take 2000ms ``` </details> Or we would embed a snippet similar to: https://gitlab.com/viktomas/test-project/-/snippets/2146307 We could also explore showing a modal if the component doesn't have enough space. After inspecting the patch, users could apply it with a button and specify the commit message (defaulting to the patch file name). ### Links / references <details> <summary>Original suggestion</summary> ### Problem to solve We want to make patch files a first class citizen within our merge requests / code reviews. Specifically we want to allow authors to be able to apply patch files in the same they can current apply suggestions. ### Intended users * [Sasha (Software Developer)](https://about.gitlab.com/handbook/marketing/product-marketing/roles-personas/#sasha-software-developer) ### What does success look like, and how can we measure that? A author should be able to access a button called: "Apply Patch" which would let them apply a suggested patch file inside the GitLab UI. ### Links / references </details>
issue