Skip to content

Add file_identifier_hash to diff file

What does this MR do?

We currently use file_hash as an ID when we are looking for a diff file. The issue with that we can have two diff file with exact same file_hash when there is a change over from Symlink file to Regular file or vice versa.

We'd like to be able to identify diff_file more reliably and it seems that we already have file_identifier that we can use instead of file_path as the seed string.

This will be followed by possibly two more MRs to fix #33867

  • Frontend MR: update the way we find diff_file and pass this file_identifier_hash to backend when posting new notes
  • Backend MR: Use this file_identifier_hash to pick the right diff_file when new note gets created. We should make sure it falls back to the current way of identifying diff_file if no file_identifer_hash is store on a note.

Screenshots

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #33867

Edited by Sincheol (David) Kim

Merge request reports