From 4c3542a91c3b57a80b2e7a18b583aceb28ecd4a6 Mon Sep 17 00:00:00 2001 From: Graham Neubig Date: Fri, 6 Feb 2026 06:01:37 -0800 Subject: [PATCH] fix: use appropriate log level for webhook installation results (#12493) Co-authored-by: openhands --- .../gitlab/webhook_installation.py | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/enterprise/integrations/gitlab/webhook_installation.py b/enterprise/integrations/gitlab/webhook_installation.py index c3ab74b205..123ec21079 100644 --- a/enterprise/integrations/gitlab/webhook_installation.py +++ b/enterprise/integrations/gitlab/webhook_installation.py @@ -167,17 +167,15 @@ async def install_webhook_on_resource( scopes=SCOPES, ) - logger.info( - 'Creating new webhook', - extra={ - 'webhook_id': webhook_id, - 'status': status, - 'resource_id': resource_id, - 'resource_type': resource_type, - }, - ) + log_extra = { + 'webhook_id': webhook_id, + 'status': status, + 'resource_id': resource_id, + 'resource_type': resource_type, + } if status == WebhookStatus.RATE_LIMITED: + logger.warning('Rate limited while creating webhook', extra=log_extra) raise BreakLoopException() if webhook_id: @@ -191,9 +189,8 @@ async def install_webhook_on_resource( 'webhook_uuid': webhook_uuid, # required to identify which webhook installation is sending payload }, ) - - logger.info( - f'Installed webhook for {webhook.user_id} on {resource_type}:{resource_id}' - ) + logger.info('Created new webhook', extra=log_extra) + else: + logger.error('Failed to create webhook', extra=log_extra) return webhook_id, status