Suggested changes do not render as full markup diffs when added to review (or preview) before submission
<!--- Please read this! Before opening a new issue, make sure to search for keywords in the issues filtered by the "regression" or "bug" label: - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=regression - https://gitlab.com/gitlab-org/gitlab/issues?label_name%5B%5D=bug and verify the issue you're about to submit isn't a duplicate. ---> ### Summary When commenting on code and suggesting changes, the Preview renders the diff correctly but the pending review box does not: ![image](/uploads/9ab4595fae98629f93643c76bd0318c9/image.png) Initially I thought this was another GitLab-CE specific thing, but it actually also reproduces on GitLab.com - so it might be a general oversight. ### Steps to reproduce 1. Open the "Changes" tab of a Merge Request on GitLab-CE 1. Select a line to comment on and bring up the inline comment box 1. Hit "Insert suggestion" so it inserts the existing line, and make a change 1. Verify that "Preview" shows the change correctly as a rendered diff (with red/green old/new) 1. Hit "Start a review" (because we obviously want to keep going after this) 1. Watch the Pending comment not render the full diff but only the new code ### Example Project Any project and MR should work, the review need not be submitted for this. ### What is the current *bug* behavior? There are three different stages to this: 1. Writing the comment an reviewing it 1. Batching the comment into a Review 1. Submitting the Review to have it addressed During 1. and 3., the diff renders correctly. For 2. however, only the suggested code is shown. ### What is the expected *correct* behavior? The diff renders correctly for all 3 stages. ### Relevant logs and/or screenshots <!-- Paste any relevant logs - please use code blocks (```) to format console output, logs, and code as it's tough to read otherwise. --> ### Output of checks <!-- If you are reporting a bug on GitLab.com, write: This bug happens on GitLab.com --> #### Results of GitLab environment info <!-- Input any relevant GitLab environment information if needed. --> <details> <summary>Expand for output related to GitLab environment info</summary> <pre> root@gitlab:~# gitlab-rake gitlab:env:info System information System: Debian 10 Current User: git Using RVM: no Ruby Version: 2.7.2p137 Gem Version: 3.1.4 Bundler Version:2.1.4 Rake Version: 13.0.3 Redis Version: 6.0.10 Git Version: 2.29.0 Sidekiq Version:5.2.9 Go Version: unknown GitLab information Version: 13.10.3 Revision: b1774ad36a9 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 12.4 URL: https://gitlab HTTP Clone URL: https://gitlab/some-group/some-project.git SSH Clone URL: git@gitlab:some-group/some-project.git Using LDAP: yes Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 13.17.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git </pre> </details> #### Results of GitLab application Check <!-- Input any relevant GitLab application check information if needed. --> <details> <summary>Expand for output related to the GitLab application check</summary> <pre> # gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ... Checking GitLab Shell ... GitLab Shell: ... GitLab Shell version >= 13.17.0 ? ... OK (13.17.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful Checking GitLab Shell ... Finished Checking Gitaly ... Gitaly: ... default ... OK Checking Gitaly ... Finished Checking Sidekiq ... Checking Sidekiq ... Finished Checking Incoming Email ... Incoming Email: ... Reply by email is disabled in config/gitlab.yml Checking Incoming Email ... Finished Checking LDAP ... LDAP: ... Server: ldapmain not verifying SSL hostname of LDAPS server 'dc-01.domain.tld:389' LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results ) User output sanitized. Found 100 users of 100 limit. Checking LDAP ... Finished Checking GitLab App ... Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 3/2 ... yes 4/3 ... yes 4/4 ... yes 5/5 ... yes 8/6 ... yes 8/7 ... yes 8/8 ... yes 5/9 ... yes 12/10 ... yes 8/11 ... yes 17/12 ... yes 19/13 ... yes 8/15 ... yes 31/16 ... yes 31/18 ... yes 31/19 ... yes 31/20 ... yes 4/21 ... yes 8/23 ... yes 34/24 ... yes 34/25 ... yes 34/26 ... yes 34/27 ... yes 34/28 ... yes 8/29 ... yes 35/30 ... yes 35/31 ... yes 35/32 ... yes 35/33 ... yes 34/34 ... yes 34/35 ... yes 38/36 ... yes 12/37 ... yes 8/38 ... yes 39/39 ... yes 39/40 ... yes 8/41 ... yes 34/43 ... yes 10/44 ... yes 10/45 ... yes 10/46 ... yes 10/47 ... yes 10/48 ... yes 10/49 ... yes 40/50 ... yes 40/51 ... yes 40/52 ... yes 41/53 ... yes 42/54 ... yes 43/55 ... yes 43/56 ... yes 4/57 ... yes 44/58 ... yes 45/59 ... yes 4/60 ... yes 4/61 ... yes 17/62 ... yes 46/63 ... yes 46/64 ... yes 46/65 ... yes 47/66 ... yes 13/67 ... yes 13/68 ... yes 13/69 ... yes 2/70 ... yes 2/71 ... yes 2/72 ... yes 2/73 ... yes 2/74 ... yes 40/75 ... yes 31/76 ... yes 31/77 ... yes 6/78 ... yes 49/80 ... yes 13/81 ... yes 51/82 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.7.2 ? ... yes (2.7.2) Git version >= 2.29.0 ? ... yes (2.29.0) Git user has default SSH configuration? ... yes Active users: ... 25 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Checking GitLab App ... Finished Checking GitLab subtasks ... Finished </pre> </details> ### Possible fixes <!-- If you can, link to the line of code that might be responsible for the problem. -->
issue