From a6218c3f5432a6d08d0ff852f67892119b317a7d Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Fri, 15 Dec 2023 18:08:46 +0100 Subject: [PATCH 1/3] Use cura sentry id and version Contribute to CURA-11482 --- conandata.yml | 2 +- plugins/CuraEngineBackend/Cura.proto | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/conandata.yml b/conandata.yml index a0a5a204ca..dcf883c630 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,7 +1,7 @@ version: "5.7.0-alpha.0" requirements: - "uranium/(latest)@ultimaker/testing" - - "curaengine/(latest)@ultimaker/testing" + - "curaengine/(latest)@ultimaker/cura_11482" - "cura_binary_data/(latest)@ultimaker/testing" - "fdm_materials/(latest)@ultimaker/testing" - "curaengine_plugin_gradual_flow/(latest)@ultimaker/stable" diff --git a/plugins/CuraEngineBackend/Cura.proto b/plugins/CuraEngineBackend/Cura.proto index 54c322fa0a..9593b83528 100644 --- a/plugins/CuraEngineBackend/Cura.proto +++ b/plugins/CuraEngineBackend/Cura.proto @@ -33,6 +33,8 @@ message Slice repeated Extruder extruders = 3; // The settings sent to each extruder object repeated SettingExtruder limit_to_extruder = 4; // From which stack the setting would inherit if not defined per object repeated EnginePlugin engine_plugins = 5; + string sentry_id = 6; // The anonymized Sentry user id that requested the slice + string cura_version = 7; // The version of Cura that requested the slice } message Extruder From 5744371f380e8c7baa47c2ab05bea9157c5d7e58 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Sun, 17 Dec 2023 17:44:30 +0100 Subject: [PATCH 2/3] Add anonymous user tracking to slice message User tracking has been added to the 'slice_message' method in the 'StartSliceJob.py' file. A unique, anonymous UUID is generated for each user, stripping away identifiable data with a bitmask operation. The user's Cura version is also included in the message. This facilitates more robust analysis of crash reports and user behaviors. Contributes to CURA-11482 --- plugins/CuraEngineBackend/StartSliceJob.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/CuraEngineBackend/StartSliceJob.py b/plugins/CuraEngineBackend/StartSliceJob.py index a12e9e655d..fe7137150b 100644 --- a/plugins/CuraEngineBackend/StartSliceJob.py +++ b/plugins/CuraEngineBackend/StartSliceJob.py @@ -1,5 +1,7 @@ # Copyright (c) 2023 UltiMaker # Cura is released under the terms of the LGPLv3 or higher. +import uuid + import os import numpy @@ -30,6 +32,7 @@ from cura.CuraApplication import CuraApplication from cura.Scene.CuraSceneNode import CuraSceneNode from cura.OneAtATimeIterator import OneAtATimeIterator from cura.Settings.ExtruderManager import ExtruderManager +from cura.CuraVersion import CuraVersion NON_PRINTING_MESH_SETTINGS = ["anti_overhang_mesh", "infill_mesh", "cutting_mesh"] @@ -332,6 +335,11 @@ class StartSliceJob(Job): self._buildGlobalSettingsMessage(stack) self._buildGlobalInheritsStackMessage(stack) + user_id = uuid.getnode() # On all of Cura's supported platforms, this returns the MAC address which is pseudonymical information (!= anonymous). + user_id %= 2 ** 16 # So to make it anonymous, apply a bitmask selecting only the last 16 bits. This prevents it from being traceable to a specific user but still gives somewhat of an idea of whether it's just the same user hitting the same crash over and over again, or if it's widespread. + self._slice_message.sentry_id = "{user_id}" + self._slice_message.cura_version = CuraVersion + # Build messages for extruder stacks for extruder_stack in global_stack.extruderList: self._buildExtruderMessage(extruder_stack) From 82a3308d26a94ed834b5247dc2bfe945f68dee06 Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Mon, 18 Dec 2023 17:03:52 +0100 Subject: [PATCH 3/3] for merging to main CURA-11482 --- conandata.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conandata.yml b/conandata.yml index dcf883c630..a0a5a204ca 100644 --- a/conandata.yml +++ b/conandata.yml @@ -1,7 +1,7 @@ version: "5.7.0-alpha.0" requirements: - "uranium/(latest)@ultimaker/testing" - - "curaengine/(latest)@ultimaker/cura_11482" + - "curaengine/(latest)@ultimaker/testing" - "cura_binary_data/(latest)@ultimaker/testing" - "fdm_materials/(latest)@ultimaker/testing" - "curaengine_plugin_gradual_flow/(latest)@ultimaker/stable"