From 1a9536ebccd7c9e918d686fd6eae92bda500de8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zaj=C4=85c?= Date: Thu, 22 Oct 2020 16:44:17 +0200 Subject: [PATCH 1/2] Log name components for UUIDv5 generation For some reason we are unable to reproduce UUIDs for Vulnerability::Finding objects when calculating them from the persisted data. See https://gitlab.com/gitlab-org/gitlab/-/issues/212322#note_434346683 for a sample. Now we will log the name we use when generating the UUID right before we persist the object. --- ee/app/services/security/store_report_service.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ee/app/services/security/store_report_service.rb b/ee/app/services/security/store_report_service.rb index 18567d360bbab8..27e31c4178bdbf 100644 --- a/ee/app/services/security/store_report_service.rb +++ b/ee/app/services/security/store_report_service.rb @@ -104,6 +104,8 @@ def calculcate_uuid_v5(vulnerability_finding, finding_params) name = uuid_v5_name_components.values.join('-') + Gitlab::AppLogger.debug(message: "Generating UUIDv5 with name: #{name}") + Gitlab::Vulnerabilities::CalculateFindingUUID.call(name) end -- GitLab From a73d14947d0ac5befefa8eb9fbbaddc8f7893c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Zaj=C4=85c?= Date: Tue, 27 Oct 2020 14:29:34 +0100 Subject: [PATCH 2/2] Check for dev or .com --- ee/app/services/security/store_report_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ee/app/services/security/store_report_service.rb b/ee/app/services/security/store_report_service.rb index 27e31c4178bdbf..591600b6d872c4 100644 --- a/ee/app/services/security/store_report_service.rb +++ b/ee/app/services/security/store_report_service.rb @@ -104,7 +104,7 @@ def calculcate_uuid_v5(vulnerability_finding, finding_params) name = uuid_v5_name_components.values.join('-') - Gitlab::AppLogger.debug(message: "Generating UUIDv5 with name: #{name}") + Gitlab::AppLogger.debug(message: "Generating UUIDv5 with name: #{name}") if Gitlab.dev_env_or_com? Gitlab::Vulnerabilities::CalculateFindingUUID.call(name) end -- GitLab