repoconfig

package
v0.0.789 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Approve

type Approve struct {
	// IssueRequired indicates if an associated issue is required for approval in
	// the specified repos.
	IssueRequired bool `json:"issueRequired,omitempty"`

	// RequireSelfApproval requires PR authors to explicitly approve their PRs.
	// Otherwise the plugin assumes the author of the PR approves the changes in the PR.
	RequireSelfApproval *bool `json:"requireSelfApproval,omitempty"`

	// LgtmActsAsApprove indicates that the lgtm command should be used to
	// indicate approval
	LgtmActsAsApprove bool `json:"lgtmActsAsApprove,omitempty"`

	// IgnoreReviewState causes the approve plugin to ignore the GitHub review state. Otherwise:
	// * an APPROVE github review is equivalent to leaving an "/approve" message.
	// * A REQUEST_CHANGES github review is equivalent to leaving an /approve cancel" message.
	IgnoreReviewState *bool `json:"ignoreReviewState,omitempty"`
}

Approve specifies a configuration for a single approve.

The configuration for the approve plugin is defined as a list of these structures.

type Brancher

type Brancher struct {
	// Do not run against these branches. Default is no branches.
	SkipBranches []string `json:"skipBranches,omitempty"`
	// Only run against these branches. Default is all branches.
	Branches []string `json:"branches,omitempty"`
	// contains filtered or unexported fields
}

Brancher is for shared code between jobs that only run against certain branches. An empty brancher runs against all branches.

type ChangedFilesProvider

type ChangedFilesProvider func() ([]string, error)

ChangedFilesProvider returns a slice of modified files.

type JobBase

type JobBase struct {
	// The name of the job. Must match regex [A-Za-z0-9-._]+
	// e.g. pull-test-infra-bazel-build
	Name string `json:"name"`
	// Labels are added to LighthouseJobs and pods created for this job.
	Labels map[string]string `json:"labels,omitempty"`
	// Annotations are unused by prow itself, but provide a space to configure other automation.
	Annotations map[string]string `json:"annotations,omitempty"`
	// MaximumConcurrency of this job, 0 implies no limit.
	MaxConcurrency int `json:"maxConcurrency,omitempty"`
	// Agent that will take care of running this job.
	Agent string `json:"agent"`
	// Cluster is the alias of the cluster to run this job in.
	// (Default: kube.DefaultClusterAlias)
	Cluster string `json:"cluster,omitempty"`
	// Namespace is the namespace in which pods schedule.
	//   nil: results in config.PodNamespace (aka pod default)
	//   empty: results in config.LighthouseJobNamespace (aka same as LighthouseJob)
	Namespace *string `json:"namespace,omitempty"`
	// ErrorOnEviction indicates that the LighthouseJob should be completed and given
	// the ErrorState status if the pod that is executing the job is evicted.
	// If this field is unspecified or false, a new pod will be created to replace
	// the evicted one.
	ErrorOnEviction bool `json:"errorOnEviction,omitempty"`
	// SourcePath contains the path where this job is defined
	SourcePath string `json:"-"`
	// Spec is the Kubernetes pod spec used if Agent is kubernetes.
	Spec *v1.PodSpec `json:"spec,omitempty"`
	// PipelineRunSpec is the Tekton PipelineRun spec used if agent is tekton-pipeline
	PipelineRunSpec *tektonv1beta1.PipelineRunSpec `json:"pipelineRunSpec,omitempty"`
	// PipelineRunParams are the params used by the pipeline run
	PipelineRunParams []job.PipelineRunParam `json:"pipeline_run_params,omitempty"`

	UtilityConfig
}

JobBase contains attributes common to all job types

type Keeper

type Keeper struct {
	// Query the query to add for the repository
	Query *keeper.Query `json:"query,omitempty"`
}

Keeper for keeper specific queries

type Periodic

type Periodic struct {
	JobBase

	// (deprecated)Interval to wait between two runs of the job.
	Interval string `json:"interval"`
	// Cron representation of job trigger time
	Cron string `json:"cron"`
	// Tags for config entries
	Tags []string `json:"tags,omitempty"`
	// contains filtered or unexported fields
}

Periodic runs on a timer.

type PluginConfig

type PluginConfig struct {
	// Plugins the list of plugins
	Plugins []string `json:"plugins,omitempty"`

	// Approve approve plugin configuration
	Approve *Approve `json:"approve,omitempty"`
}

