Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Deprecate OBSERVABILITY event type and MANAGE_OBSERVABILITY permission (#19475)

Lukasz Ostrowski4cc3fbec09d7
diff --git a/saleor/graphql/core/enums.py b/saleor/graphql/core/enums.py
index 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_codes
from ...order import error_codes as order_error_codes
from ...page import error_codes as page_error_codes
from ...payment import error_codes as payment_error_codes
-from ...permission.enums import get_permissions_enum_list
+from ...permission.enums import AppPermission, get_permissions_enum_list
from ...plugins import error_codes as plugin_error_codes
from ...product import error_codes as product_error_codes
from ...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_USERS
diff --git a/saleor/graphql/schema.graphql b/saleor/graphql/schema.graphql
index 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_STAFF
IMPERSONATE_USER
MANAGE_APPS
- MANAGE_OBSERVABILITY
+ MANAGE_OBSERVABILITY @deprecated(reason: "The observability feature is no longer supported. This permission will be removed in Saleor 3.24.")
MANAGE_CHECKOUTS
HANDLE_CHECKOUTS
HANDLE_TAXES
@@ -14122,7 +14122,7 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") {
CHECKOUT_FULLY_AUTHORIZED
CHECKOUT_FULLY_PAID
CHECKOUT_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_CREATED
PAGE_UPDATED
PAGE_DELETED
@@ -14157,7 +14157,7 @@ enum WebhookSampleEventTypeEnum @doc(category: "Webhooks") {
VOUCHER_CODES_DELETED
VOUCHER_METADATA_UPDATED
VOUCHER_CODE_EXPORT_COMPLETED
- OBSERVABILITY
+ OBSERVABILITY @deprecated(reason: "The observability feature is no longer supported. This event will be removed in Saleor 3.24.")
THUMBNAIL_CREATED
SHOP_METADATA_UPDATED
}
diff --git a/saleor/graphql/webhook/enums.py b/saleor/graphql/webhook/enums.py
index 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_REASON
return None
@@ -324,6 +329,7 @@ WebhookSampleEventTypeEnum = graphene.Enum(
for e_type in WebhookEventAsyncType.CHOICES
if e_type[0] != WebhookEventAsyncType.ANY
],
+ deprecation_reason=deprecation_reason,
)
WebhookSampleEventTypeEnum.doc_category = DOC_CATEGORY_WEBHOOKS