events

package
v0.0.0-...-e280c9c Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommandMaxLen int    = 256
	AppNameMaxLen int    = 128
	CommandName   string = "argo"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplicationResolver

type ApplicationResolver struct {
	GitHubClient *gogithub.Client
	ArgoCdClient *argocd.ApplicationsClient
	Log          logging.SimpleLogging
}

func NewApplicationResolver

func NewApplicationResolver(githubClient *gogithub.Client, argocdClient *argocd.ApplicationsClient, log logging.SimpleLogging) *ApplicationResolver

func (*ApplicationResolver) FindApplicationNames

func (a *ApplicationResolver) FindApplicationNames(ctx context.Context, event github.Event) ([]string, error)

func (*ApplicationResolver) GetModifiedFiles

func (a *ApplicationResolver) GetModifiedFiles(ctx context.Context, event github.Event) ([]string, error)

copied from atlantis

type ApplyRunner

type ApplyRunner struct {
	Config      *env.Config
	Log         logging.SimpleLogging
	ApplyClient argocd.ApplyClient
	// contains filtered or unexported fields
}

func NewApplyRunner

func NewApplyRunner(vcsClient *github.Client, config *env.Config, log logging.SimpleLogging, applyClient argocd.ApplyClient) *ApplyRunner

func (*ApplyRunner) Run

func (a *ApplyRunner) Run(ctx context.Context, app string, event vsc.Event) (CommentResponse, error)

TODO: validate that the PR is in an approved/mergeable state

type CommentCommand

type CommentCommand struct {
	Flags               []string
	Name                command.Name
	Applications        []string
	ExplicitApplication bool
}

func NewAutoRunCommand

func NewAutoRunCommand(apps []string, name command.Name) *CommentCommand

type CommentParseResult

type CommentParseResult struct {
	Command            *CommentCommand
	CommentResponse    string
	Ignore             bool
	ImmediateResponse  bool
	HasResponseComment bool
}

type CommentParser

type CommentParser struct {
	AllowCommands []command.Name
	Log           logging.SimpleLogging
}

func NewCommentParser

func NewCommentParser(logger logging.SimpleLogging) *CommentParser

func (*CommentParser) Parse

func (c *CommentParser) Parse(event vsc.Event) *CommentParseResult

type CommentParsing

type CommentParsing interface {
	Parse(event github.IssueCommentEvent) CommentParseResult
}

type CommentResponse

type CommentResponse struct {
	Message string
	Event   github.Event
}

func NewCommentResponse

func NewCommentResponse(msg string, event github.Event) CommentResponse

type IssueCommentHandler

type IssueCommentHandler struct {
	githubapp.ClientCreator
	Config     *env.Config
	Log        logging.SimpleLogging
	ArgoClient argocd.ApplicationsClient
}

func (*IssueCommentHandler) Handle

func (h *IssueCommentHandler) Handle(ctx context.Context, eventType string, deliveryID string, payload []byte) error

func (*IssueCommentHandler) Handles

func (h *IssueCommentHandler) Handles() []string

type PullRequestHandler

type PullRequestHandler struct {
	githubapp.ClientCreator
	Config     *env.Config
	Log        logging.SimpleLogging
	ArgoClient argocd.ApplicationsClient
}

func (*PullRequestHandler) Handle

func (h *PullRequestHandler) Handle(ctx context.Context, eventType string, deliveryID string, payload []byte) error

func (*PullRequestHandler) Handles

func (h *PullRequestHandler) Handles() []string

Jump to

Keyboard shortcuts

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