Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Deprecate OBSERVABILITY event type and MANAGE_OBSERVABILITY permission (#19475)
Lukasz Ostrowski4cc3fbec09d7
diff --git a/saleor/graphql/core/enums.py b/saleor/graphql/core/enums.pyindex 2edf9e5371..f05160e0c7 100644--- a/saleor/graphql/core/enums.py+++ b/saleor/graphql/core/enums.py@@ -25,7 +25,7 @@ from ...menu import error_codes as menu_error_codesfrom ...order import error_codes as order_error_codesfrom ...page import error_codes as page_error_codesfrom ...payment import error_codes as payment_error_codes-from ...permission.enums import get_permissions_enum_list+from ...permission.enums import AppPermission, get_permissions_enum_listfrom ...plugins import error_codes as plugin_error_codesfrom ...product import error_codes as product_error_codesfrom ...shipping import error_codes as shipping_error_codes@@ -117,8 +117,20 @@ LanguageCodeEnum = graphene.Enum(JobStatusEnum: Final[graphene.Enum] = to_enum(JobStatus)++def permission_enum_deprecation_reason(enum):+ if enum.value == AppPermission.MANAGE_OBSERVABILITY.value:+ return (+ "The observability feature is no longer supported. "+ "This permission will be removed in Saleor 3.24."+ )+ return None++PermissionEnum: Final[graphene.Enum] = graphene.Enum(- "PermissionEnum", get_permissions_enum_list()+ "PermissionEnum",+ get_permissions_enum_list(),+ deprecation_reason=permission_enum_deprecation_reason,)PermissionEnum.doc_category = DOC_CATEGORY_USERSdiff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphqlindex 2c9fb36177..06d3178fff 100644--- a/saleor/graphql/schema.graphql+++ b/saleor/graphql/schema.graphql@@ -2206,7 +2206,7 @@ enum WebhookEventTypeEnum @doc(category: "Webhooks") {VOUCHER_CODE_EXPORT_COMPLETED"""An observability event is created."""- OBSERVABILITY+ OBSERVABILITY @deprecated(reason: "The observability feature is no longer supported. This event will be removed in Saleor 3.24.")"""A thumbnail is created."""THUMBNAIL_CREATED@@ -2815,7 +2815,7 @@ enum WebhookEventTypeAsyncEnum @doc(category: "Webhooks") {VOUCHER_CODE_EXPORT_COMPLETED"""An observability event is created."""- OBSERVABILITY+ OBSERVABILITY @deprecated(reason: "The observability feature is no longer supported. This event will be removed in Saleor 3.24.")"""A thumbnail is created."""THUMBNAIL_CREATED@@ -3016,7 +3016,7 @@ enum PermissionEnum @doc(category: "Users") {MANAGE_STAFFIMPERSONATE_USERMANAGE_APPS- MANAGE_OBSERVABILITY+ MANAGE_OBSERVABILITY @deprecated(reason: "The observability feature is no longer supported. This permission will be removed in Saleor 3.24.")MANAGE_CHECKOUTSHANDLE_CHECKOUTSHANDLE_TAXES@@ -14122,7 +14122,7 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") {CHECKOUT_FULLY_AUTHORIZEDCHECKOUT_FULLY_PAIDCHECKOUT_METADATA_UPDATED- NOTIFY_USER+ NOTIFY_USER @deprecated(reason: "See the docs for more details about migrating from NOTIFY_USER to other events: https://docs.saleor.io/upgrade-guides/core/3-16-to-3-17#migrating-from-notify_user")PAGE_CREATEDPAGE_UPDATEDPAGE_DELETED@@ -14157,7 +14157,7 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") {VOUCHER_CODES_DELETEDVOUCHER_METADATA_UPDATEDVOUCHER_CODE_EXPORT_COMPLETED- OBSERVABILITY+ OBSERVABILITY @deprecated(reason: "The observability feature is no longer supported. This event will be removed in Saleor 3.24.")THUMBNAIL_CREATEDSHOP_METADATA_UPDATED}diff --git a/saleor/graphql/webhook/enums.py b/saleor/graphql/webhook/enums.pyindex 01b86be769..b68303c098 100644--- a/saleor/graphql/webhook/enums.py+++ b/saleor/graphql/webhook/enums.py@@ -284,6 +284,11 @@ def deprecation_reason(enum):"See the docs for more details about migrating from NOTIFY_USER to other events: ""https://docs.saleor.io/upgrade-guides/core/3-16-to-3-17#migrating-from-notify_user")+ if enum.value == WebhookEventAsyncType.OBSERVABILITY:+ return (+ "The observability feature is no longer supported. "+ "This event will be removed in Saleor 3.24."+ )if enum.value == WebhookEventAsyncType.ANY:return DEFAULT_DEPRECATION_REASONreturn None@@ -324,6 +329,7 @@ WebhookSampleEventTypeEnum = graphene.Enum(for e_type in WebhookEventAsyncType.CHOICESif e_type[0] != WebhookEventAsyncType.ANY],+ deprecation_reason=deprecation_reason,)WebhookSampleEventTypeEnum.doc_category = DOC_CATEGORY_WEBHOOKS