reconciler

package
v0.0.0-...-22eae67 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ControllerName is the name of the PR status updater controller
	ControllerName = "pr-status-updater-controller"
)

Variables

This section is empty.

Functions

func NewController

func NewController(scmClient *scm.Client, botUser string) func(context.Context, configmap.Watcher) *controller.Impl

NewController instantiates a new controller

Types

type Reconciler

type Reconciler struct {
	SCMClient *scm.Client
	BotUser   string
}

Reconciler is the core of the implementation of the PR commenter, adding, updating, or deleting comments as needed.

func (*Reconciler) ReconcileKind

func (c *Reconciler) ReconcileKind(ctx context.Context, r *v1beta1.CustomRun) kreconciler.Event

ReconcileKind implements Interface.ReconcileKind.

type StatusInfo

type StatusInfo struct {
	// Repo is the repository name.
	Repo string `json:"repo"`

	// SHA is the commit SHA the job ran against.
	SHA string `json:"sha"`

	// JobName is the name of the job whose result we're receiving.
	JobName string `json:"jobName"`

	// TargetURL is the URL for the job's logs.
	// +optional
	TargetURL string `json:"targetURL,omitempty"`

	// State is the state for the status. Must be one of `error`, `pending`, `failure`, or `success`
	State string `json:"state"`

	// Description is an optional description for the status.
	// +optional
	Description string `json:"description,omitempty"`
}

StatusInfo defines the desired state of the status update

func StatusInfoFromRun

func StatusInfoFromRun(r *v1beta1.CustomRun) (*StatusInfo, *apis.FieldError)

StatusInfoFromRun reads params from the given Run and returns either a populated info or errors.

Jump to

Keyboard shortcuts

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