githubcomment

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reactor

type Reactor struct {
	Log *zap.Logger
	// contains filtered or unexported fields
}

func New

func New() *Reactor

func (*Reactor) GetConfigExample

func (v *Reactor) GetConfigExample() string

func (*Reactor) GetDescription

func (v *Reactor) GetDescription() string

func (*Reactor) GetHelp

func (v *Reactor) GetHelp() string

func (*Reactor) GetName

func (v *Reactor) GetName() string

func (*Reactor) GetProperties

func (v *Reactor) GetProperties() []config.ReactorConfigProperty

func (*Reactor) GetReactorConfig

func (v *Reactor) GetReactorConfig(ctx context.Context, data *message.EventData, log *zap.Logger) (*ReactorConfig, error)

func (*Reactor) GetRequiredPropertyNames

func (v *Reactor) GetRequiredPropertyNames() []string

func (*Reactor) ProcessEvent

func (v *Reactor) ProcessEvent(ctx context.Context, data *message.EventData) error

func (*Reactor) SetLogger

func (v *Reactor) SetLogger(logger *zap.Logger)

func (*Reactor) SetReactor

func (v *Reactor) SetReactor(reactor config.ReactorConfig)

type ReactorConfig

type ReactorConfig struct {
	// Terraform plan task name, set the value when using terraform and additional data will be displayed in the github comment
	PlanTaskName string `json:"planTaskName,omitempty"`

	// True or false whether existing pipeline comments on all PR commits will be removed.
	// A pull request can contain multiple commits. Depending on how the pull request is pushed up, a pipeline may execute on each commit
	// and in turn each commit will contain a comment. When this property is true, every comment on every commit related to the pull request
	// will be removed. The default should be set to false in order to keep the pipelineRun history of each pipeline execution
	RemoveExistingCommentsFromAllPullRequestCommits bool `json:"removeExistingCommentsFromAllPullRequestCommits,omitempty"`

	// True or false whether existing pipeline comments on PR should be removed.
	// Each time the pipeline executes it will write a new issue comment to the pull request of the results of the pipelineRun
	// When this is set to true, all existing issue comments created by the pipeline will be removed. This is to make it easier
	// for people reviewing to find the results of the latest pipelineRun.
	// The default for this should be set to true so that the pull request only contains the latest pipelineRun result comment.
	// NOTE: The same comment is written to the latest commit and can be viewed by looking at the commit
	RemoveExistingPullRequestComments bool `json:"removeExistingPullRequestComments,omitempty"`

	// True or false to remove duplicate pipeline comments on a single (latest) commit
	// Each time the pipeline executes, this operator will write a comment on the latest commit. When the pipeline executes for a second time
	// on the same commit, a second comment will be written to that commit.
	// When this is set to true, any existing comments (created by this operator) on the latest commit will be removed keeping only the latest comment
	RemoveDuplicateCommitComments bool `json:"removeDuplicateCommitComments,omitempty"`

	GithubConfig *github.GitHubConfiguration

	Heading string
	Body    string
}

Jump to

Keyboard shortcuts

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