Skip to content

Commit

Permalink
Update event logging
Browse files Browse the repository at this point in the history
Ping events are no longer logged. Unknonw events are now logged as Debug.

Signed-off-by: Gabriel Adrian Samfira <[email protected]>
  • Loading branch information
gabriel-samfira committed Feb 10, 2025
1 parent ce7c67a commit eca5e1e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apiserver/controllers/controllers.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ func (a *APIController) WebhookHandler(w http.ResponseWriter, r *http.Request) {
switch event {
case runnerParams.WorkflowJobEvent:
a.handleWorkflowJobEvent(ctx, w, r)
case runnerParams.PingEvent:
// Ignore ping event. We may want to save the ping in the github entity table in the future.
default:
slog.InfoContext(ctx, "ignoring unknown event", "gh_event", util.SanitizeLogEntry(string(event)))
slog.DebugContext(ctx, "ignoring unknown event", "gh_event", util.SanitizeLogEntry(string(event)))
}
}

Expand Down
1 change: 1 addition & 0 deletions params/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
// WorkflowJobEvent is the event set in the webhook payload from github
// when a workflow_job hook is sent.
WorkflowJobEvent Event = "workflow_job"
PingEvent Event = "ping"
)

// WorkflowJob holds the payload sent by github when a workload_job is sent.
Expand Down

0 comments on commit eca5e1e

Please sign in to comment.