From 1ddaece7359a173e9f75a80b702148729f167b46 Mon Sep 17 00:00:00 2001 From: Harry Date: Mon, 29 Dec 2025 19:57:07 +0800 Subject: [PATCH] doc(api): enhance comments for clarity in TriggerSubscriptionUpdateApi and TriggerProviderService --- api/controllers/console/workspace/trigger_providers.py | 3 ++- api/services/trigger/trigger_provider_service.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/api/controllers/console/workspace/trigger_providers.py b/api/controllers/console/workspace/trigger_providers.py index 886e04e06d..5e1aecd49f 100644 --- a/api/controllers/console/workspace/trigger_providers.py +++ b/api/controllers/console/workspace/trigger_providers.py @@ -353,6 +353,7 @@ 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) manually_created = subscription.credential_type == CredentialType.UNAUTHORIZED if rename or manually_created: TriggerProviderService.update_trigger_subscription( @@ -363,7 +364,7 @@ class TriggerSubscriptionUpdateApi(Resource): ) return 200 - # For the rest cases(API_KEY, OAUTH2), call third party provider to rebuild the subscription + # For the rest cases(API_KEY, OAUTH2), we need to call third party provider(e.g. GitHub API) 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 3bca4813be..0344f46d60 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 creates a builder pre-filled with data from the rebuild request, + This method rebuild the subscription by calling DELETE and CREATE API of the third party provider(e.g. GitHub API) keeping the same subscription_id and endpoint_id so the webhook URL remains unchanged. :param tenant_id: Tenant ID