Skip to content

Fix truncated messages for commits

What does this MR do and why?

Contributes to #357459 (closed)

Problem

Code responsible for displaying a list of last commits for each path truncates the commit message to 1Kb. But that leads to creation of the truncated markdown cache for commit description.

Solution

Trigger the markdown cache creation before the description is truncated.

Change of the flow:

Before After
Fetch commits Fetch commits
Convert commits to hashes (NEW) Render description markdown for each commit (uses a non-truncated description)
Truncate commit messages Truncate commit message
Save commits hashes in Redis Save commits hashes in Redis
Restore commits from Redis Restore commits from Redis
Render description markdown for each commit (BUG: uses a truncated a commit message) Reuse the description markdown for each commit

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
Screenshot_2024-09-19_at_10.24.23 Screenshot_2024-09-19_at_10.34.01

How to set up and validate locally

  1. Create or reuse an existing GitLab project
  2. Clone the project locally
  3. Add a new file
  4. Add a very large commit message (example: jay_mccure/test_git_2@9b665bfe)
  5. Push the change
  6. Click on the commit
  7. The commit message should not be truncated
Edited by Vasilii Iakliushin

Merge request reports

Loading