utils

package
v3.0.0-...-228f170 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2023 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBranchNil               = errors.New("branch is nil")
	ErrBranchRefNil            = errors.New("branch ref is nil")
	ErrBranchRepoNil           = errors.New("branch repo is nil")
	ErrBranchRepoNameNil       = errors.New("branch repo name is nil")
	ErrBranchRepoOwnerNil      = errors.New("branch repo owner is nil")
	ErrBranchRepoOwnerLoginNil = errors.New("branch repo owner login is nil")
)

Functions

func LoadReviewpadFile

func LoadReviewpadFile(ctx context.Context, logger *logrus.Entry, githubClient *reviewpad_gh.GithubClient, filePath string, branch *github.PullRequestBranch) (*engine.ReviewpadFile, error)

func LogErr

func LogErr(err error)

func LogFatalErr

func LogFatalErr(err error)

func ReviewpadFileChanged

func ReviewpadFileChanged(ctx context.Context, githubClient *reviewpad_gh.GithubClient, filePath string, pullRequest *github.PullRequest) (bool, error)

reviewpad-an: experimental ReviewpadFileChanges checks if a file path was changed in a pull request. The way this is done depends on the number of files changed in the pull request. If the number of files changed is greater than pullRequestFileLimit, then we download both files using the filePath and check their contents. This strategy assumes that the file path exists in the head branch. Otherwise, we download the pull request files and check the filePath exists in them.

func ValidateBranch

func ValidateBranch(branch *github.PullRequestBranch) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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