Fix rendering failure for the 'Verified' badge
What does this MR do and why?
Describe in detail what your merge request does and why.
This MR fixes two bugs preventing the signature badge from rendering correctly on the last commit widget and also on the "Add previously merged commits" modal.
-
frontend
v-html-safe
is stripping off necessary html content fromsignatureHtml
. I've not been able to find a DOMPurify configuration which allows for this HTML to be rendered correctly, so I've reverted it back tov-html
. This was introduced by !72872 (merged). -
backend The
signature_html
attribute returned byProjects::MergeRequestsController#context_commits
was nil. Presumably, this is becauseAPI::Entities::CommitWithLink
does not respond torender
. So, we now callApplicationController.renderer.render
instead.
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
Component | Before | After |
---|---|---|
last_commit |
||
commit_item |
Screen_Recording_2022-04-10_at_3.01.02_PM |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
In the gitlab UI, create a new blank project named
gpg-test
and copy the remote URI -
Create a new project and add a signed commit to it
mkdir gpg-test cd gpg-test echo '# This is a test of GPG signed commits' > README.md git init git add . git commit -m 'This commit is signed with gpg' -S
-
Push the commit to remote
git remote add origin <remote_uri> git push -u origin main
-
Reload the project page
-
Click on the rendered
Verified
badge and check that the GPG key information and user avatar appears
To verify the "Add previously merged commits" modal:
- Commit any change and open a merge request for it
- Go to the merge request page and click on the "commits" tab
- Click on the "Add previously merged commits" button
- Click on the rendered
Verified
badge and check that the GPG key information and user avatar appears
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.