PluginConfig configuration for plugins

type Postsubmit

type Postsubmit struct {
	JobBase

	RegexpChangeMatcher

	Brancher

	// TODO(krzyzacy): Move existing `Report` into `SkipReport` once this is deployed
	Reporter
}

Postsubmit runs on push events.

type Presubmit

type Presubmit struct {
	JobBase

	// AlwaysRun automatically for every PR, or only when a comment triggers it.
	AlwaysRun bool `json:"alwaysRun"`

	// Optional indicates that the job's status context should not be required for merge.
	Optional bool `json:"optional,omitempty"`

	// Trigger is the regular expression to trigger the job.
	// e.g. `@k8s-bot e2e test this`
	// RerunCommand must also be specified if this field is specified.
	// (Default: `(?m)^/test (?:.*? )?<job name>(?: .*?)?$`)
	Trigger string `json:"trigger,omitempty"`

	// The RerunCommand to give users. Must match Trigger.
	// Trigger must also be specified if this field is specified.
	// (Default: `/test <job name>`)
	RerunCommand string `json:"rerunCommand,omitempty"`

	Brancher

	RegexpChangeMatcher

	Reporter
}

Presubmit runs on PRs.

type RegexpChangeMatcher

type RegexpChangeMatcher struct {
	// RunIfChanged defines a regex used to select which subset of file changes should trigger this job.
	// If any file in the changeset matches this regex, the job will be triggered
	RunIfChanged string `json:"runIfChanged,omitempty"`
	// contains filtered or unexported fields
}

RegexpChangeMatcher is for code shared between jobs that run only when certain files are changed.

type Reporter

type Reporter struct {
	// Context is the name of the GitHub status context for the job.
	// Defaults: the same as the name of the job.
	Context string `json:"context,omitempty"`
	// SkipReport skips commenting and setting status on GitHub.
	SkipReport bool `json:"skipReport,omitempty"`
}

Reporter keeps various details for status reporting

type RepositoryConfig

type RepositoryConfig struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ObjectMeta `json:"metadata"`

	// Spec holds the desired state of the RepositoryConfig from the client
	// +optional
	Spec RepositoryConfigSpec `json:"spec"`
}

RepositoryConfig represents local repository configurations

type RepositoryConfigList

type RepositoryConfigList struct {
	metav1.TypeMeta `json:",inline"`
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []RepositoryConfig `json:"items"`
}

RepositoryConfigList contains a list of RepositoryConfig

type RepositoryConfigSpec

type RepositoryConfigSpec struct {
	// Presubmit zero or more presubmits
	Presubmits []Presubmit `json:"presubmits,omitempty"`

	// Postsubmit zero or more postsubmits
	Postsubmits []Postsubmit `json:"postsubmits,omitempty"`

	// Plugins the plugin names to enable for this repository
	Plugins []string `json:"plugins,omitempty"`

	// BranchProtections to configure branch protection
	BranchProtection *branchprotection.ContextPolicy `json:"branchProtection,omitempty"`

	// PluginConfig the configuration for the plugins
	PluginConfig *PluginConfig `json:"pluginConfig,omitempty"`

	// Keeper any keeper/tide related configurations
	Keeper *Keeper `json:"keeper,omitempty"`
}

RepositoryConfigSpec defines the desired state of RepositoryConfig.

type UtilityConfig

type UtilityConfig struct {
	// Decorate determines if we decorate the PodSpec or not
	Decorate bool `json:"decorate,omitempty"`

	// PathAlias is the location under <root-dir>/src
	// where the repository under test is cloned. If this
	// is not set, <root-dir>/src/github.com/org/repo will
	// be used as the default.
	PathAlias string `json:"pathAlias,omitempty"`
	// CloneURI is the URI that is used to clone the
	// repository. If unset, will default to
	// `https://github.com/org/repo.git`.
	CloneURI string `json:"cloneUri,omitempty"`
	// SkipSubmodules determines if submodules should be
	// cloned when the job is run. Defaults to true.
	SkipSubmodules bool `json:"skipSubmodules,omitempty"`
	// CloneDepth is the depth of the clone that will be used.
	// A depth of zero will do a full clone.
	CloneDepth int `json:"cloneDepth,omitempty"`
}

UtilityConfig holds decoration metadata, such as how to clone and additional containers/etc

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL