From 16aa9254adfcea7ab15c21e9282685502866c1c2 Mon Sep 17 00:00:00 2001 From: Harry Date: Mon, 29 Dec 2025 19:58:42 +0800 Subject: [PATCH] doc(api): improve comments for better understanding in TriggerSubscriptionUpdateApi and TriggerProviderService --- api/controllers/console/workspace/trigger_providers.py | 6 ++++-- api/services/trigger/trigger_provider_service.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/api/controllers/console/workspace/trigger_providers.py b/api/controllers/console/workspace/trigger_providers.py index 5e1aecd49f..c13bfd986e 100644 --- a/api/controllers/console/workspace/trigger_providers.py +++ b/api/controllers/console/workspace/trigger_providers.py @@ -353,7 +353,8 @@ class TriggerSubscriptionUpdateApi(Resource): # For rename only, just update the name rename = request.name is not None and not any((request.credentials, request.parameters, request.properties)) # When credential type is UNAUTHORIZED, it indicates the subscription was manually created - # For Manually created subscription, they dont have credentials, parameters, only name and properties(which is input by user) + # For Manually created subscription, they dont have credentials, parameters + # They only have name and properties(which is input by user) manually_created = subscription.credential_type == CredentialType.UNAUTHORIZED if rename or manually_created: TriggerProviderService.update_trigger_subscription( @@ -364,7 +365,8 @@ class TriggerSubscriptionUpdateApi(Resource): ) return 200 - # For the rest cases(API_KEY, OAUTH2), we need to call third party provider(e.g. GitHub API) to rebuild the subscription + # For the rest cases(API_KEY, OAUTH2) + # we need to call third party provider(e.g. GitHub) to rebuild the subscription TriggerProviderService.rebuild_trigger_subscription( tenant_id=user.current_tenant_id, name=request.name, diff --git a/api/services/trigger/trigger_provider_service.py b/api/services/trigger/trigger_provider_service.py index 0344f46d60..79fcec36b5 100644 --- a/api/services/trigger/trigger_provider_service.py +++ b/api/services/trigger/trigger_provider_service.py @@ -853,7 +853,7 @@ class TriggerProviderService: """ Create a subscription builder for rebuilding an existing subscription. - This method rebuild the subscription by calling DELETE and CREATE API of the third party provider(e.g. GitHub API) + This method rebuild the subscription by call DELETE and CREATE API of the third party provider(e.g. GitHub) keeping the same subscription_id and endpoint_id so the webhook URL remains unchanged. :param tenant_id: Tenant ID