github

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidationContext = "peacock-validation"
	ReleaseContext    = "peacock-release"
)

Variables

View Source
var (
	RepoStatus = map[string]*github.RepoStatus{
		ValidationContext: {
			State:       nil,
			Description: utils.NewPtr("Validates the PR body against the feathers"),
			Context:     utils.NewPtr(ValidationContext),
		},
		ReleaseContext: {
			State:       nil,
			Description: utils.NewPtr("Sends the messages to the Teams outlined in the PR body"),
			Context:     utils.NewPtr(ReleaseContext),
		},
	}
)

RepoStatus Base repository statuses to use for creating a commit status

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(owner, repo, user, token string, prNumber int) *Client

func (*Client) CommentError added in v1.0.0

func (c *Client) CommentError(ctx context.Context, prOwner string, err error) error

func (*Client) CommentOnPR

func (c *Client) CommentOnPR(ctx context.Context, body string) error

func (*Client) CreatePeacockCommitStatus added in v1.0.0

func (c *Client) CreatePeacockCommitStatus(ctx context.Context, ref string, state domain.State, statusContext string) error

func (*Client) DeleteUsersComments added in v1.0.0

func (c *Client) DeleteUsersComments(ctx context.Context) error

func (*Client) GetFileFromBranch added in v1.0.0

func (c *Client) GetFileFromBranch(ctx context.Context, branch, path string) ([]byte, error)

func (*Client) GetKey added in v1.0.0

func (c *Client) GetKey() string

func (*Client) GetLatestCommitSHAInBranch added in v1.0.0

func (c *Client) GetLatestCommitSHAInBranch(ctx context.Context, branch string) (string, error)

func (*Client) GetPRComments added in v0.13.0

func (c *Client) GetPRComments(ctx context.Context) ([]*github.IssueComment, error)

func (*Client) GetPRCommentsByUser added in v1.0.0

func (c *Client) GetPRCommentsByUser(ctx context.Context) ([]*github.IssueComment, error)

func (*Client) GetPullRequestBodyFromCommit

func (c *Client) GetPullRequestBodyFromCommit(ctx context.Context, sha string) (*string, error)

func (*Client) GetPullRequestBodyFromPRNumber

func (c *Client) GetPullRequestBodyFromPRNumber(ctx context.Context) (*string, error)

func (*Client) HandleError added in v1.0.0

func (c *Client) HandleError(ctx context.Context, statusContext, headSHA, prOwner string, err error) error

type ClientFactory added in v1.0.0

type ClientFactory struct {
	// contains filtered or unexported fields
}

func NewClientFactory added in v1.0.0

func NewClientFactory(token string) *ClientFactory

func (*ClientFactory) GetClient added in v1.0.0

func (c *ClientFactory) GetClient(owner, repo, user string, prNumber int) domain.SCM

func (*ClientFactory) RemoveClient added in v1.0.0

func (c *ClientFactory) RemoveClient(key string)

Jump to

Keyboard shortcuts

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