Skip to content

Commit

Permalink
add log to inform when apps are suspended or unsuspended (#588)
Browse files Browse the repository at this point in the history
  • Loading branch information
giovanni-guidini authored May 30, 2024
1 parent cadd7d7 commit 277b2cb
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion webhook_handlers/views/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,6 @@ def _handle_installation_events(

installation_id = request.data["installation"]["id"]

# TODO: Consider adding "suspend" action here?
# https://docs.github.com/en/webhooks/webhook-events-and-payloads#installation
if action == "deleted":
if event == GitHubWebhookEvents.INSTALLATION:
Expand Down Expand Up @@ -538,6 +537,18 @@ def _handle_installation_events(
owner.save()
# Deprecated flow - END

# We need to understand if users are suspending / not-suspending apps
# and if this is related to RepositoryWithoutValidBot errors we see
if action in ["suspend", "unsuspend"]:
log.info(
"Request to suspend/unsuspend App",
extra=dict(
action=action,
ownerid=owner.ownerid,
installation_id=request.data["installation"]["id"],
),
)

log.info(
"Triggering refresh task to sync repos",
extra=dict(ownerid=owner.ownerid, github_webhook_event=self.event),
Expand Down

0 comments on commit 277b2cb

Please sign in to comment.