BlamelistRepoWhiteset computes the aggregate repository whitelist for all blamelist notification configurations in a given set of notifications.
BuildbucketPubSubHandler is the main entrypoint for a new update from buildbucket's pubsub.
This handler delegates the actual processing of the build to handleBuild. Its primary purpose is to unwrap context boilerplate and deal with progress-stopping errors.
InitDispatcher registers the send email task with the given dispatcher.
func Notify(c context.Context, d *tq.Dispatcher, recipients EmailNotify, templateParams *config.TemplateInput) error
Notify discovers, consolidates and filters recipients from a Builder's notifications, and 'email_notify' properties, then dispatches notifications if necessary. Does not dispatch a notification for same email, template and build more than once. Ignores current transaction in c, if any.
SendEmail is a push queue handler that attempts to send an email.
Build is buildbucketpb.Build along with the parsed 'email_notify' values.
Checkout represents a Git checkout of multiple repositories. It is a mapping of repository URLs to Git revisions.
NewCheckout creates a new Checkout populated with the repositories and revision found in the GitilesCommits object.
Filter filters out repositories from the Checkout which are not in the whitelist and returns a new Checkout.
ToGitilesCommits converts the Checkout into a set of GitilesCommits which may be stored as part of a config.Builder.
CheckoutFunc is a function that given a Build, produces a source checkout related to that build.
EmailNotify contains information for delivery and personalization of notification emails.
func ComputeRecipients(notifications notifypb.Notifications, inputBlame *gitpb.Commit, outputBlame Logs) EmailNotify
ComputeRecipients computes the set of recipients given a set of notifications, and potentially "input" and "output" blamelists.
An "input" blamelist is computed from the input commit to a build, while an "output" blamelist is derived from output commits.
HistoryFunc is a function that gets a list of commits from Gitiles for a specific repository, between oldRevision and newRevision, inclusive.
If oldRevision is not reachable from newRevision, returns an empty slice and nil error.
Logs represents a set of Git diffs between two Checkouts.
It is a mapping of repository URLs to a list of Git commits, representing the Git log for that repository.
ComputeLogs produces a set of Git diffs between oldCheckout and newCheckout, using the repositories in the newCheckout. historyFunc is used to grab the Git history.
Blamelist computes a set of email notifications from the Logs.
Filter filters out repositories from the Logs which are not in the whitelist and returns a new Logs.