luci: go.chromium.org/luci/luci_notify/config Index | Files

package config

import "go.chromium.org/luci/luci_notify/config"

Index

Package Files

builder.go config.go emailtemplate.go project.go settings.go tree_closer.go validate.go

func UpdateHandler Uses

func UpdateHandler(c *router.Context)

UpdateHandler is the HTTP router handler for handling cron-triggered configuration update requests.

type Builder Uses

type Builder struct {
    // ProjectKey is a datastore key to this Builder's project. Note that this key
    // is a parent key, effectively making the Builder a child of a specific project.
    ProjectKey *datastore.Key `gae:"$parent"`

    // ID is the builder's canonical ID (e.g. <bucket>/<name>).
    ID  string `gae:"$id"`

    // Repository is the repository this builder is tracking and the repository that
    // Revision is valid for.
    Repository string

    // Notifications is Notifications proto message, containing Notification messages
    // associated with this builder. Each notification contains information about who
    // to notify, and different settings on how to notify them.
    Notifications notifypb.Notifications

    // Status is current status of the builder.
    // It is updated every time a new build has a new status and either
    //   1) the new build has a newer revision than StatusRevision, or
    //   2) the new build's revision == StatusRevision, but it has a newer
    //      creation time.
    Status buildbucketpb.Status

    // BuildTime is computed as the creation time of the most recent build encountered.
    // It can be used to decide whether Status and this Builder should be updated.
    BuildTime time.Time

    // Revision is the revision of the codebase that's associated with the most
    // recent build encountered. It can be used to decide whether Status should be
    // updated.
    Revision string

    // GitilesCommits are the gitiles commits checked out by the most recent build
    // encountered that had a non-empty checkout. It can also be used to compute a
    // blamelist.
    GitilesCommits notifypb.GitilesCommits
    // contains filtered or unexported fields
}

Builder represents the state of the last build seen from a particular builder in order to implement certain notification triggers (i.e. on change).

type EmailTemplate Uses

type EmailTemplate struct {
    // ProjectKey is a datastore key of the LUCI project containing this email
    // template.
    ProjectKey *datastore.Key `gae:"$parent"`

    // Name identifies the email template. It is unique within the project.
    Name string `gae:"$id"`

    // SubjectTextTemplate is a text.Template of the email subject.
    SubjectTextTemplate string `gae:",noindex"`

    // BodyHTMLTemplate is a html.Template of the email body.
    BodyHTMLTemplate string `gae:",noindex"`

    // DefinitionURL is a URL to human-viewable page that contains the definition
    // of this email template.
    DefinitionURL string `gae:",noindex"`
}

EmailTemplate is a Datastore entity directly under Project entity that represents an email template. It is managed by the cron job that ingests configs.

func (*EmailTemplate) Template Uses

func (t *EmailTemplate) Template() *mailtmpl.Template

Template converts t to *mailtmpl.Template.

type Project Uses

type Project struct {
    // Name is the name of the project.
    //
    // This must be unique on this luci-notify instance.
    Name string `gae:"$id"`

    // Revision is the revision of this project's luci-notify configuration.
    Revision string

    // URL is the luci-config URL to this project's luci-notify configuration.
    URL string

    // TreeClosingEnabled determines whether we actually act on TreeClosers
    // for this project, and close/reopen the relevant tree. If false, we
    // still monitor builders, but just log what action we would have taken.
    TreeClosingEnabled bool
}

Project represents the luci-notify configuration for a single project in the datastore.

type Settings Uses

type Settings struct {
    // ID is the datastore ID for service settings.
    ID  string `gae:"$id,service_config"`

    // Revision is the revision of this instance's configuration.
    Revision string

    // Settings is an embedded copy of this instance's configuration proto.
    Settings notifypb.Settings `gae:"-"`
}

Settings represents the luci-notify configuration for a single instance of the service.

func (*Settings) Load Uses

func (s *Settings) Load(props datastore.PropertyMap) error

Load loads a Settings's information from props.

This implements PropertyLoadSaver. Load unmarshals the property Settings stored in the datastore as a binary proto into the struct's Settings field.

func (*Settings) Save Uses

func (s *Settings) Save(withMeta bool) (datastore.PropertyMap, error)

Save saves a Settings's information to a property map.

This implements PropertyLoadSaver. Save marshals the Settings field as a binary proto and stores it in the Settings property.

type TreeCloser Uses

type TreeCloser struct {
    // BuilderKey is a datastore key to this TreeCloser's parent builder.
    BuilderKey *datastore.Key `gae:"$parent"`

    // TreeStatusHost is the host that this rule opens/closes. This is
    // duplicated from notifypb.TreeCloser, so that we can use it as the ID
    // for datastore. The combination of tree status host and builder is
    // guaranteed to be unique.
    TreeStatusHost string `gae:"$id"`

    // TreeCloser is the underlying TreeCloser proto from the current
    // version of the config.
    TreeCloser notifypb.TreeCloser

    // Status is the current status of this rule. If any TreeCloser for a
    // given tree-status host has a status of 'Closed', the tree will be
    // closed.
    Status TreeCloserStatus

    // Timestamp stores the finish time of the build which caused us to set
    // the current status. This is used to decide which template to use
    // when setting the tree status message.
    Timestamp time.Time

    // Message contains the status message to use if this TreeCloser is the
    // one that updates the status of the tree. Only valid if Status is
    // Closed.
    Message string
}

TreeCloser represents a tree closing rule from the config, along with its current state.

type TreeCloserStatus Uses

type TreeCloserStatus string
const (
    Open   TreeCloserStatus = "Open"
    Closed TreeCloserStatus = "Closed"
)

Package config imports 25 packages (graph) and is imported by 2 packages. Updated 2020-09-22. Refresh now. Tools for package owners.