Skip to content

Commit

Permalink
More meaningful log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobValdemar committed Aug 14, 2020
1 parent f53f0a7 commit 6d35b89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions issue_release_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func (handler *PRCreateHandler) Handle(ctx context.Context, eventType, deliveryI
policyPath := handler.releaseManagerURL + "/policies?service="
describeArtifactPath := handler.releaseManagerURL + "/describe/artifact/"

// Filters
// Filters - Consider using Chain of Responsibility for this if it gets bloated.
// - Action type
if event.GetAction() != "opened" {
logger.Info().Msgf("Filter ActionType triggered. Action: '%s'", event.GetAction())
Expand All @@ -110,14 +110,14 @@ func (handler *PRCreateHandler) Handle(ctx context.Context, eventType, deliveryI
return errors.Wrap(err, "requesting describeArtifact from release manager")
}
if len(describeArtifactResponse.Artifacts) == 0 {
logger.Info().Msg("Filter UnmanagedRepo triggered")
logger.Info().Msgf("Filter UnmanagedService triggered. Service: '%s'", serviceName)
return nil
}
// - Ignored repositories
if any(handler.repoFilters, func(filterRepo string) bool {
return filterRepo == repository.GetName()
}) {
logger.Info().Msg("Filter IgnoredRepo triggered")
logger.Info().Msgf("Filter IgnoredRepo triggered. Repo: '%s'", repository.GetName())
return nil
}

Expand Down Expand Up @@ -163,7 +163,7 @@ func (handler *PRCreateHandler) Handle(ctx context.Context, eventType, deliveryI
return errors.Wrapf(err, "commenting on pull request, with DeliveryID '%v'", deliveryID)
}

logger.Info().Msg("Comment created")
logger.Info().Msgf("Comment created on %s PR %d", repositoryName, *event.PullRequest.Number)

return nil
}

0 comments on commit 6d35b89

Please sign in to comment.