Skip to content

Use commit date for cross-referenced system notes

What does this MR do?

This MR fixes #20153 (closed). Currently, GitLab does not respect the date of commits when creating cross-referenced system notes. That leads to incorrect order of notes when a push is made significantly later than commits. That is especially important when an existing Git repository is imported to GitLab.

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

The main risk - I only did end-to-end testing on our self-hosted server. I did not add the unit test to issuables_service_spec.rb because I cannot run it locally without configuration of local environment. Basically, the test should look like that:

let(:commit) { project.commit }
system_note = service.cross_reference(commit)
expect(system_note.created_at)
    .to eq(commit.created_at)

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

#20153 (closed)

Merge request reports