diff --git a/cmd/keeper/config.md b/cmd/keeper/config.md index 65e7791ff..5895aec32 100644 --- a/cmd/keeper/config.md +++ b/cmd/keeper/config.md @@ -14,6 +14,7 @@ The following configuration fields are available: * `status_update_period`: The field specifies how often Tide will update GitHub status contexts. Defaults to the value of `sync_period`. * `queries`: List of queries (described below). +* `default_merge_method`: The default merge type for lighthouse to use, and the merge_method list will override this. Defaults to "merge" * `merge_method`: A key/value pair of an `org/repo` as the key and merge method to override the default method of merge as value. Valid options are `squash`, `rebase`, and `merge`. Defaults to `merge`. diff --git a/pkg/config/keeper/config.go b/pkg/config/keeper/config.go index 29449a8ee..97d5091db 100644 --- a/pkg/config/keeper/config.go +++ b/pkg/config/keeper/config.go @@ -35,6 +35,8 @@ type Config struct { // Queries represents a list of GitHub search queries that collectively // specify the set of PRs that meet merge requirements. Queries Queries `json:"queries,omitempty"` + // The default merge type for lighthouse to use, and the merge_method list will override this. Defaults to "merge" + DefaultMergeType PullRequestMergeType `json:"default_merge_method,omitempty"` // A key/value pair of an org/repo as the key and merge method to override // the default method of merge. Valid options are squash, rebase, and merge. MergeType map[string]PullRequestMergeType `json:"merge_method,omitempty"` @@ -95,7 +97,7 @@ func (c *Config) MergeMethod(org, repo string) PullRequestMergeType { return ov } - return MergeMerge + return c.DefaultMergeType } return v @@ -128,6 +130,9 @@ func (c *Config) MergeCommitTemplate(org, repo string) MergeCommitTemplate { // Parse initializes and validates the Config func (c *Config) Parse() error { + if c.DefaultMergeType == "" { + c.DefaultMergeType = MergeMerge + } if c.SyncPeriodString == "" { c.SyncPeriod = time.Minute } else { diff --git a/pkg/config/lighthouse/config.go b/pkg/config/lighthouse/config.go index 45616f7ae..f96ae9dd6 100644 --- a/pkg/config/lighthouse/config.go +++ b/pkg/config/lighthouse/config.go @@ -38,18 +38,18 @@ type Config struct { // TODO: Move this out of the main config. Jenkinses []JenkinsConfig `json:"jenkinses,omitempty"` - // LighthouseJobNamespace is the namespace in the cluster that prow + // LighthouseJobNamespace is the namespace in the cluster that lighthouse // components will use for looking up LighthouseJobs. The namespace - // needs to exist and will not be created by prow. + // needs to exist and will not be created by lighthouse. // Defaults to "default". LighthouseJobNamespace string `json:"prowjob_namespace,omitempty"` - // PodNamespace is the namespace in the cluster that prow + // PodNamespace is the namespace in the cluster that lighthouse // components will use for looking up Pods owned by LighthouseJobs. - // The namespace needs to exist and will not be created by prow. + // The namespace needs to exist and will not be created by lighthouse. // Defaults to "default". PodNamespace string `json:"pod_namespace,omitempty"` // LogLevel enables dynamically updating the log level of the - // standard logger that is used by all prow components. + // standard logger that is used by all lighthouse components. // // Valid values: // @@ -64,7 +64,7 @@ type Config struct { OwnersDirExcludes *OwnersDirExcludes `json:"owners_dir_excludes,omitempty"` // Pub/Sub Subscriptions that we want to listen to PubSubSubscriptions PubsubSubscriptions `json:"pubsub_subscriptions,omitempty"` - // GitHubOptions allows users to control how prow applications display GitHub website links. + // GitHubOptions allows users to control how lighthouse applications display GitHub website links. GitHubOptions GitHubOptions `json:"github,omitempty"` // ProviderConfig contains optional SCM provider information ProviderConfig *ProviderConfig `json:"providerConfig,omitempty"` @@ -113,7 +113,7 @@ func (c *Config) Parse() error { // InRepoConfig to enable configuration inside the source code of a repository // -// this struct mirrors the similar struct inside prow +// this struct mirrors the similar struct inside lighthouse type InRepoConfig struct { // Enabled describes whether InRepoConfig is enabled for a given repository. This can // be set globally, per org or per repo using '*', 'org' or 'org/repo' as key. The